feat(platform): make dashboard map first

This commit is contained in:
lingniu
2026-07-06 01:13:31 +08:00
parent 6da5f77267
commit 221a67e4cb
2 changed files with 33 additions and 33 deletions

View File

@@ -2432,6 +2432,38 @@ export function Dashboard({
<div className="vp-page">
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、统计查询、自定义时间窗复盘、历史查询、告警通知和数据导出" />
<Spin spinning={loading}>
<section className="vp-customer-map-situation" aria-label="车辆地图态势">
<div className="vp-customer-map-situation-map">
<VehicleMap
points={commandMapPoints}
maxFallbackPoints={120}
heightClassName="vp-customer-map-situation-canvas"
fallbackLabel="显示车辆实时坐标预览"
/>
</div>
<div className="vp-customer-map-situation-panel">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} </Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}>线</Typography.Title>
<div className="vp-customer-map-situation-metrics">
{customerCockpitMetrics.slice(1, 4).map((item) => (
<button key={item.label} type="button" onClick={item.onClick} aria-label={`车辆地图态势 ${item.label} ${item.value}`}>
<span>{item.label}</span>
<strong>{item.value}</strong>
</button>
))}
</div>
<Space wrap>
<Button size="small" theme="solid" type="primary" aria-label="车辆地图态势 打开实时地图" onClick={() => onOpenMap({ online: 'online' })}></Button>
<Button size="small" theme="light" type="primary" aria-label="车辆地图态势 回放轨迹" onClick={openTimeMonitorHistory}></Button>
<Button size="small" theme="light" type="primary" onClick={openTimeMonitorMileage}></Button>
<Button size="small" theme="light" type="warning" onClick={() => onOpenQuality()}></Button>
</Space>
</div>
</section>
<section className="vp-customer-vehicle-service-dashboard" aria-label="客户车辆服务驾驶舱">
<div className="vp-customer-vehicle-service-dashboard-copy">
<Space wrap>
@@ -2785,38 +2817,6 @@ export function Dashboard({
</div>
</div>
</section>
<section className="vp-customer-map-situation" aria-label="车辆地图态势">
<div className="vp-customer-map-situation-map">
<VehicleMap
points={commandMapPoints}
maxFallbackPoints={120}
heightClassName="vp-customer-map-situation-canvas"
fallbackLabel="显示车辆实时坐标预览"
/>
</div>
<div className="vp-customer-map-situation-panel">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} </Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}>线</Typography.Title>
<div className="vp-customer-map-situation-metrics">
{customerCockpitMetrics.slice(1, 4).map((item) => (
<button key={item.label} type="button" onClick={item.onClick} aria-label={`车辆地图态势 ${item.label} ${item.value}`}>
<span>{item.label}</span>
<strong>{item.value}</strong>
</button>
))}
</div>
<Space wrap>
<Button size="small" theme="solid" type="primary" aria-label="车辆地图态势 打开实时地图" onClick={() => onOpenMap({ online: 'online' })}></Button>
<Button size="small" theme="light" type="primary" aria-label="车辆地图态势 回放轨迹" onClick={openTimeMonitorHistory}></Button>
<Button size="small" theme="light" type="primary" onClick={openTimeMonitorMileage}></Button>
<Button size="small" theme="light" type="warning" onClick={() => onOpenQuality()}></Button>
</Space>
</div>
</section>
<section className="vp-customer-service-command" aria-label="客户车辆服务总控台">
<div className="vp-customer-service-command-main">
<div className="vp-customer-service-command-copy">

View File

@@ -785,7 +785,7 @@ test('dashboard prioritizes customer vehicle service command over data sources',
expect(screen.getByText('先看在线车辆在哪里,再决定是否回放轨迹、核对里程、导出数据或通知处理。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆地图态势 打开实时地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆地图态势 回放轨迹' })).toBeInTheDocument();
expect(screen.getByText('车辆地图态势').compareDocumentPosition(screen.getByText('客户车辆服务总控台')) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
expect(screen.getByText('车辆地图态势').compareDocumentPosition(screen.getByText('客户车辆服务驾驶舱')) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
expect(await screen.findByText('客户车辆服务总控台')).toBeInTheDocument();
expect(screen.getByText('来源证据收敛层')).toBeInTheDocument();
expect(screen.getByText('协议来源只用于证明车辆服务可信度,客户主流程仍然从车辆、地图、时间窗、统计、导出和告警进入。')).toBeInTheDocument();