feat(platform): refine customer map views

This commit is contained in:
lingniu
2026-07-06 06:35:07 +08:00
parent a46072a5e7
commit 6bc3bf14de
2 changed files with 21 additions and 15 deletions

View File

@@ -1621,17 +1621,17 @@ export function Realtime({
];
const mapViewModeItems = [
{
label: '车辆总览',
value: `${rows.length.toLocaleString()} `,
detail: `在线 ${onlineCount.toLocaleString()}有效定位 ${locatedCount.toLocaleString()},先确认客户能看到的车辆范围`,
action: '当前页',
label: '在线运营',
value: `${onlineCount.toLocaleString()} 在线`,
detail: `有效定位 ${locatedCount.toLocaleString()},先确认客户当前能看到和能调度的车辆。`,
action: '打开地图',
color: 'blue' as const,
disabled: false,
onClick: () => load(filters, pagination.currentPage, pagination.pageSize)
onClick: () => applyFilters({ ...filters, online: 'online' })
},
{
label: '异常优先',
value: `${mapAttentionRows.length.toLocaleString()} `,
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,
@@ -1639,7 +1639,7 @@ export function Realtime({
onClick: () => applyFilters({ ...filters, serviceStatus: 'degraded' })
},
{
label: '轨迹复盘',
label: '单车复盘',
value: selectedVehicleLabel,
detail: selectedMapRow ? '围绕选中车辆进入轨迹、统计和历史查询。' : '从地图或车辆列表选择一辆车后复盘。',
action: '选中车辆',
@@ -1648,8 +1648,8 @@ export function Realtime({
onClick: () => selectedMapRow && onOpenHistory?.(selectedMapRow.vin, selectedVehicleProtocol)
},
{
label: '交付导出',
value: `${rows.length.toLocaleString()} `,
label: '报表交付',
value: `${rows.length.toLocaleString()} 当前页`,
detail: '导出当前地图车辆清单、在线状态和客户交付证据。',
action: '导出证据',
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
@@ -2805,18 +2805,18 @@ export function Realtime({
</div>
</div>
<div className="vp-map-view-mode">
<div className="vp-map-view-mode" aria-label="客户常用地图视图">
<div className="vp-map-view-mode-summary">
<Space wrap>
<Tag color="blue"></Tag>
<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 strong>线</Typography.Text>
<Typography.Text type="secondary">
</Typography.Text>
</div>
<div className="vp-map-view-mode-grid">
@@ -2827,7 +2827,7 @@ export function Realtime({
className="vp-map-view-mode-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`地图视图模式 ${item.label} ${item.value} ${item.action}`}
aria-label={`客户常用地图视图 ${item.label} ${item.value} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>

View File

@@ -11631,6 +11631,12 @@ test('shows realtime freshness status for recently updated and stale vehicles',
expect(screen.getByRole('button', { name: 'Live Map 决策动作 定位关注 关注车' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Live Map 决策动作 轨迹复盘 轨迹' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Live Map 决策动作 导出地图 CSV' })).toBeInTheDocument();
expect(screen.getByText('客户常用地图视图')).toBeInTheDocument();
expect(screen.getByText('把在线运营、异常处置、单车复盘和报表交付保存成客户常用地图入口。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户常用地图视图 在线运营 1 在线 打开地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户常用地图视图 异常处置 1 关注 关注车辆' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户常用地图视图 单车复盘 粤A超时1 选中车辆' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户常用地图视图 报表交付 2 当前页 导出证据' })).toBeInTheDocument();
expect(screen.getByText('客户地图监控包')).toBeInTheDocument();
expect(screen.getByText('车辆范围')).toBeInTheDocument();
expect(screen.getByText('在线态势')).toBeInTheDocument();