From d4fdd7527b1b1941821eee1561f8c7d177851b22 Mon Sep 17 00:00:00 2001 From: lingniu Date: Fri, 3 Jul 2026 23:51:40 +0800 Subject: [PATCH] feat(platform): summarize vehicle source coverage --- .../apps/web/src/pages/VehicleDetail.tsx | 40 +++++++++++++++++-- .../apps/web/src/styles/global.css | 22 ++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/vehicle-data-platform/apps/web/src/pages/VehicleDetail.tsx b/vehicle-data-platform/apps/web/src/pages/VehicleDetail.tsx index 296aa5ca..03cd41fe 100644 --- a/vehicle-data-platform/apps/web/src/pages/VehicleDetail.tsx +++ b/vehicle-data-platform/apps/web/src/pages/VehicleDetail.tsx @@ -11,6 +11,13 @@ type VehicleQuery = { protocol?: string; }; +const sourceCapabilities: Array<{ key: keyof Pick; label: string }> = [ + { key: 'hasRealtime', label: '实时' }, + { key: 'hasHistory', label: '历史' }, + { key: 'hasRaw', label: 'RAW' }, + { key: 'hasMileage', label: '里程' } +]; + export function VehicleDetail({ vin, onOpenHistory, @@ -66,7 +73,7 @@ export function VehicleDetail({ load(nextQuery); }}> - + GB32960 JT808 YUTONG_MQTT @@ -91,7 +98,7 @@ export function VehicleDetail({ { key: 'OEM', value: summary?.oem || identity?.oem || '-' }, { key: '在线', value: }, { - key: '来源协议', + key: '数据来源', value: protocols.length > 0 ? {protocols.map((item) => {item})} : '-' }, { key: '在线来源', value: summary ? `${summary.onlineSourceCount}/${summary.sourceCount}` : '-' }, @@ -103,7 +110,34 @@ export function VehicleDetail({ - + + {detail?.sourceStatus?.length ? ( +
+ {detail.sourceStatus.map((source) => ( +
+
+ + {source.protocol} + + + {source.lastSeen || '无上报'} +
+ + {sourceCapabilities.map((item) => ( + + {item.label}{source[item.key] ? '有' : '无'} + + ))} + +
+ ))} +
+ ) : ( + 暂未查询到该车辆的数据来源覆盖。 + )} +
+ +