1012 lines
29 KiB
Vue
1012 lines
29 KiB
Vue
<!-- 预产及在途样本 — 协议卡片列表(紧凑卡片 + 行内下方展开详情) -->
|
||
<template>
|
||
<div class="list-body list-wrap">
|
||
<div v-loading="loading" ref="listRef" class="protocol-card-section">
|
||
<div v-if="rows.length" class="protocol-card-list">
|
||
<div
|
||
v-for="(group, groupIndex) in groupedRows"
|
||
:key="groupIndex"
|
||
class="protocol-card-row-group"
|
||
>
|
||
<div class="protocol-card-row">
|
||
<article
|
||
v-for="{ row, index } in group.items"
|
||
:key="rowKey(row)"
|
||
class="protocol-card is-compact"
|
||
:class="{
|
||
'is-active': isExpanded(row),
|
||
'is-urgent': isUrgentCard(row)
|
||
}"
|
||
@click="toggleExpand(row)"
|
||
@dblclick.stop="emit('view', row)"
|
||
>
|
||
<div class="protocol-card-compact">
|
||
<div class="protocol-card-compact__head">
|
||
<span class="protocol-card__index">{{
|
||
(pagination.page - 1) * pagination.pageSize + index + 1
|
||
}}</span>
|
||
<span class="protocol-card__name" :title="String(row.motherName || '')">{{
|
||
row.motherName || '—'
|
||
}}</span>
|
||
</div>
|
||
<div class="protocol-card-compact__tags">
|
||
<el-tag :type="sourceTypeTagType(row)" size="small">
|
||
{{ row.sourceTypeLabel || '细胞存储' }}
|
||
</el-tag>
|
||
<el-tag :type="statusTagType(row)" size="small">
|
||
{{ statusLabel(row) }}
|
||
</el-tag>
|
||
</div>
|
||
<div class="protocol-card-compact__body">
|
||
<div class="protocol-card-compact__field">
|
||
<label>预计到达</label>
|
||
<span
|
||
class="protocol-card__kv-value protocol-card__kv-value--danger"
|
||
:title="String(row.etaTimeSummary || '')"
|
||
>
|
||
{{ row.etaTimeSummary || '—' }}
|
||
</span>
|
||
</div>
|
||
<div class="protocol-card-compact__field">
|
||
<label>预产期</label>
|
||
<span
|
||
class="protocol-card__kv-value protocol-card__kv-value--danger"
|
||
:title="String(row.expectedDeliveryDate || '')"
|
||
>
|
||
{{ row.expectedDeliveryDate || '—' }}
|
||
</span>
|
||
</div>
|
||
<div class="protocol-card-compact__field">
|
||
<label>样本采集</label>
|
||
<span
|
||
class="protocol-card-compact__sample"
|
||
:title="String(row.sampleCollectSummary || '')"
|
||
>
|
||
{{ row.sampleCollectSummary || '—' }}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div class="protocol-card-compact__foot">
|
||
<el-button
|
||
class="btn-ghost protocol-card-compact__toggle"
|
||
:title="isExpanded(row) ? '收起详情' : '展开详情'"
|
||
@click.stop="toggleExpand(row)"
|
||
>
|
||
<el-icon><ArrowUp v-if="isExpanded(row)" /><ArrowDown v-else /></el-icon>
|
||
</el-button>
|
||
</div>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
|
||
<div v-if="getGroupExpandedItem(group)" class="protocol-card-detail">
|
||
<article
|
||
v-if="getGroupExpandedItem(group)"
|
||
class="protocol-card protocol-card--detail"
|
||
>
|
||
<div class="protocol-card__aside">
|
||
<div class="protocol-card__name-row">
|
||
<span class="protocol-card__index">{{
|
||
(pagination.page - 1) * pagination.pageSize +
|
||
getGroupExpandedItem(group)!.index +
|
||
1
|
||
}}</span>
|
||
<span class="protocol-card__name">{{
|
||
getGroupExpandedItem(group)!.row.motherName || '—'
|
||
}}</span>
|
||
</div>
|
||
<el-tag
|
||
:type="sourceTypeTagType(getGroupExpandedItem(group)!.row)"
|
||
size="small"
|
||
class="protocol-card__source"
|
||
>
|
||
{{ getGroupExpandedItem(group)!.row.sourceTypeLabel || '细胞存储' }}
|
||
</el-tag>
|
||
<el-tag
|
||
:type="statusTagType(getGroupExpandedItem(group)!.row)"
|
||
size="small"
|
||
class="protocol-card__status"
|
||
>
|
||
{{ statusLabel(getGroupExpandedItem(group)!.row) }}
|
||
</el-tag>
|
||
<div
|
||
v-if="getGroupExpandedItem(group)!.row.createTime"
|
||
class="protocol-card__create-time"
|
||
>
|
||
创建 {{ getGroupExpandedItem(group)!.row.createTime }}
|
||
</div>
|
||
</div>
|
||
<div class="protocol-card__sections">
|
||
<section class="protocol-card__block protocol-card__block--basic">
|
||
<div class="protocol-card__block-title">基础信息</div>
|
||
<div class="protocol-card__kv-grid">
|
||
<div class="protocol-card__kv">
|
||
<label>协议号</label>
|
||
<span>{{ getGroupExpandedItem(group)!.row.protocolNo || '—' }}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>登记日期</label>
|
||
<span>{{ getGroupExpandedItem(group)!.row.registerDate || '—' }}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>样本采集</label>
|
||
<span>{{
|
||
getGroupExpandedItem(group)!.row.sampleCollectSummary || '—'
|
||
}}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>采集时间</label>
|
||
<span>{{
|
||
getGroupExpandedItem(group)!.row.sampleCollectTime || '—'
|
||
}}</span>
|
||
</div>
|
||
<div
|
||
v-if="
|
||
mode === 'in_transit' && getGroupExpandedItem(group)!.row.etaTimeSummary
|
||
"
|
||
class="protocol-card__kv"
|
||
>
|
||
<label>预计到达</label>
|
||
<span class="protocol-card__kv-value protocol-card__kv-value--danger">{{
|
||
getGroupExpandedItem(group)!.row.etaTimeSummary
|
||
}}</span>
|
||
</div>
|
||
<div
|
||
v-if="
|
||
mode === 'pre_delivery' &&
|
||
getGroupExpandedItem(group)!.row.preDeliveryKindLabel
|
||
"
|
||
class="protocol-card__kv"
|
||
>
|
||
<label>预产类型</label>
|
||
<span>{{ getGroupExpandedItem(group)!.row.preDeliveryKindLabel }}</span>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="protocol-card__block protocol-card__block--newborn">
|
||
<div class="protocol-card__block-title">新生儿</div>
|
||
<div class="protocol-card__kv-grid">
|
||
<div class="protocol-card__kv">
|
||
<label>姓名</label>
|
||
<span>{{ getGroupExpandedItem(group)!.row.newbornName || '—' }}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>性别</label>
|
||
<span>{{
|
||
newbornSexLabel(
|
||
String(getGroupExpandedItem(group)!.row.newbornSex || '')
|
||
) || '—'
|
||
}}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>预产期</label>
|
||
<span class="protocol-card__kv-value protocol-card__kv-value--danger">{{
|
||
getGroupExpandedItem(group)!.row.expectedDeliveryDate || '—'
|
||
}}</span>
|
||
</div>
|
||
<div class="protocol-card__kv">
|
||
<label>分娩时间</label>
|
||
<span>{{
|
||
getGroupExpandedItem(group)!.row.newbornDeliveryTime || '—'
|
||
}}</span>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="protocol-card__block protocol-card__block--samples">
|
||
<div class="protocol-card__block-title">
|
||
样本信息
|
||
<span
|
||
v-if="getSampleItems(getGroupExpandedItem(group)!.row).length"
|
||
class="protocol-card__block-count"
|
||
>
|
||
{{ getSampleItems(getGroupExpandedItem(group)!.row).length }} 项
|
||
</span>
|
||
</div>
|
||
<div
|
||
v-if="getSampleItems(getGroupExpandedItem(group)!.row).length"
|
||
class="protocol-card__sample-list"
|
||
>
|
||
<div
|
||
v-for="(item, sIdx) in getSampleItems(getGroupExpandedItem(group)!.row)"
|
||
:key="sIdx"
|
||
class="protocol-card__sample-item"
|
||
>
|
||
<span class="protocol-card__sample-seq">{{ sIdx + 1 }}</span>
|
||
<div class="protocol-card__sample-main">
|
||
<div class="protocol-card__sample-line">
|
||
<span class="protocol-card__sample-label">类型</span>
|
||
<span class="protocol-card__sample-value">{{
|
||
item.sampleTypeName || '—'
|
||
}}</span>
|
||
<el-tag
|
||
v-if="item.sampleStatus"
|
||
:type="sampleStatusTagType(item.sampleStatus)"
|
||
size="small"
|
||
class="protocol-card__sample-status"
|
||
>
|
||
{{ sampleStatusLabel(item.sampleStatus) }}
|
||
</el-tag>
|
||
</div>
|
||
<div class="protocol-card__sample-line">
|
||
<span class="protocol-card__sample-label">编码</span>
|
||
<span class="protocol-card__sample-value protocol-card__sample-value--code">
|
||
{{ item.sampleCode || '—' }}
|
||
</span>
|
||
</div>
|
||
<div class="protocol-card__sample-line">
|
||
<span class="protocol-card__sample-label">运输</span>
|
||
<span class="protocol-card__sample-value">{{
|
||
formatTransportSummary(item.transport)
|
||
}}</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div v-else class="protocol-card__empty">
|
||
{{
|
||
mode === 'pre_delivery' &&
|
||
getGroupExpandedItem(group)!.row.preDeliveryKindLabel
|
||
? getGroupExpandedItem(group)!.row.preDeliveryKindLabel
|
||
: '暂无样本'
|
||
}}
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<div class="protocol-card__foot">
|
||
<div class="protocol-card__actions">
|
||
<el-button
|
||
class="btn-op-item"
|
||
@click.stop="toggleExpand(getGroupExpandedItem(group)!.row)"
|
||
>
|
||
<el-icon><ArrowUp /></el-icon>收起
|
||
</el-button>
|
||
<el-button
|
||
class="btn-op-item"
|
||
@click.stop="emit('view', getGroupExpandedItem(group)!.row)"
|
||
>
|
||
<el-icon><View /></el-icon>查看
|
||
</el-button>
|
||
</div>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<el-empty
|
||
v-else-if="!loading"
|
||
class="protocol-card-empty"
|
||
:description="emptyDescription"
|
||
:image-size="80"
|
||
/>
|
||
</div>
|
||
<div class="pagination list-pager-bar">
|
||
<el-pagination
|
||
:current-page="pagination.page"
|
||
:page-size="pagination.pageSize"
|
||
:total="pagination.total"
|
||
:page-sizes="[10, 20, 50]"
|
||
layout="total, sizes, prev, pager, next"
|
||
@size-change="(val) => emit('page-size-change', val)"
|
||
@current-change="(val) => emit('page-change', val)"
|
||
/>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
|
||
import { View, ArrowDown, ArrowUp } from '@element-plus/icons-vue'
|
||
import type { PreTransitProtocolRow } from '@/api/pre-transit-sample'
|
||
import {
|
||
protocolStatusLabel,
|
||
protocolStatusTagType,
|
||
donationStatusLabel,
|
||
donationStatusTagType,
|
||
newbornSexLabel,
|
||
sampleStatusLabel,
|
||
sampleStatusTagType,
|
||
transportTypeLabel
|
||
} from '@/utils/status-tag-registry'
|
||
import type { TagType } from '@/utils/status-tag-registry'
|
||
|
||
defineOptions({ name: 'PreTransitProtocolCardList' })
|
||
|
||
type ProtocolSampleTransport = {
|
||
transportType?: string
|
||
destSiteName?: string
|
||
expressCompanyName?: string
|
||
waybillNo?: string
|
||
carrierName?: string
|
||
carrierPhone?: string
|
||
etaTime?: string
|
||
}
|
||
|
||
type ProtocolSampleItem = {
|
||
sampleTypeName: string
|
||
sampleCode: string
|
||
sampleStatus: string
|
||
labStorageCode: string
|
||
transport?: ProtocolSampleTransport | null
|
||
}
|
||
|
||
type GroupItem = { row: PreTransitProtocolRow; index: number }
|
||
type CardRowGroup = { items: GroupItem[] }
|
||
|
||
const GRID_GAP = 10
|
||
const LIST_PADDING = 32
|
||
|
||
const props = withDefaults(
|
||
defineProps<{
|
||
rows: PreTransitProtocolRow[]
|
||
loading: boolean
|
||
pagination: { page: number; pageSize: number; total: number }
|
||
mode?: 'in_transit' | 'pre_delivery'
|
||
emptyDescription?: string
|
||
}>(),
|
||
{
|
||
mode: 'in_transit',
|
||
emptyDescription: '暂无数据'
|
||
}
|
||
)
|
||
|
||
const emit = defineEmits<{
|
||
view: [row: PreTransitProtocolRow]
|
||
'page-size-change': [size: number]
|
||
'page-change': [page: number]
|
||
}>()
|
||
|
||
const listRef = ref<HTMLElement | null>(null)
|
||
const columnsPerRow = ref(1)
|
||
const expandedKey = ref<string | null>(null)
|
||
let resizeObserver: ResizeObserver | null = null
|
||
|
||
function minColWidthForViewport(width: number) {
|
||
if (width <= 768) return 136
|
||
if (width <= 1200) return 152
|
||
return 172
|
||
}
|
||
|
||
function updateColumnsPerRow() {
|
||
const el = listRef.value
|
||
if (!el) return
|
||
const innerWidth = Math.max(0, el.clientWidth - LIST_PADDING)
|
||
const minCol = minColWidthForViewport(window.innerWidth)
|
||
columnsPerRow.value = Math.max(
|
||
1,
|
||
Math.floor((innerWidth + GRID_GAP) / (minCol + GRID_GAP))
|
||
)
|
||
}
|
||
|
||
const groupedRows = computed<CardRowGroup[]>(() => {
|
||
const cols = columnsPerRow.value
|
||
const groups: CardRowGroup[] = []
|
||
for (let i = 0; i < props.rows.length; i += cols) {
|
||
const items = props.rows.slice(i, i + cols).map((row, offset) => ({
|
||
row,
|
||
index: i + offset
|
||
}))
|
||
groups.push({ items })
|
||
}
|
||
return groups
|
||
})
|
||
|
||
watch(
|
||
() => [props.rows, props.pagination.page, props.pagination.pageSize],
|
||
async () => {
|
||
expandedKey.value = null
|
||
await nextTick()
|
||
updateColumnsPerRow()
|
||
}
|
||
)
|
||
|
||
function setupResizeObserver() {
|
||
resizeObserver?.disconnect()
|
||
resizeObserver = null
|
||
if (typeof ResizeObserver !== 'undefined' && listRef.value) {
|
||
resizeObserver = new ResizeObserver(() => updateColumnsPerRow())
|
||
resizeObserver.observe(listRef.value)
|
||
}
|
||
}
|
||
|
||
onMounted(async () => {
|
||
await nextTick()
|
||
updateColumnsPerRow()
|
||
setupResizeObserver()
|
||
window.addEventListener('resize', updateColumnsPerRow)
|
||
})
|
||
|
||
onBeforeUnmount(() => {
|
||
resizeObserver?.disconnect()
|
||
window.removeEventListener('resize', updateColumnsPerRow)
|
||
})
|
||
|
||
function rowKey(row: PreTransitProtocolRow) {
|
||
const id = String(row.collectionProtocolId || row.researchDonationId || row.id || '')
|
||
return `${String(row.sourceType || '')}:${id}`
|
||
}
|
||
|
||
function isExpanded(row: PreTransitProtocolRow) {
|
||
return expandedKey.value === rowKey(row)
|
||
}
|
||
|
||
function toggleExpand(row: PreTransitProtocolRow) {
|
||
const key = rowKey(row)
|
||
expandedKey.value = expandedKey.value === key ? null : key
|
||
}
|
||
|
||
function startOfDay(d: Date) {
|
||
return new Date(d.getFullYear(), d.getMonth(), d.getDate())
|
||
}
|
||
|
||
function parseFlexibleDate(value: string): Date | null {
|
||
const s = String(value || '').trim()
|
||
if (!s || s === '—') return null
|
||
const m = s.match(/^(\d{4})-(\d{2})-(\d{2})/)
|
||
if (m) {
|
||
return new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]))
|
||
}
|
||
const d = new Date(s.includes(' ') ? s.replace(' ', 'T') : s)
|
||
return Number.isNaN(d.getTime()) ? null : d
|
||
}
|
||
|
||
/** 日期在今日起未来 3 个自然日内(含今日、第 3 日) */
|
||
function isWithinNext3Days(value: string): boolean {
|
||
const parsed = parseFlexibleDate(value)
|
||
if (!parsed) return false
|
||
const today = startOfDay(new Date())
|
||
const target = startOfDay(parsed)
|
||
const diffDays = Math.floor((target.getTime() - today.getTime()) / 86400000)
|
||
return diffDays >= 0 && diffDays <= 3
|
||
}
|
||
|
||
function isUrgentCard(row: PreTransitProtocolRow) {
|
||
return (
|
||
isWithinNext3Days(String(row.etaTimeSummary || '')) ||
|
||
isWithinNext3Days(String(row.expectedDeliveryDate || ''))
|
||
)
|
||
}
|
||
|
||
function getGroupExpandedItem(group: CardRowGroup): GroupItem | null {
|
||
if (!expandedKey.value) return null
|
||
return group.items.find((item) => rowKey(item.row) === expandedKey.value) || null
|
||
}
|
||
|
||
function statusLabel(row: PreTransitProtocolRow) {
|
||
const status = String(row.protocolStatus || '')
|
||
return row.sourceType === 'research_donation'
|
||
? donationStatusLabel(status)
|
||
: protocolStatusLabel(status)
|
||
}
|
||
|
||
function statusTagType(row: PreTransitProtocolRow): TagType {
|
||
const status = String(row.protocolStatus || '')
|
||
return row.sourceType === 'research_donation'
|
||
? donationStatusTagType(status)
|
||
: protocolStatusTagType(status)
|
||
}
|
||
|
||
function sourceTypeTagType(row: PreTransitProtocolRow): TagType {
|
||
return row.sourceType === 'research_donation' ? 'warning' : 'success'
|
||
}
|
||
|
||
function formatTransportSummary(transport?: ProtocolSampleTransport | null): string {
|
||
if (!transport?.transportType) return '—'
|
||
const parts: string[] = [transportTypeLabel(String(transport.transportType))]
|
||
const dest = String(transport.destSiteName || '').trim()
|
||
if (dest) parts.push(dest)
|
||
if (transport.transportType === 'kdys') {
|
||
const expressName = String(transport.expressCompanyName || '').trim()
|
||
if (expressName) parts.push(expressName)
|
||
const waybill = String(transport.waybillNo || '').trim()
|
||
if (waybill) parts.push(waybill)
|
||
} else if (transport.transportType === 'ryxd') {
|
||
const carrier = String(transport.carrierName || '').trim()
|
||
if (carrier) parts.push(carrier)
|
||
const phone = String(transport.carrierPhone || '').trim()
|
||
if (phone) parts.push(phone)
|
||
}
|
||
const eta = String(transport.etaTime || '').trim()
|
||
if (eta) parts.push(`预计 ${eta}`)
|
||
return parts.join(' · ')
|
||
}
|
||
|
||
function getSampleItems(row: PreTransitProtocolRow): ProtocolSampleItem[] {
|
||
const rawItems = row.sampleItems
|
||
if (Array.isArray(rawItems) && rawItems.length) {
|
||
return rawItems.map((item) => {
|
||
const rec = item as Record<string, unknown>
|
||
const transportRaw = rec.transport
|
||
const transport =
|
||
transportRaw && typeof transportRaw === 'object'
|
||
? (transportRaw as ProtocolSampleTransport)
|
||
: null
|
||
return {
|
||
sampleTypeName: String(rec.sampleTypeName || '').trim(),
|
||
sampleCode: String(rec.sampleCode || '').trim(),
|
||
sampleStatus: String(rec.sampleStatus || '').trim(),
|
||
labStorageCode: String(rec.labStorageCode || '').trim(),
|
||
transport
|
||
}
|
||
})
|
||
}
|
||
return []
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.protocol-card-section {
|
||
min-height: 120px;
|
||
}
|
||
|
||
.protocol-card-list {
|
||
--compact-card-width: 172px;
|
||
--compact-card-height: 228px;
|
||
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
padding: 14px 16px;
|
||
}
|
||
|
||
.protocol-card-row-group {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
}
|
||
|
||
.protocol-card-row {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: flex-start;
|
||
gap: 10px;
|
||
}
|
||
|
||
.protocol-card {
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: stretch;
|
||
gap: 12px;
|
||
min-width: 0;
|
||
box-sizing: border-box;
|
||
border: 1px solid var(--mint-border, #e2e8f0);
|
||
border-radius: 10px;
|
||
background: #fff;
|
||
transition:
|
||
border-color 0.15s,
|
||
box-shadow 0.15s;
|
||
|
||
&:hover {
|
||
border-color: #c5e0d4;
|
||
box-shadow: 0 2px 8px rgb(15 23 42 / 5%);
|
||
}
|
||
|
||
&.is-compact {
|
||
flex: 0 0 auto;
|
||
flex-direction: column;
|
||
width: var(--compact-card-width);
|
||
height: var(--compact-card-height);
|
||
padding: 10px;
|
||
align-items: stretch;
|
||
border-radius: 8px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
&.is-active {
|
||
border-color: var(--primary, #10b981);
|
||
box-shadow: 0 0 0 1px rgb(16 185 129 / 20%);
|
||
}
|
||
|
||
&.is-compact.is-urgent {
|
||
background: #fef2f2;
|
||
border-color: #fecaca;
|
||
|
||
&:hover {
|
||
border-color: #fca5a5;
|
||
box-shadow: 0 2px 8px rgb(239 68 68 / 8%);
|
||
}
|
||
|
||
&.is-active {
|
||
background: #fef2f2;
|
||
border-color: var(--primary, #10b981);
|
||
box-shadow: 0 0 0 1px rgb(16 185 129 / 20%);
|
||
}
|
||
}
|
||
|
||
&--detail {
|
||
width: 100%;
|
||
padding: 12px 14px;
|
||
}
|
||
}
|
||
|
||
.protocol-card-detail {
|
||
width: 100%;
|
||
}
|
||
|
||
.protocol-card-compact {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
min-height: 0;
|
||
gap: 5px;
|
||
}
|
||
|
||
.protocol-card-compact__head {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 5px;
|
||
min-width: 0;
|
||
}
|
||
|
||
.protocol-card-compact__tags {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 2px;
|
||
|
||
:deep(.el-tag) {
|
||
padding: 0 5px;
|
||
height: 22px;
|
||
font-size: 11px;
|
||
}
|
||
}
|
||
|
||
.protocol-card-compact__body {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4px;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.protocol-card-compact__field {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
gap: 1px;
|
||
min-width: 0;
|
||
font-size: 11px;
|
||
line-height: 1.35;
|
||
|
||
label {
|
||
flex-shrink: 0;
|
||
color: var(--mint-text-muted, #64748b);
|
||
font-size: 10px;
|
||
}
|
||
|
||
span {
|
||
width: 100%;
|
||
min-width: 0;
|
||
color: var(--text, #1e293b);
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
span.protocol-card__kv-value--danger {
|
||
color: #dc2626;
|
||
font-weight: 500;
|
||
}
|
||
}
|
||
|
||
.protocol-card-compact__sample {
|
||
display: -webkit-box;
|
||
-webkit-box-orient: vertical;
|
||
-webkit-line-clamp: 2;
|
||
line-clamp: 2;
|
||
overflow: hidden;
|
||
white-space: normal !important;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.protocol-card-compact__foot {
|
||
display: flex;
|
||
justify-content: center;
|
||
margin-top: auto;
|
||
padding-top: 2px;
|
||
}
|
||
|
||
.protocol-card-compact__toggle {
|
||
min-width: 30px;
|
||
height: 26px;
|
||
padding: 0 7px;
|
||
}
|
||
|
||
.protocol-card__kv-value--danger {
|
||
color: #dc2626;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.protocol-card__aside {
|
||
flex: 0 0 120px;
|
||
min-width: 108px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
padding-right: 12px;
|
||
border-right: 1px solid #eef2f6;
|
||
}
|
||
|
||
.protocol-card__source,
|
||
.protocol-card__status {
|
||
align-self: flex-start;
|
||
}
|
||
|
||
.protocol-card__create-time {
|
||
margin-top: auto;
|
||
font-size: 11px;
|
||
color: var(--mint-text-muted, #64748b);
|
||
line-height: 1.35;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.protocol-card__name-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
min-width: 0;
|
||
}
|
||
|
||
.protocol-card__index {
|
||
flex-shrink: 0;
|
||
min-width: 21px;
|
||
height: 21px;
|
||
padding: 0 5px;
|
||
border-radius: 5px;
|
||
background: var(--primary-bg, #ecfdf5);
|
||
color: var(--primary-dark, #059669);
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
line-height: 21px;
|
||
text-align: center;
|
||
}
|
||
|
||
.protocol-card__name {
|
||
flex: 1;
|
||
min-width: 0;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
color: var(--text, #1e293b);
|
||
line-height: 1.4;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.protocol-card__sections {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: stretch;
|
||
gap: 10px;
|
||
min-width: 0;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
.protocol-card__block {
|
||
flex: 1;
|
||
min-width: 0;
|
||
padding: 8px 10px;
|
||
border-radius: 8px;
|
||
background: #f8fafc;
|
||
border: 1px solid #eef2f6;
|
||
|
||
&--basic {
|
||
flex: 0.9;
|
||
min-width: 150px;
|
||
}
|
||
|
||
&--newborn {
|
||
flex: 0.85;
|
||
min-width: 140px;
|
||
}
|
||
|
||
&--samples {
|
||
flex: 1.35;
|
||
min-width: 220px;
|
||
}
|
||
}
|
||
|
||
.protocol-card__block-title {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
margin-bottom: 6px;
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
color: var(--primary-dark, #059669);
|
||
line-height: 1.3;
|
||
}
|
||
|
||
.protocol-card__block-count {
|
||
font-size: 11px;
|
||
font-weight: 500;
|
||
color: var(--mint-text-muted, #64748b);
|
||
}
|
||
|
||
.protocol-card__kv-grid {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4px;
|
||
}
|
||
|
||
.protocol-card__kv {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 6px;
|
||
min-width: 0;
|
||
font-size: 12px;
|
||
line-height: 1.35;
|
||
|
||
label {
|
||
flex-shrink: 0;
|
||
color: var(--mint-text-muted, #334155);
|
||
}
|
||
|
||
span {
|
||
min-width: 0;
|
||
color: var(--text, #1e293b);
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
}
|
||
|
||
.protocol-card__kv span.protocol-card__kv-value--danger {
|
||
color: #dc2626;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.protocol-card__empty {
|
||
font-size: 12px;
|
||
color: var(--mint-text-muted, #334155);
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.protocol-card__sample-list {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
}
|
||
|
||
.protocol-card__sample-item {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 8px;
|
||
padding: 6px 8px;
|
||
border-radius: 6px;
|
||
background: #fff;
|
||
border: 1px solid var(--mint-border, #e2e8f0);
|
||
}
|
||
|
||
.protocol-card__sample-seq {
|
||
flex-shrink: 0;
|
||
width: 18px;
|
||
height: 18px;
|
||
border-radius: 4px;
|
||
background: var(--primary-bg, #ecfdf5);
|
||
color: var(--primary-dark, #059669);
|
||
font-size: 10px;
|
||
font-weight: 600;
|
||
line-height: 18px;
|
||
text-align: center;
|
||
}
|
||
|
||
.protocol-card__sample-main {
|
||
min-width: 0;
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 2px;
|
||
}
|
||
|
||
.protocol-card__sample-line {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 6px;
|
||
min-width: 0;
|
||
font-size: 12px;
|
||
line-height: 1.35;
|
||
}
|
||
|
||
.protocol-card__sample-label {
|
||
flex-shrink: 0;
|
||
width: 28px;
|
||
color: var(--mint-text-muted, #334155);
|
||
}
|
||
|
||
.protocol-card__sample-value {
|
||
min-width: 0;
|
||
flex: 1;
|
||
color: var(--text, #1e293b);
|
||
word-break: break-all;
|
||
|
||
&--code {
|
||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||
font-size: 11px;
|
||
}
|
||
}
|
||
|
||
.protocol-card__sample-status {
|
||
flex-shrink: 0;
|
||
margin-left: auto;
|
||
}
|
||
|
||
.protocol-card__foot {
|
||
flex: 0 0 auto;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
padding-left: 12px;
|
||
border-left: 1px solid #eef2f6;
|
||
}
|
||
|
||
.protocol-card__actions {
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex-shrink: 0;
|
||
align-items: stretch;
|
||
gap: 6px;
|
||
min-width: 72px;
|
||
|
||
:deep(.el-button) {
|
||
width: 100%;
|
||
margin: 0;
|
||
justify-content: center;
|
||
}
|
||
}
|
||
|
||
.protocol-card-empty {
|
||
padding: 32px 16px;
|
||
}
|
||
|
||
@media (max-width: 1200px) {
|
||
.protocol-card-list {
|
||
--compact-card-width: 152px;
|
||
--compact-card-height: 201px;
|
||
}
|
||
|
||
.protocol-card--detail {
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.protocol-card--detail .protocol-card__sections {
|
||
flex-basis: 100%;
|
||
order: 3;
|
||
}
|
||
|
||
.protocol-card--detail .protocol-card__foot {
|
||
flex-direction: column;
|
||
align-items: stretch;
|
||
border-left: none;
|
||
border-top: 1px solid #eef2f6;
|
||
padding-left: 0;
|
||
padding-top: 10px;
|
||
margin-left: 0;
|
||
order: 4;
|
||
width: 100%;
|
||
}
|
||
}
|
||
|
||
@media (max-width: 768px) {
|
||
.protocol-card-list {
|
||
--compact-card-width: 136px;
|
||
--compact-card-height: 180px;
|
||
}
|
||
|
||
.protocol-card-row {
|
||
gap: 8px;
|
||
}
|
||
|
||
.protocol-card--detail .protocol-card__sections {
|
||
flex-direction: column;
|
||
}
|
||
|
||
.protocol-card--detail .protocol-card__block {
|
||
min-width: 0 !important;
|
||
}
|
||
}
|
||
</style>
|