feat(platform): add map view modes
This commit is contained in:
@@ -1323,6 +1323,44 @@ export function Realtime({
|
||||
onClick: () => selectedMapRow && onOpenHistory?.(selectedMapRow.vin, selectedVehicleProtocol)
|
||||
}
|
||||
];
|
||||
const mapViewModeItems = [
|
||||
{
|
||||
label: '运营总览',
|
||||
value: `${rows.length.toLocaleString()} 辆`,
|
||||
detail: `在线 ${onlineCount.toLocaleString()},有效定位 ${locatedCount.toLocaleString()},先确认客户能看到的车辆范围。`,
|
||||
action: '当前页',
|
||||
color: 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: () => load(filters, pagination.currentPage, pagination.pageSize)
|
||||
},
|
||||
{
|
||||
label: '异常优先',
|
||||
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: false,
|
||||
onClick: () => applyFilters({ ...filters, serviceStatus: 'degraded' })
|
||||
},
|
||||
{
|
||||
label: '轨迹复盘',
|
||||
value: selectedVehicleLabel,
|
||||
detail: selectedMapRow ? '围绕选中车辆进入轨迹、统计和历史查询。' : '从地图或车辆列表选择一辆车后复盘。',
|
||||
action: '选中车辆',
|
||||
color: selectedMapRow ? 'blue' as const : 'grey' as const,
|
||||
disabled: !selectedMapRow || !canOpenVehicle(selectedMapRow.vin),
|
||||
onClick: () => selectedMapRow && onOpenHistory?.(selectedMapRow.vin, selectedVehicleProtocol)
|
||||
},
|
||||
{
|
||||
label: '交付导出',
|
||||
value: `${rows.length.toLocaleString()} 辆`,
|
||||
detail: '导出当前地图车辆清单、在线状态和客户交付证据。',
|
||||
action: '导出证据',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: rows.length === 0,
|
||||
onClick: exportRealtime
|
||||
}
|
||||
];
|
||||
const mapCustomerPackageItems = [
|
||||
{
|
||||
label: '车辆范围',
|
||||
@@ -1825,6 +1863,39 @@ export function Realtime({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="vp-map-view-mode">
|
||||
<div className="vp-map-view-mode-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">地图视图模式</Tag>
|
||||
<Tag color={mapAttentionRows.length > 0 ? 'orange' : 'green'}>
|
||||
{mapAttentionRows.length > 0 ? '异常优先' : '运营稳定'}
|
||||
</Tag>
|
||||
<Tag color={selectedMapRow ? 'blue' : 'grey'}>{selectedVehicleLabel}</Tag>
|
||||
</Space>
|
||||
<Typography.Text strong>按客户现场使用场景切换地图重点:运营总览、异常优先、轨迹复盘或交付导出。</Typography.Text>
|
||||
<Typography.Text type="secondary">
|
||||
视图模式只改变工作重点,底层仍围绕同一批车辆、同一个时间上下文和同一套服务动作。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-map-view-mode-grid">
|
||||
{mapViewModeItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-map-view-mode-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-field-command">
|
||||
<div className="vp-map-field-command-summary">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user