feat(platform): add history delivery readiness

This commit is contained in:
lingniu
2026-07-05 23:49:23 +08:00
parent fbd9982427
commit 7a02bf2c87
3 changed files with 147 additions and 0 deletions

View File

@@ -1254,6 +1254,44 @@ export function History({
onClick: () => copyDeliveryPackage()
}
];
const customerDeliveryReadinessItems = [
{
label: currentVehicleKeyword ? '范围已锁定' : '范围待选择',
value: currentVehicleKeyword || '全部车辆',
detail: `${currentProtocol || '全部数据通道'} / ${filters.dateFrom || '-'}${filters.dateTo || '-'}`,
action: '查看范围',
color: currentVehicleKeyword ? 'green' as const : 'orange' as const,
disabled: false,
onClick: () => document.querySelector<HTMLInputElement>('input[name="keyword"]')?.focus()
},
{
label: validLocations.length > 0 ? '轨迹可交付' : '轨迹待补',
value: validLocations.length > 0 ? `${validLocations.length.toLocaleString()}` : '0 点',
detail: validLocations.length > 0 ? '可以进入轨迹回放并导出客户路线。' : '当前时间窗没有轨迹点,先补查位置历史。',
action: '查询轨迹',
color: validLocations.length > 0 ? 'green' as const : 'orange' as const,
disabled: false,
onClick: () => openQueryTab('location')
},
{
label: fieldEvidenceCount > 0 ? '字段已裁剪' : '字段待配置',
value: fieldEvidenceCount > 0 ? `${fieldEvidenceCount.toLocaleString()} 字段` : '待配置',
detail: fieldEvidenceCount > 0 ? '只交付客户需要的字段,减少证据包体积。' : '先选择客户需要的字段,再导出 CSV。',
action: fieldEvidenceCount > 0 ? '字段导出' : '字段配置',
color: fieldEvidenceCount > 0 ? 'green' as const : 'orange' as const,
disabled: false,
onClick: () => openQueryTab('fields')
},
{
label: '说明可复制',
value: deliveryState,
detail: anomalyTotal > 0 ? `附带 ${anomalyTotal.toLocaleString()} 项质量提示。` : '可直接复制客户可读的交付说明。',
action: '复制说明',
color: deliveryStateColor,
disabled: false,
onClick: () => copyDeliveryPackage()
}
];
const customerReportCadenceItems = [
{
title: '每日运营复盘',
@@ -1869,6 +1907,36 @@ export function History({
</div>
</section>
) : null}
{mode === 'query' ? (
<section className="vp-history-delivery-readiness" aria-label="客户交付准备度">
<div className="vp-history-delivery-readiness-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
</Space>
<Typography.Text strong>
</Typography.Text>
</div>
<div className="vp-history-delivery-readiness-grid">
{customerDeliveryReadinessItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-history-delivery-readiness-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`客户交付准备度 ${item.label} ${item.value} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</section>
) : null}
{mode === 'query' ? (
<section className="vp-history-service-desk" aria-label="车辆历史服务台">
<div className="vp-history-service-desk-summary">