feat(platform): add vehicle command center
This commit is contained in:
@@ -2472,6 +2472,67 @@ export function Dashboard({
|
||||
<div className="vp-page">
|
||||
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、统计查询、自定义时间窗复盘、历史查询、告警通知和数据导出" />
|
||||
<Spin spinning={loading}>
|
||||
<section className="vp-vehicle-command-center" aria-label="车辆服务指挥台">
|
||||
<div className="vp-vehicle-command-map">
|
||||
<VehicleMap
|
||||
points={commandMapPoints}
|
||||
maxFallbackPoints={90}
|
||||
heightClassName="vp-vehicle-command-map-canvas"
|
||||
fallbackLabel="显示车辆服务指挥台坐标预览"
|
||||
/>
|
||||
<div className="vp-vehicle-command-map-status">
|
||||
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
|
||||
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} 告警</Tag>
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-vehicle-command-main">
|
||||
<Space wrap>
|
||||
<Tag color="blue">车辆服务指挥台</Tag>
|
||||
<Tag color="green">客户首屏</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={3} style={{ margin: 0 }}>
|
||||
10 秒内回答客户最关心的事:车辆在哪里、哪辆车异常、这段时间怎么跑、数据能不能导出。
|
||||
</Typography.Title>
|
||||
<div className="vp-vehicle-command-actions">
|
||||
{customerTaskNavigation.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-vehicle-command-action"
|
||||
onClick={item.onClick}
|
||||
aria-label={`车辆服务指挥台 ${item.title} ${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-vehicle-command-queue">
|
||||
<div className="vp-vehicle-command-queue-head">
|
||||
<Typography.Text strong>优先处理车辆</Typography.Text>
|
||||
<Typography.Text type="secondary">按影响客户看车、轨迹、统计和导出的程度排序。</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-vehicle-command-queue-grid">
|
||||
{vehiclePriorityQueue.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-vehicle-command-queue-item"
|
||||
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>
|
||||
</section>
|
||||
<section className="vp-customer-map-situation" aria-label="车辆地图态势">
|
||||
<div className="vp-customer-map-situation-map">
|
||||
<VehicleMap
|
||||
|
||||
@@ -1064,6 +1064,155 @@ body {
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-center {
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.18);
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.25fr) minmax(280px, 0.85fr);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-map {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
background: #eef4ff;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-map-canvas {
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-map-status {
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-main {
|
||||
min-width: 0;
|
||||
padding: 18px;
|
||||
border-right: 1px solid var(--vp-border);
|
||||
border-left: 1px solid var(--vp-border);
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-main .semi-typography {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-actions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-action {
|
||||
min-width: 0;
|
||||
min-height: 126px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.14);
|
||||
border-radius: 8px;
|
||||
background: #fbfcff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
align-content: start;
|
||||
transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-action:hover,
|
||||
.vp-vehicle-command-action:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.42);
|
||||
background: #f5f9ff;
|
||||
box-shadow: 0 0 0 3px rgba(22, 100, 255, 0.08);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-action strong,
|
||||
.vp-vehicle-command-queue-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
font-weight: 800;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-action span,
|
||||
.vp-vehicle-command-queue-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-action em,
|
||||
.vp-vehicle-command-queue-item em {
|
||||
align-self: end;
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue {
|
||||
min-width: 0;
|
||||
padding: 14px;
|
||||
background: #fffaf3;
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue-head {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue-head .semi-typography-secondary {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue-grid {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue-item {
|
||||
min-width: 0;
|
||||
min-height: 98px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid rgba(255, 127, 0, 0.2);
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
align-content: start;
|
||||
transition: border-color 0.16s ease, box-shadow 0.16s ease;
|
||||
}
|
||||
|
||||
.vp-vehicle-command-queue-item:hover,
|
||||
.vp-vehicle-command-queue-item:focus-visible {
|
||||
border-color: rgba(255, 127, 0, 0.48);
|
||||
box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.08);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-vehicle-priority-queue {
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(255, 127, 0, 0.2);
|
||||
@@ -12765,6 +12914,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-dispatch-operations-highlights,
|
||||
.vp-customer-delivery-workbench,
|
||||
.vp-customer-delivery-workbench-grid,
|
||||
.vp-vehicle-command-center,
|
||||
.vp-vehicle-command-actions,
|
||||
.vp-customer-vehicle-service-dashboard,
|
||||
.vp-customer-vehicle-service-dashboard-grid,
|
||||
.vp-customer-vehicle-service-dashboard-status,
|
||||
@@ -13036,6 +13187,17 @@ button.vp-realtime-command-item:focus-visible {
|
||||
border-bottom: 1px solid var(--vp-border);
|
||||
}
|
||||
|
||||
.vp-vehicle-command-main {
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-top: 1px solid var(--vp-border);
|
||||
border-bottom: 1px solid var(--vp-border);
|
||||
}
|
||||
|
||||
.vp-vehicle-command-map-canvas {
|
||||
min-height: 280px;
|
||||
}
|
||||
|
||||
.vp-amap-service-foundation-copy {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--vp-border);
|
||||
|
||||
@@ -766,6 +766,15 @@ test('dashboard prioritizes customer vehicle service command over data sources',
|
||||
|
||||
render(<App />);
|
||||
|
||||
expect((await screen.findAllByText('车辆服务指挥台')).length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('10 秒内回答客户最关心的事:车辆在哪里、哪辆车异常、这段时间怎么跑、数据能不能导出。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台 看车在哪 实时地图' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台 查这段时间 轨迹统计' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台 导出数据 历史导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台 处理告警 告警事件' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台优先队列 告警待处理 7 辆 告警事件' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务指挥台优先队列 无有效定位 208 辆 打开地图' })).toBeInTheDocument();
|
||||
expect(screen.getAllByText('车辆服务指挥台')[0].compareDocumentPosition(screen.getByText('车辆地图态势')) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||
expect(await screen.findByText('车辆服务驾驶舱')).toBeInTheDocument();
|
||||
expect(screen.getByText('先看车辆,不先看协议;客户进来先知道哪些车在线、在哪里、今天跑了多少、哪些异常要通知。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆服务驾驶舱 车辆总览 1,033 辆 车辆中心' })).toBeInTheDocument();
|
||||
@@ -1480,7 +1489,7 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
expect(screen.getByRole('button', { name: '客户交付驾驶舱 时间窗复盘 轨迹回放' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付驾驶舱 数据证据交付 历史导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '客户交付驾驶舱 告警通知交付 告警事件' })).toBeInTheDocument();
|
||||
expect(screen.getByText('车辆服务指挥台')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('车辆服务指挥台').length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('全域车辆监控')).toBeInTheDocument();
|
||||
expect(screen.getByText('异常车辆闭环')).toBeInTheDocument();
|
||||
expect(screen.getByText('自定义时间复盘')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user