feat(platform): add map shift console

This commit is contained in:
lingniu
2026-07-05 23:55:27 +08:00
parent 7a02bf2c87
commit 6d18e5a017
3 changed files with 164 additions and 0 deletions

View File

@@ -1217,6 +1217,53 @@ export function Realtime({
onClick: exportRealtime
}
];
const mapShiftTimeWindowLabel = timeWindowDuration === '1 天窗口' ? '24 小时窗口' : timeWindowDuration;
const mapShiftConsoleItems = [
{
label: '今日态势',
value: `${onlineCount.toLocaleString()} 在线 / ${mapAttentionRows.length.toLocaleString()} 关注`,
detail: `当前页 ${rows.length.toLocaleString()} 辆,定位有效率 ${formatPercent(locatedRate)}`,
action: '只看在线',
color: mapAttentionRows.length > 0 ? 'orange' as const : 'green' as const,
disabled: false,
onClick: () => applyFilters({ ...filters, online: 'online' })
},
{
label: '优先车辆',
value: mapAttentionRows[0]?.plate || mapAttentionRows[0]?.vin || selectedVehicleLabel,
detail: mapAttentionRows[0] ? realtimeIssueLabels(mapAttentionRows[0]).join('') : '当前没有必须优先处理的车辆。',
action: '处理关注',
color: mapAttentionRows.length > 0 ? 'orange' as const : selectedMapRow ? vehicleServiceStatus(selectedMapRow).color : 'grey' as const,
disabled: !mapAttentionRows[0] && !selectedMapRow,
onClick: () => {
if (mapAttentionRows[0]) {
selectRealtimeRow(mapAttentionRows[0]);
return;
}
if (selectedMapRow) {
selectRealtimeRow(selectedMapRow);
}
}
},
{
label: '时间窗复盘',
value: mapShiftTimeWindowLabel,
detail: timeWindowRow ? `${timeWindowRow.plate || timeWindowRow.vin} / ${timeWindowProtocol || '全部数据通道'}` : '先选择一辆车再复盘。',
action: '打开轨迹',
color: timeWindowReady ? 'blue' as const : 'orange' as const,
disabled: !timeWindowReady,
onClick: openTimeWindowHistory
},
{
label: '交接说明',
value: '可复制',
detail: mapAttentionRows.length > 0 ? '交接时先说明关注车辆和处理入口。' : '地图态势稳定,可直接复制交接口径。',
action: '复制交接',
color: 'blue' as const,
disabled: false,
onClick: copyRealtimeDutyHandoff
}
];
const mapFieldCommandItems = [
{
title: '全域定位',
@@ -1911,6 +1958,39 @@ export function Realtime({
</div>
</div>
<div className="vp-map-shift-console">
<div className="vp-map-shift-console-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={mapAttentionRows.length > 0 ? 'orange' : 'green'}>
{mapAttentionRows.length > 0 ? '有关注车辆' : '态势稳定'}
</Tag>
<Tag color={selectedMapRow ? 'green' : 'grey'}>{selectedMapRow ? '已选车辆' : '待选车辆'}</Tag>
</Space>
<Typography.Text strong></Typography.Text>
<Typography.Text type="secondary">
</Typography.Text>
</div>
<div className="vp-map-shift-console-grid">
{mapShiftConsoleItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-map-shift-console-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`客户地图值班台 ${item.label} ${item.value} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</div>
<div className="vp-map-decision-board">
<div className="vp-map-decision-summary">
<Space wrap>