From 4e829da0488f702138c4612acc6d9f3f2b939643 Mon Sep 17 00:00:00 2001 From: lingniu Date: Sun, 5 Jul 2026 16:53:21 +0800 Subject: [PATCH] feat(platform): add live map dispatch desk --- .../apps/web/src/pages/Realtime.tsx | 70 +++++++++++++++++ .../apps/web/src/styles/global.css | 75 +++++++++++++++++++ .../apps/web/src/test/App.test.tsx | 7 ++ .../docs/fleet-platform-product-research.md | 2 + 4 files changed, 154 insertions(+) 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({ ))} +
+
+ + 实时地图调度台 + {amapConfigured ? '高德地图可用' : '坐标预览'} + 0 ? 'orange' : 'green'}>{mapAttentionRows.length.toLocaleString()} 辆关注 + + 像现代车队 Live Map 一样,把地图作为调度指挥台:先看在线位置,再处理轨迹、告警和导出。 + + 协议来源只作为车辆位置可信度证据,客户主路径是找车、调度、复盘和通知。 + +
+
+ {realtimeMapDispatchItems.map((item) => ( + + ))} +
+
{realtimeCustomerJourneyItems.map((item) => (