feat(platform): add live map dispatch desk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user