feat(platform): add map dispatch actions
This commit is contained in:
@@ -1164,6 +1164,46 @@ export function Realtime({
|
||||
onClick: () => mapAttentionRows.length > 0 && onOpenQuality ? onOpenQuality({ serviceStatus: 'degraded' }) : copyMapCustomerPackage()
|
||||
}
|
||||
];
|
||||
const mapDispatchActionItems = [
|
||||
{
|
||||
title: '关注车辆',
|
||||
value: `${mapAttentionRows.length.toLocaleString()} 辆`,
|
||||
detail: mapAttentionRows[0]
|
||||
? `${mapAttentionRows[0].plate || mapAttentionRows[0].vin}:${realtimeIssueLabels(mapAttentionRows[0]).join(';')}`
|
||||
: '当前地图范围没有需要立即处置的车辆。',
|
||||
color: mapAttentionRows.length > 0 ? 'orange' as const : 'green' as const,
|
||||
action: '告警事件',
|
||||
disabled: mapAttentionRows.length === 0 || !onOpenQuality,
|
||||
onClick: () => onOpenQuality?.({ serviceStatus: 'degraded' })
|
||||
},
|
||||
{
|
||||
title: '复盘选中',
|
||||
value: selectedVehicleLabel,
|
||||
detail: selectedMapRow ? `${dataFreshness(selectedMapRow).detail},回放轨迹和里程变化。` : '先从地图或列表选择车辆。',
|
||||
color: selectedMapRow ? dataFreshness(selectedMapRow).color : 'grey' as const,
|
||||
action: '轨迹回放',
|
||||
disabled: !selectedMapRow || !canOpenVehicle(selectedMapRow.vin),
|
||||
onClick: () => selectedMapRow && onOpenHistory?.(selectedMapRow.vin, selectedVehicleProtocol)
|
||||
},
|
||||
{
|
||||
title: '车辆档案',
|
||||
value: selectedVehicleLabel,
|
||||
detail: selectedMapRow ? `${vehicleServiceStatus(selectedMapRow).label},查看车辆画像和来源证据。` : '选择车辆后进入单车服务。',
|
||||
color: selectedMapRow ? vehicleServiceStatus(selectedMapRow).color : 'grey' as const,
|
||||
action: '车辆服务',
|
||||
disabled: !selectedMapRow || !canOpenVehicle(selectedMapRow.vin),
|
||||
onClick: () => selectedMapRow && onOpenVehicle(selectedMapRow.vin, selectedVehicleProtocol)
|
||||
},
|
||||
{
|
||||
title: '交接证据',
|
||||
value: `${rows.length.toLocaleString()} 辆`,
|
||||
detail: '导出当前地图车辆清单,交接给客户或运营人员继续处理。',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
action: '导出CSV',
|
||||
disabled: rows.length === 0,
|
||||
onClick: exportRealtime
|
||||
}
|
||||
];
|
||||
const mapCustomerDecisionItems = [
|
||||
{
|
||||
label: '先看在线',
|
||||
@@ -1623,6 +1663,34 @@ export function Realtime({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="vp-map-dispatch-actions">
|
||||
<div className="vp-map-dispatch-actions-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">地图调度处置栏</Tag>
|
||||
<Tag color={mapAttentionRows.length > 0 ? 'orange' : 'green'}>{mapAttentionRows.length.toLocaleString()} 辆关注</Tag>
|
||||
<Tag color={selectedMapRow ? 'green' : 'grey'}>{selectedMapRow ? '已选车辆' : '待选车辆'}</Tag>
|
||||
</Space>
|
||||
<Typography.Text strong>把地图上的车辆直接转成调度动作:先处理关注车辆,再复盘选中车辆,最后导出交接证据。</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-map-dispatch-actions-grid">
|
||||
{mapDispatchActionItems.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-map-dispatch-action"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`地图调度处置栏 ${item.title} ${item.value} ${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-map-kpi-strip">
|
||||
{mapFleetKpis.map((item) => (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user