diff --git a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx index bc214fb8..a8d85c9d 100644 --- a/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Dashboard.tsx @@ -235,6 +235,7 @@ export function Dashboard({ const commandLocatedCount = locations.filter(hasValidCoordinate).length; const commandDegradedCount = locations.filter((row) => row.onlineSourceCount <= 0 || row.onlineSourceCount < row.sourceCount).length; const highPriorityIssue = qualityIssues.find((item) => item.severity === 'error') ?? qualityIssues[0]; + const unhealthyLinkCount = (summary?.linkHealth ?? []).filter((item) => item.status !== 'ok').length; const commandMapPoints: VehicleMapPoint[] = locations.map((row, index) => ({ id: row.vin || `${row.primaryProtocol || 'source'}-${index}`, label: row.plate || row.vin || 'unknown', @@ -285,6 +286,56 @@ export function Dashboard({ onClick: () => onOpenMileage() } ]; + const workflowSteps = [ + { + title: '接入巡检', + value: unhealthyLinkCount > 0 ? `${unhealthyLinkCount.toLocaleString()} 项关注` : '链路正常', + color: unhealthyLinkCount > 0 ? 'orange' as const : 'green' as const, + detail: '检查平台转发、Kafka、Redis、MySQL、TDengine 等关键链路。', + action: '查看告警', + onClick: () => onOpenQuality() + }, + { + title: '实时态势', + value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`, + color: 'green' as const, + detail: '确认车辆是否在线、是否有有效坐标以及来源是否完整。', + action: '实时监控', + onClick: () => onOpenRealtime({ online: 'online' }) + }, + { + title: '轨迹复盘', + value: `${formatCount(summary?.activeToday)} 活跃`, + color: 'blue' as const, + detail: '按车辆进入历史轨迹,复盘位置、速度、里程和断点。', + action: '轨迹回放', + onClick: () => onOpenHistory() + }, + { + title: '历史证据', + value: `${formatCount(summary?.frameToday)} 帧`, + color: 'blue' as const, + detail: '查询 RAW 帧和解析字段,形成可追溯的数据证据。', + action: '历史查询', + onClick: () => onOpenHistory({ tab: 'raw' }) + }, + { + title: '告警通知', + value: `${formatCount(summary?.issueVehicles)} 车辆`, + color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const, + detail: '把断链、缺 VIN、字段缺失等问题进入通知和处置队列。', + action: '告警通知', + onClick: () => onOpenQuality() + }, + { + title: '统计复核', + value: `${formatCount(serviceSummary?.totalVehicles)} 车辆`, + color: 'green' as const, + detail: '核对里程统计口径,保证区间统计和每日统计闭合。', + action: '统计查询', + onClick: () => onOpenMileage() + } + ]; return (