feat(platform): add vehicle capability matrix

This commit is contained in:
lingniu
2026-07-04 14:23:50 +08:00
parent d6c2edce7e
commit c03e890096
4 changed files with 210 additions and 2 deletions

View File

@@ -112,12 +112,16 @@ export function Dashboard({
onOpenVehicle,
onOpenQuality,
onOpenRealtime,
onOpenVehicles
onOpenVehicles,
onOpenHistory,
onOpenMileage
}: {
onOpenVehicle: (vin: string, protocol?: string) => void;
onOpenQuality: (filters?: Record<string, string>) => void;
onOpenRealtime: (filters?: Record<string, string>) => void;
onOpenVehicles: (filters?: Record<string, string>) => void;
onOpenHistory: (filters?: Record<string, string>) => void;
onOpenMileage: (filters?: Record<string, string>) => void;
}) {
const [summary, setSummary] = useState<DashboardSummary | null>(null);
const [serviceSummary, setServiceSummary] = useState<VehicleServiceSummary | null>(null);
@@ -239,6 +243,38 @@ export function Dashboard({
online: row.online,
title: `${row.plate || row.vin || '-'} ${row.primaryProtocol || ''} ${row.lastSeen || ''}`
}));
const capabilities = [
{
title: '实时监控',
description: '按车辆聚合最新位置、在线状态和多来源实时字段,支持地图态势查看。',
action: '查看在线车辆',
onClick: () => onOpenRealtime({ online: 'online' })
},
{
title: '轨迹回放',
description: '围绕车辆回放历史位置轨迹,结合高德线路和 RAW 证据定位异常。',
action: '打开轨迹',
onClick: () => onOpenHistory()
},
{
title: '历史数据查询',
description: '查询位置历史、RAW 帧和解析字段,为车辆问题复盘提供证据链。',
action: '查询历史',
onClick: () => onOpenHistory()
},
{
title: '告警事件触发与通知',
description: '围绕断链、无来源、VIN 缺失、字段缺失形成告警和通知闭环。',
action: '查看告警',
onClick: () => onOpenQuality()
},
{
title: '统计查询',
description: '提供里程等运营统计查询,保证区间总值与每日统计口径闭合。',
action: '查看统计',
onClick: () => onOpenMileage()
}
];
return (
<div className="vp-page">
@@ -267,6 +303,21 @@ export function Dashboard({
<Tag color={(summary?.kafkaLag ?? 0) > 0 ? 'orange' : 'green'}>Kafka Lag {formatLag(summary?.kafkaLag)}</Tag>
</Space>
</Card>
<Card bordered title="车辆业务能力矩阵" style={{ marginBottom: 16 }}>
<div className="vp-capability-grid">
{capabilities.map((item) => (
<div key={item.title} className="vp-capability-item">
<div>
<Typography.Title heading={6} style={{ margin: 0 }}>{item.title}</Typography.Title>
<Typography.Text type="secondary">{item.description}</Typography.Text>
</div>
<Button size="small" theme="light" type="primary" aria-label={`能力入口 ${item.title}`} onClick={item.onClick}>
{item.action}
</Button>
</div>
))}
</div>
</Card>
<Card
bordered
title="车辆态势指挥台"