feat(platform): add history export acceptance checklist

This commit is contained in:
lingniu
2026-07-06 03:58:35 +08:00
parent 6f97181ec5
commit 4ce466895a
3 changed files with 222 additions and 0 deletions

View File

@@ -1131,6 +1131,77 @@ export function History({
}
];
const fieldEvidenceCount = rawFieldRows.length > 0 ? rawFieldRows.length : selectedFieldCount;
const exportAcceptanceItems = [
{
label: '范围锁定',
value: deliveryScopeText,
detail: `${filters.dateFrom || '-'}${filters.dateTo || '-'},用于限定客户交付边界。`,
color: currentVehicleKeyword ? 'green' as const : 'orange' as const,
onClick: () => openQueryTab(activeTab)
},
{
label: '轨迹证据',
value: validLocations.length > 0 ? `${validLocations.length.toLocaleString()}` : '0 点',
detail: validLocations.length > 0 ? '轨迹点可用于回放和位置 CSV。' : '缺少轨迹点时先补查位置历史。',
color: validLocations.length > 0 ? 'green' as const : 'orange' as const,
onClick: () => openQueryTab('location')
},
{
label: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '保留原始接入明细,解释位置、里程和字段来源。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
onClick: () => openQueryTab('raw')
},
{
label: '字段裁剪',
value: fieldEvidenceCount > 0 ? `${fieldEvidenceCount.toLocaleString()} 字段` : '待配置',
detail: fieldEvidenceCount > 0 ? '字段证据已裁剪,可减少客户导出体积。' : '选择客户需要字段后再交付。',
color: fieldEvidenceCount > 0 ? 'green' as const : 'orange' as const,
onClick: () => openQueryTab('fields')
},
{
label: '异常说明',
value: anomalyTotal > 0 ? `${anomalyTotal.toLocaleString()}` : deliveryState,
detail: anomalyTotal > 0 ? '复制交付说明时带上复核提示。' : '可直接生成客户可读交付说明。',
color: anomalyTotal > 0 ? 'orange' as const : deliveryStateColor,
onClick: () => copyDeliveryPackage()
}
];
const exportAcceptanceActions = [
{
label: '复制验收',
action: '交付说明',
detail: '把范围、证据和异常说明复制给客户或内部复核。',
color: deliveryStateColor,
disabled: false,
onClick: () => copyDeliveryPackage()
},
{
label: '导出位置',
action: '位置CSV',
detail: '导出当前页位置点,作为轨迹回放明细。',
color: locations.items.length > 0 ? 'green' as const : 'grey' as const,
disabled: locations.items.length === 0,
onClick: () => exportLocations()
},
{
label: '导出字段',
action: '字段CSV',
detail: '导出客户指定字段,减少无关原始数据暴露。',
color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
disabled: rawFieldRows.length === 0,
onClick: () => exportRawFields()
},
{
label: '查看明细',
action: '明细证据',
detail: '回到原始明细,确认字段和报文来源。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
disabled: false,
onClick: () => openQueryTab('raw')
}
];
const customerExportCenterItems = [
{
title: '行程历史',
@@ -2350,6 +2421,51 @@ export function History({
</div>
</section>
) : null}
{mode === 'query' ? (
<section className="vp-history-export-acceptance" aria-label="客户导出验收清单">
<div className="vp-history-export-acceptance-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={currentVehicleKeyword ? 'green' : 'orange'}>{currentVehicleKeyword || '全部车辆'}</Tag>
</Space>
<Typography.Text strong>
</Typography.Text>
</div>
<div className="vp-history-export-acceptance-grid">
{exportAcceptanceItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-history-export-acceptance-item"
onClick={item.onClick}
aria-label={`客户导出验收 ${item.label} ${item.value}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
</button>
))}
</div>
<div className="vp-history-export-acceptance-actions">
{exportAcceptanceActions.map((item) => (
<button
key={item.label}
type="button"
className="vp-history-export-acceptance-action"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`导出验收动作 ${item.label} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.action}</strong>
<span>{item.detail}</span>
</button>
))}
</div>
</section>
) : null}
{mode === 'query' ? (
<section className="vp-history-service-desk" aria-label="车辆历史服务台">
<div className="vp-history-service-desk-summary">