From bfdfb5761a81c343335f44403d78c071b8d1053c Mon Sep 17 00:00:00 2001 From: lingniu Date: Sat, 4 Jul 2026 00:02:33 +0800 Subject: [PATCH] feat(platform): link quality issues to vehicle lookup --- .../apps/web/src/pages/Dashboard.tsx | 17 ++++++++++++++++- .../apps/web/src/pages/Quality.tsx | 17 +++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index e4aa3e40..153a35f9 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -15,6 +15,14 @@ function formatLag(value?: number | null) { return value == null ? '未接入' : value.toLocaleString(); } +function qualityVehicleLookupKey(row: QualityIssueRow) { + const vin = row.vin?.trim(); + if (vin && vin !== 'unknown') { + return vin; + } + return row.plate?.trim() || row.phone?.trim() || ''; +} + export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vin: string) => void; onOpenQuality: () => void }) { const [summary, setSummary] = useState(null); const [coverage, setCoverage] = useState([]); @@ -127,7 +135,14 @@ export function Dashboard({ onOpenVehicle, onOpenQuality }: { onOpenVehicle: (vi { title: '来源', dataIndex: 'protocol', width: 110 }, { title: '问题', dataIndex: 'issueType', width: 140 }, { title: '级别', width: 90, render: (_: unknown, row: QualityIssueRow) => {row.severity} }, - { title: '最后时间', dataIndex: 'lastSeen', width: 170 } + { title: '最后时间', dataIndex: 'lastSeen', width: 170 }, + { + title: '操作', + width: 110, + render: (_: unknown, row: QualityIssueRow) => ( + + ) + } ]} /> diff --git a/vehicle-data-platform/apps/web/src/pages/Quality.tsx b/vehicle-data-platform/apps/web/src/pages/Quality.tsx index 31540892..40f5deed 100644 --- a/vehicle-data-platform/apps/web/src/pages/Quality.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Quality.tsx @@ -49,9 +49,12 @@ async function copyText(value: string, label: string) { } } -function canOpenVehicle(vin?: string) { - const value = vin?.trim(); - return Boolean(value && value !== 'unknown'); +function vehicleLookupKey(row: QualityIssueRow) { + const vin = row.vin?.trim(); + if (vin && vin !== 'unknown') { + return vin; + } + return row.plate?.trim() || row.phone?.trim() || ''; } export function Quality({ @@ -186,7 +189,13 @@ export function Quality({ - + ) }