feat(ui): 工作台界面全部替换为element plus
This commit is contained in:
1 parent
26d213c05b
commit
d5f988a16c
38 files changed
+4501
-3087
No files matched your search
@@ -1,14 +1,17 @@
|
||||
/**
|
||||
* features/workspace/shipping-task-center/StpProgressFactsPanel.vue
|
||||
* 用途:展示后端 ui_state.summary.stp_facts,含逐行 Reservation/料号/实际库存源/文件证据。
|
||||
* 依赖:ShippingTaskUiState.summary.stp_facts、vue-i18n。
|
||||
* 依赖:ShippingTaskUiState.summary.stp_facts、element-plus、vue-i18n。
|
||||
* 逻辑:由 ShippingTaskWorkbench 在待办栏下方挂载;无 stp_facts 时不渲染;不发明进度。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ElTable, ElTableColumn } from 'element-plus';
|
||||
import type { ShippingStpFacts } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
type StpLine = NonNullable<ShippingStpFacts['line_resolutions']>[number] & { rowKey: string; displayLine: number };
|
||||
|
||||
const props = defineProps<{
|
||||
facts: ShippingStpFacts | null | undefined;
|
||||
}>();
|
||||
@@ -20,7 +23,11 @@ const resolutionEntries = computed(() => {
|
||||
const counts = props.facts?.resolution_counts || {};
|
||||
return Object.entries(counts).map(([disposition, count]) => ({ disposition, count }));
|
||||
});
|
||||
const lineRows = computed(() => props.facts?.line_resolutions || []);
|
||||
const lineRows = computed<StpLine[]>(() => (props.facts?.line_resolutions || []).map((row, index) => ({
|
||||
...row,
|
||||
rowKey: `${row.line_no || row.line_index || 'line'}-${index}`,
|
||||
displayLine: (row.line_index ?? index) + 1,
|
||||
})));
|
||||
|
||||
/**
|
||||
* 行级 disposition 文案;未知码回退原文。
|
||||
@@ -93,34 +100,28 @@ function evidenceText(row: NonNullable<ShippingStpFacts['line_resolutions']>[num
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<div v-if="lineRows.length" class="mt-3 overflow-x-auto">
|
||||
<div class="mb-1 text-xs text-muted">{{ $t('workspace.shippingNotice.stpFacts.lineTableTitle') }}</div>
|
||||
<table class="min-w-full border-collapse text-xs">
|
||||
<thead>
|
||||
<tr class="border-b border-default/70 text-left text-muted">
|
||||
<th class="py-1 pr-2 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colLine') }}</th>
|
||||
<th class="py-1 pr-2 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colReservation') }}</th>
|
||||
<th class="py-1 pr-2 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colPart') }}</th>
|
||||
<th class="py-1 pr-2 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colDisposition') }}</th>
|
||||
<th class="py-1 pr-2 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colSource') }}</th>
|
||||
<th class="py-1 font-medium">{{ $t('workspace.shippingNotice.stpFacts.colEvidence') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(row, index) in lineRows"
|
||||
:key="`${row.line_no || row.line_index}-${index}`"
|
||||
class="border-b border-default/50 align-top"
|
||||
>
|
||||
<td class="py-1.5 pr-2 font-mono">{{ (row.line_index ?? index) + 1 }}</td>
|
||||
<td class="py-1.5 pr-2 font-mono">{{ row.effective_reservation_id || '—' }}</td>
|
||||
<td class="py-1.5 pr-2 font-mono">{{ row.part_number || '—' }}</td>
|
||||
<td class="py-1.5 pr-2">{{ dispositionLabel(String(row.disposition || 'unknown')) }}</td>
|
||||
<td class="py-1.5 pr-2 font-mono">{{ row.resolved_inventory_source_code || '—' }}</td>
|
||||
<td class="py-1.5 font-mono text-muted">{{ evidenceText(row) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div v-if="lineRows.length" class="mt-3">
|
||||
<div>{{ $t('workspace.shippingNotice.stpFacts.lineTableTitle') }}</div>
|
||||
<ElTable :data="lineRows" row-key="rowKey">
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colLine')" min-width="72">
|
||||
<template #default="{ row }">{{ (row as StpLine).displayLine }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colReservation')" min-width="120">
|
||||
<template #default="{ row }">{{ (row as StpLine).effective_reservation_id || '—' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colPart')" min-width="120">
|
||||
<template #default="{ row }">{{ (row as StpLine).part_number || '—' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colDisposition')" min-width="120">
|
||||
<template #default="{ row }">{{ dispositionLabel(String((row as StpLine).disposition || 'unknown')) }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colSource')" min-width="120">
|
||||
<template #default="{ row }">{{ (row as StpLine).resolved_inventory_source_code || '—' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="$t('workspace.shippingNotice.stpFacts.colEvidence')" min-width="180">
|
||||
<template #default="{ row }">{{ evidenceText(row as StpLine) }}</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
Reference in new issue
Block a user