feat(platform): add customer task navigation
This commit is contained in:
@@ -1508,6 +1508,40 @@ export function Dashboard({
|
||||
detail: '同一时间范围贯穿轨迹、统计、历史和告警。'
|
||||
}
|
||||
];
|
||||
const customerTaskNavigation = [
|
||||
{
|
||||
title: '看车在哪',
|
||||
value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
|
||||
detail: `${commandLocatedCount.toLocaleString()} 辆有有效定位`,
|
||||
action: '实时地图',
|
||||
color: 'green' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
title: '查这段时间',
|
||||
value: dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo),
|
||||
detail: '同窗查看轨迹和里程统计',
|
||||
action: '轨迹统计',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorHistory
|
||||
},
|
||||
{
|
||||
title: '导出数据',
|
||||
value: `${formatCount(summary?.frameToday)} 今日数据`,
|
||||
detail: '位置、原始记录和字段证据',
|
||||
action: '历史导出',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
title: '处理告警',
|
||||
value: `${formatCount(summary?.issueVehicles)} 告警车辆`,
|
||||
detail: highPriorityIssue ? qualityIssueLabel(highPriorityIssue.issueType) : '当前无高优先级',
|
||||
action: '告警事件',
|
||||
color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const,
|
||||
onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {})
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -1543,6 +1577,28 @@ export function Dashboard({
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-fleet-monitor-panel">
|
||||
<div className="vp-fleet-task-router">
|
||||
<div className="vp-fleet-task-router-head">
|
||||
<Typography.Text strong>客户任务导航</Typography.Text>
|
||||
<Typography.Text type="secondary">先按客户问题进入业务页面</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-fleet-task-grid">
|
||||
{customerTaskNavigation.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-fleet-task-item"
|
||||
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-fleet-monitor-panel-head">
|
||||
<Typography.Text strong>今日先处理</Typography.Text>
|
||||
<Button size="small" theme="light" type="primary" onClick={copyCustomerServiceGuide}>复制说明</Button>
|
||||
|
||||
@@ -460,6 +460,78 @@ body {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-router {
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.18);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #ffffff;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-router-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-router-head .semi-typography-secondary {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-item {
|
||||
min-height: 122px;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--vp-border);
|
||||
border-radius: 8px;
|
||||
background: #fbfcff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-fleet-task-item:hover,
|
||||
.vp-fleet-task-item:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.45);
|
||||
background: #f5f9ff;
|
||||
box-shadow: 0 0 0 3px rgba(22, 100, 255, 0.06);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-fleet-task-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 15px;
|
||||
line-height: 21px;
|
||||
font-weight: 700;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-fleet-task-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
.vp-fleet-task-item em {
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-fleet-next-actions {
|
||||
display: grid;
|
||||
gap: 9px;
|
||||
@@ -6827,6 +6899,7 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-action-grid,
|
||||
.vp-fleet-monitor .semi-card-body,
|
||||
.vp-fleet-monitor-stats,
|
||||
.vp-fleet-task-grid,
|
||||
.vp-fleet-monitor-trust,
|
||||
.vp-vehicle-live-view .semi-card-body,
|
||||
.vp-vehicle-live-main,
|
||||
|
||||
@@ -26,7 +26,7 @@ test('renders vehicle platform shell', () => {
|
||||
expect(screen.getByText('地图看车、在线监控、异常优先')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('车辆服务').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('按 VIN、车牌、手机号管理车辆')).toBeInTheDocument();
|
||||
expect(screen.getByText('轨迹统计')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('轨迹统计').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('回放轨迹、统计查询、导出数据')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('告警通知').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('接入运维')).toBeInTheDocument();
|
||||
@@ -802,6 +802,11 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
expect(screen.getByText('客户主流程围绕车辆本身:地图看车、实时状态、时间窗复盘、统计查询、历史数据导出和告警通知。接入来源只作为追溯证据。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆监控指标 车辆总数 1,033' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆监控指标 在线车辆 208' })).toBeInTheDocument();
|
||||
expect(screen.getByText('客户任务导航')).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.getByText('今日先处理')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆运营建议 先处理告警车辆 进入告警' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '车辆运营建议 选择一辆车复盘 车辆中心' })).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user