feat(platform): add history delivery conclusion strip

This commit is contained in:
lingniu
2026-07-06 02:56:08 +08:00
parent 22f945e0aa
commit e69d8ecd10
3 changed files with 229 additions and 0 deletions

View File

@@ -1864,6 +1864,66 @@ export function History({
onClick: copyDeliveryPackage
}
];
const customerDeliveryConclusionItems = [
{
label: '交付状态',
value: deliveryState,
detail: deliveryState === '可交付' ? '当前范围可直接生成客户证据包。' : deliveryState === '待查询数据' ? '先查询位置或明细数据后再交付。' : '可交付,但需要附带复核说明。',
color: deliveryStateColor,
onClick: () => copyDeliveryPackage()
},
{
label: '位置历史',
value: `${locations.total.toLocaleString()}`,
detail: `${validLocations.length.toLocaleString()} 个有效坐标,可用于轨迹复盘。`,
color: locations.total > 0 ? 'green' as const : 'grey' 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.toLocaleString()} 字段`,
detail: selectedFieldCount > 0 ? `已按 ${selectedFieldCount.toLocaleString()} 个字段裁剪。` : '按客户需要选择字段后再交付。',
color: fieldEvidenceCount > 0 ? 'green' as const : 'orange' as const,
onClick: () => openQueryTab('fields')
}
];
const customerDeliveryConclusionActions = [
{
label: '导出位置',
action: '位置CSV',
color: locations.items.length > 0 ? 'green' as const : 'grey' as const,
disabled: locations.items.length === 0,
onClick: exportLocations
},
{
label: '导出明细',
action: '明细CSV',
color: rawFrames.items.length > 0 ? 'blue' as const : 'grey' as const,
disabled: rawFrames.items.length === 0,
onClick: exportRawFrames
},
{
label: '字段裁剪',
action: '字段CSV',
color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
disabled: rawFieldRows.length === 0,
onClick: rawFieldRows.length > 0 ? exportRawFields : () => openQueryTab('fields')
},
{
label: '复制说明',
action: '交付包',
color: deliveryStateColor,
disabled: false,
onClick: copyDeliveryPackage
}
];
const tripReviewSummaryItems = [
{
label: '起点',
@@ -1970,6 +2030,53 @@ export function History({
<Tag color={currentProtocol ? 'blue' : 'green'}>{currentProtocol || '全部来源证据'}</Tag>
<Typography.Text type="tertiary">{scopeDescription}</Typography.Text>
</div>
{mode === 'query' ? (
<section className="vp-history-delivery-conclusion-strip" aria-label="客户数据交付结论条">
<div className="vp-history-delivery-conclusion-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={fieldEvidenceCount > 0 ? 'green' : 'orange'}>{fieldEvidenceCount.toLocaleString()} </Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}>
</Typography.Title>
<Typography.Text type="secondary">
{deliveryScopeText}{filters.dateFrom || '-'} {filters.dateTo || '-'}
</Typography.Text>
</div>
<div className="vp-history-delivery-conclusion-metrics">
{customerDeliveryConclusionItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-history-delivery-conclusion-metric"
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-delivery-conclusion-actions">
{customerDeliveryConclusionActions.map((item) => (
<button
key={item.label}
type="button"
className="vp-history-delivery-conclusion-action"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`客户数据交付动作 ${item.label} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<span>{item.action}</span>
</button>
))}
</div>
</section>
) : null}
<section className="vp-history-evidence-chain" aria-label="客户时间窗证据链">
<div className="vp-history-evidence-chain-summary">
<Space wrap>