feat(platform): add vehicle archive summary
This commit is contained in:
@@ -947,6 +947,53 @@ export function VehicleDetail({
|
||||
onClick: () => onOpenQuality?.(qualityFiltersForCurrentVehicle())
|
||||
}
|
||||
];
|
||||
const vehicleArchiveSummaryItems = [
|
||||
{
|
||||
title: '服务状态',
|
||||
value: online ? '在线可服务' : hasResolvedVIN ? '离线待核' : '待绑定',
|
||||
detail: lastSeen === '-' ? '暂无最后上报' : `最后上报 ${lastSeen}`,
|
||||
action: '查看实时',
|
||||
color: online ? 'green' as const : 'orange' as const,
|
||||
disabled: !hasResolvedVIN,
|
||||
onClick: () => onOpenRealtime(resolvedVIN, activeProtocol)
|
||||
},
|
||||
{
|
||||
title: '轨迹证据',
|
||||
value: `${formatCompactNumber(overview?.historyCount ?? detail?.history?.total ?? 0)} 条`,
|
||||
detail: evidenceLocatedSourceCount > 0 ? `${evidenceLocatedSourceCount} 个定位证据可回放` : '暂无有效定位证据',
|
||||
action: '轨迹回放',
|
||||
color: evidenceLocatedSourceCount > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: !hasResolvedVIN,
|
||||
onClick: () => onOpenHistory(resolvedVIN, activeProtocol)
|
||||
},
|
||||
{
|
||||
title: '历史证据',
|
||||
value: `${formatCompactNumber(overview?.rawCount ?? detail?.raw?.total ?? 0)} 帧`,
|
||||
detail: latestRaw?.frameType ? `最新 ${latestRaw.frameType}` : '历史明细与解析字段',
|
||||
action: '历史查询',
|
||||
color: (overview?.rawCount ?? detail?.raw?.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: !hasResolvedVIN,
|
||||
onClick: () => onOpenRaw(resolvedVIN, activeProtocol)
|
||||
},
|
||||
{
|
||||
title: '告警通知',
|
||||
value: `${qualityCount.toLocaleString()} 项`,
|
||||
detail: priorityQualityIssue ? `${qualityIssueLabel(priorityQualityIssue.issueType)} / ${priorityQualityIssue.lastSeen || '-'}` : '暂无待通知告警',
|
||||
action: '告警闭环',
|
||||
color: qualityCount > 0 ? 'orange' as const : 'green' as const,
|
||||
disabled: !onOpenQuality || (!hasResolvedVIN && qualityCount <= 0),
|
||||
onClick: () => onOpenQuality?.(qualityFiltersForCurrentVehicle())
|
||||
},
|
||||
{
|
||||
title: '统计口径',
|
||||
value: `${formatCompactNumber(overview?.mileageCount ?? detail?.mileage?.total ?? 0)} 条`,
|
||||
detail: `证据里程差 ${formatCompactNumber(evidenceMileageDelta, ' km')}`,
|
||||
action: '统计查询',
|
||||
color: isFiniteNumber(evidenceMileageDelta) && Math.abs(evidenceMileageDelta) > 1 ? 'orange' as const : 'green' as const,
|
||||
disabled: !hasResolvedVIN,
|
||||
onClick: () => onOpenMileage(resolvedVIN, activeProtocol)
|
||||
}
|
||||
];
|
||||
const customerQuestionActions = [
|
||||
{
|
||||
question: '这辆车现在在哪里?',
|
||||
@@ -1188,6 +1235,41 @@ export function VehicleDetail({
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card bordered className="vp-vehicle-archive-summary" title="客户车辆档案摘要">
|
||||
<div className="vp-vehicle-archive-summary-main">
|
||||
<div className="vp-vehicle-archive-summary-copy">
|
||||
<Space wrap>
|
||||
<Tag color={hasResolvedVIN ? 'green' : 'orange'}>{hasResolvedVIN ? '已解析车辆' : '待绑定车辆'}</Tag>
|
||||
<Tag color={activeProtocol ? 'blue' : 'green'}>{scopeText}</Tag>
|
||||
<Tag color={serviceConclusion.color}>{customerStatusTitle(serviceStatus?.title) || serviceConclusion.status}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={4} style={{ margin: 0 }}>
|
||||
{[archivePlate, displayVIN].filter((item) => item && item !== '-').join(' / ') || displayLookupKey}
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
把 VIN、车牌、在线状态、实时位置、轨迹、历史数据、告警和统计放在同一个单车入口,协议来源只作为可追溯证据。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-vehicle-archive-summary-grid">
|
||||
{vehicleArchiveSummaryItems.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-vehicle-archive-summary-item"
|
||||
disabled={item.disabled}
|
||||
aria-label={`车辆档案摘要 ${item.title} ${item.action}`}
|
||||
onClick={item.onClick}
|
||||
>
|
||||
<Tag color={item.color}>{item.title}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<Card bordered title="客户常问" style={{ marginTop: 16 }}>
|
||||
<div className="vp-vehicle-question-grid">
|
||||
{customerQuestionActions.map((item) => (
|
||||
|
||||
Reference in New Issue
Block a user