feat(platform): add live map dispatch desk

This commit is contained in:
lingniu
2026-07-05 16:53:21 +08:00
parent bc1fb71944
commit 4e829da048
4 changed files with 154 additions and 0 deletions

View File

@@ -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({
</button>
))}
</div>
<div className="vp-realtime-map-dispatch">
<div className="vp-realtime-map-dispatch-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
<Tag color={mapAttentionRows.length > 0 ? 'orange' : 'green'}>{mapAttentionRows.length.toLocaleString()} </Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}> Live Map 线</Typography.Title>
<Typography.Text type="secondary">
</Typography.Text>
</div>
<div className="vp-realtime-map-dispatch-grid">
{realtimeMapDispatchItems.map((item) => (
<button
key={item.title}
type="button"
className="vp-realtime-map-dispatch-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`实时地图调度台 ${item.title} ${item.action}`}
>
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</div>
<div className="vp-realtime-customer-steps">
{realtimeCustomerJourneyItems.map((item) => (
<button

View File

@@ -1822,6 +1822,79 @@ body {
line-height: 18px;
}
.vp-realtime-map-dispatch {
padding: 16px;
border-bottom: 1px solid var(--vp-border);
background: #f8fbff;
display: grid;
grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
gap: 14px;
}
.vp-realtime-map-dispatch-copy {
padding: 14px;
border: 1px solid rgba(22, 100, 255, 0.18);
border-radius: var(--vp-radius);
background: #ffffff;
display: grid;
gap: 10px;
align-content: start;
}
.vp-realtime-map-dispatch-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 10px;
}
.vp-realtime-map-dispatch-item {
min-height: 146px;
padding: 12px;
border: 1px solid var(--vp-border);
border-radius: var(--vp-radius);
background: #ffffff;
color: inherit;
text-align: left;
cursor: pointer;
font: inherit;
display: grid;
gap: 8px;
align-content: start;
}
.vp-realtime-map-dispatch-item:hover,
.vp-realtime-map-dispatch-item:focus-visible {
border-color: rgba(22, 100, 255, 0.42);
box-shadow: var(--vp-shadow-sm);
outline: none;
}
.vp-realtime-map-dispatch-item:disabled {
cursor: not-allowed;
opacity: 0.58;
}
.vp-realtime-map-dispatch-item strong {
color: var(--vp-text);
font-size: 16px;
line-height: 22px;
word-break: break-word;
}
.vp-realtime-map-dispatch-item span {
color: var(--vp-text-muted);
font-size: 12px;
line-height: 18px;
}
.vp-realtime-map-dispatch-item em {
color: var(--vp-primary);
font-size: 12px;
font-style: normal;
font-weight: 700;
line-height: 18px;
}
.vp-realtime-customer-steps {
padding: 16px;
display: grid;
@@ -7251,6 +7324,8 @@ button.vp-realtime-command-item:focus-visible {
.vp-realtime-question-board,
.vp-realtime-question-grid,
.vp-realtime-next-actions,
.vp-realtime-map-dispatch,
.vp-realtime-map-dispatch-grid,
.vp-realtime-customer-steps,
.vp-time-window-monitor .semi-card-body,
.vp-time-window-controls,

View File

@@ -9236,6 +9236,13 @@ test('frames realtime page as one vehicle service with source evidence', async (
expect(screen.getAllByText('高德地图待配置').length).toBeGreaterThan(0);
expect(screen.getByText('客户实时监控')).toBeInTheDocument();
expect(screen.getByText('从实时列表直接完成车辆监控闭环')).toBeInTheDocument();
expect(screen.getByText('实时地图调度台')).toBeInTheDocument();
expect(screen.getByText('像现代车队 Live Map 一样,把地图作为调度指挥台:先看在线位置,再处理轨迹、告警和导出。')).toBeInTheDocument();
expect(screen.getByText('协议来源只作为车辆位置可信度证据,客户主路径是找车、调度、复盘和通知。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时地图调度台 查看在线车辆 实时地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时地图调度台 复盘选中车辆 轨迹回放' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时地图调度台 处理异常车辆 告警事件' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时地图调度台 导出当前态势 导出CSV' })).toBeInTheDocument();
expect(screen.getByText('实时客户常问')).toBeInTheDocument();
expect(screen.getByText('把实时数据翻译成客户能直接理解的车辆状态')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时客户常问 这辆车现在在哪里? 地图定位' })).toBeInTheDocument();

View File

@@ -19,6 +19,7 @@
- Verizon Connect 把 live map 与 historic replays 放在同一个 GPS tracking 叙事里Geotab Trips History 支持查看车辆实时位置和历史行程Samsara GPS tracking 也把 Trip history 作为分析车辆行程效率的核心入口。因此历史页要先呈现“车辆 + 时间窗 + 轨迹回放 + 证据导出”的客户复盘路径,而不是先暴露 RAW/字段表。参考https://www.verizonconnect.com/solutions/gps-fleet-tracking-software/、https://support.geotab.com/help/mygeotab/fleet-activity/trips/trips-history、https://www.samsara.com/products/telematics/gps-fleet-tracking
- Samsara、Geotab、Verizon Connect 的公开页面都把客户问题翻译成任务入口:车辆在哪里、这一趟怎么跑、哪些风险要通知、报表如何导出。因此首页右侧需要问题式入口,先回答客户语言,再下钻到地图、轨迹、统计、历史证据和告警。
- Geotab、Fleetistics、FleetRabbit 等资料都把 Trip History、Mileage、Reports、Excel/PDF 导出放在一起:客户不是只看一张里程表,而是需要“统计口径 + 轨迹复核 + 明细导出 + 可发送结论”的报告路径。
- Verizon Connect GPS Fleet Tracking、Samsara GPS Fleet Tracking 和 Motive Fleet View 都把 live map、历史回放、筛选分组、告警和调度决策放在同一条作业链路里。因此实时页需要一个“实时地图调度台”客户先看在线位置再处理异常、轨迹、导出和通知而协议来源只作为位置可信度证据。参考https://www.verizonconnect.com/solutions/gps-fleet-tracking-software/、https://www.samsara.com/products/telematics/gps-fleet-tracking、https://gomotive.com/fleet-view/
## 对标后的产品改造规则
@@ -36,6 +37,7 @@
- 三个接入来源只是数据通道,最终服务对象是车辆。
- 第一屏必须回答客户最关心的问题:有多少车在线、车在哪里、哪些车异常、如何按时间复盘。
- 车辆服务主路径固定为:车辆地图 -> 实时监控 -> 轨迹回放 -> 里程统计 -> 历史查询导出 -> 告警通知。
- 实时监控页必须把地图作为调度指挥台:在线车辆、有效定位、异常优先、选车复盘和当前态势导出要出现在同一个工作区。
- 自定义时间窗要贯穿轨迹、里程、历史查询和告警,避免用户在多个页面重复录入条件。
- 协议、来源覆盖、Kafka、Redis、TDEngine、MySQL 等信息只在内部运维或复核层展示。