diff --git a/vehicle-data-platform/apps/web/src/pages/Realtime.tsx b/vehicle-data-platform/apps/web/src/pages/Realtime.tsx index 2d749db4..e24013e5 100644 --- a/vehicle-data-platform/apps/web/src/pages/Realtime.tsx +++ b/vehicle-data-platform/apps/web/src/pages/Realtime.tsx @@ -1287,6 +1287,46 @@ export function Realtime({ onClick: exportRealtime } ]; + const realtimeMapDispatchItems = [ + { + title: '查看在线车辆', + value: `${onlineCount.toLocaleString()} 在线`, + detail: `定位有效 ${locatedCount.toLocaleString()} 辆,先确认客户当前能看到哪些车。`, + action: '实时地图', + color: onlineCount > 0 ? 'green' as const : 'orange' as const, + disabled: false, + onClick: () => { + window.location.hash = buildAppHash({ page: 'map', protocol: filters.protocol, filters: { ...filters, online: 'online' } }); + } + }, + { + title: '复盘选中车辆', + value: selectedMapRow?.plate || selectedMapRow?.vin || '先选车', + detail: selectedMapRow ? `${vehicleServiceStatus(selectedMapRow).label},${dataFreshness(selectedMapRow).detail}` : '从地图或实时列表选择车辆后,回放轨迹和里程变化。', + action: '轨迹回放', + color: selectedMapRow ? vehicleServiceStatus(selectedMapRow).color : 'grey' as const, + disabled: !selectedMapRow || !canOpenVehicle(selectedMapRow.vin), + onClick: () => selectedMapRow && onOpenHistory?.(selectedMapRow.vin, selectedVehicleProtocol) + }, + { + title: '处理异常车辆', + value: `${mapAttentionRows.length.toLocaleString()} 关注`, + detail: mapAttentionRows[0] ? `${mapAttentionRows[0].plate || mapAttentionRows[0].vin}:${realtimeIssueLabels(mapAttentionRows[0]).join(';')}` : '当前筛选下暂无离线、超时或坐标异常车辆。', + action: '告警事件', + color: mapAttentionRows.length > 0 ? 'orange' as const : 'green' as const, + disabled: !onOpenQuality, + onClick: () => onOpenQuality?.({ serviceStatus: 'degraded', protocol: filters.protocol }) + }, + { + title: '导出当前态势', + value: `${rows.length.toLocaleString()} 辆当前页`, + detail: '导出在线、位置、速度、SOC、里程和数据通道证据,用于客户交接。', + action: '导出CSV', + color: rows.length > 0 ? 'blue' as const : 'grey' as const, + disabled: rows.length === 0, + onClick: exportRealtime + } + ]; const realtimeCustomerQuestions = [ { question: '这辆车现在在哪里?', @@ -1831,6 +1871,36 @@ export function Realtime({ ))} +