feat(platform): add customer problem desk

This commit is contained in:
lingniu
2026-07-05 16:39:40 +08:00
parent 65ac26ef99
commit 89ab43a2dd
4 changed files with 165 additions and 0 deletions

View File

@@ -1463,6 +1463,48 @@ export function Dashboard({
onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {})
}
];
const customerProblemDesk = [
{
question: '现在车辆在哪里',
answer: `${commandLocatedCount.toLocaleString()} 辆有可用坐标,先进入实时地图确认分布和最新上报。`,
metric: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
action: '打开实时地图',
color: 'green' as const,
onClick: () => onOpenMap({ online: 'online' })
},
{
question: '这段时间跑了多少',
answer: `${dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo)},用同一时间窗核对区间里程和每日统计。`,
metric: `${formatCount(serviceSummary?.totalVehicles)} 车辆`,
action: '查统计查询',
color: 'blue' as const,
onClick: openTimeMonitorMileage
},
{
question: '轨迹能不能回放',
answer: `今日活跃 ${formatCount(summary?.activeToday)},可回放位置、速度、停驶和里程断点。`,
metric: `${formatCount(summary?.activeToday)} 活跃`,
action: '打开轨迹回放',
color: 'blue' as const,
onClick: openTimeMonitorHistory
},
{
question: '需要导出哪些证据',
answer: `今日数据 ${formatCount(summary?.frameToday)},按车辆、时间、字段裁剪导出位置和原始证据。`,
metric: `${formatCount(summary?.frameToday)} 数据`,
action: '查询历史导出',
color: 'blue' as const,
onClick: openTimeMonitorRaw
},
{
question: '哪些车需要通知处理',
answer: highPriorityIssue ? `${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}` : '暂无高优先级告警,保持日常巡检。',
metric: `${formatCount(summary?.issueVehicles)} 告警`,
action: '查看告警事件',
color: (summary?.issueVehicles ?? 0) > 0 ? 'orange' as const : 'green' as const,
onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {})
}
];
const customerNextActions = [
{
level: (summary?.issueVehicles ?? 0) > 0 ? '优先' : '巡检',
@@ -1599,6 +1641,36 @@ export function Dashboard({
))}
</div>
</div>
<div className="vp-customer-problem-desk">
<div className="vp-customer-problem-head">
<div>
<Typography.Text strong></Typography.Text>
<Typography.Text type="secondary"></Typography.Text>
</div>
<Tag color="blue"></Tag>
</div>
<Typography.Text type="secondary" className="vp-customer-problem-principle">
GB32960JT808MQTT
</Typography.Text>
<div className="vp-customer-problem-grid">
{customerProblemDesk.map((item) => (
<button
key={item.question}
type="button"
className="vp-customer-problem-item"
onClick={item.onClick}
aria-label={`客户问题处理台 ${item.question} ${item.action}`}
>
<div>
<strong>{item.question}</strong>
<span>{item.answer}</span>
</div>
<Tag color={item.color}>{item.metric}</Tag>
<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>

View File

@@ -532,6 +532,89 @@ body {
line-height: 18px;
}
.vp-customer-problem-desk {
padding: 12px;
border: 1px solid rgba(22, 100, 255, 0.18);
border-radius: var(--vp-radius);
background: #ffffff;
display: grid;
gap: 10px;
}
.vp-customer-problem-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.vp-customer-problem-head > div {
display: grid;
gap: 2px;
}
.vp-customer-problem-head .semi-typography-secondary,
.vp-customer-problem-principle {
font-size: 12px;
line-height: 18px;
}
.vp-customer-problem-grid {
display: grid;
gap: 8px;
}
.vp-customer-problem-item {
min-height: 76px;
padding: 10px 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;
grid-template-columns: minmax(0, 1fr) auto;
gap: 7px 10px;
align-items: start;
}
.vp-customer-problem-item:hover,
.vp-customer-problem-item:focus-visible {
border-color: rgba(22, 100, 255, 0.42);
background: #f5f9ff;
outline: none;
}
.vp-customer-problem-item div {
display: grid;
gap: 4px;
}
.vp-customer-problem-item strong {
color: var(--vp-text);
font-size: 14px;
line-height: 20px;
font-weight: 700;
}
.vp-customer-problem-item span {
color: var(--vp-text-muted);
font-size: 12px;
line-height: 18px;
word-break: break-word;
}
.vp-customer-problem-item em {
grid-column: 1 / -1;
color: var(--vp-primary);
font-size: 12px;
font-style: normal;
font-weight: 700;
line-height: 18px;
}
.vp-fleet-next-actions {
display: grid;
gap: 9px;

View File

@@ -807,6 +807,14 @@ 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.getByText('先回答客户问题,再下钻到车辆、轨迹、统计和证据。')).toBeInTheDocument();
expect(screen.getByText('客户首先关心的是车辆、位置、时间、里程、告警和导出GB32960、JT808、MQTT 只放在证据层。')).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: '客户问题处理台 哪些车需要通知处理 查看告警事件' })).toBeInTheDocument();
expect(screen.getByText('今日先处理')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆运营建议 先处理告警车辆 进入告警' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆运营建议 选择一辆车复盘 车辆中心' })).toBeInTheDocument();

View File

@@ -17,10 +17,12 @@
- Fleetio 的车辆资产和报表资料把 Vehicle List、Vehicle Details、Service History、Service Schedule 等作为车队管理的高频入口。这说明车辆中心不能只是数据覆盖表,还要提供最近车辆、待维护车辆、服务历史/报表导出的资产作业入口。参考https://www.fleetio.com/ 和 https://www.fleetio.com/blog/fleet-management-reports
- Azuga 的车队跟踪资料强调实时跟踪、车辆资产保护、维护告警和洞察报表。这对应本项目车辆中心的作业栏最近上报、待关注车辆、身份维护和报表导出。参考https://www.azuga.com/
- Verizon Connect 把 live map 与 historic replays 放在同一个 GPS tracking 叙事里Geotab Trips History 支持查看车辆实时位置和历史行程Samsara GPS tracking 也把 Trip history 作为分析车辆行程效率的核心入口。因此历史页要先呈现“车辆 + 时间窗 + 轨迹回放 + 证据导出”的客户复盘路径,而不是先暴露 RAW/字段表。参考https://www.verizonconnect.com/solutions/gps-fleet-tracking-software/、https://support.geotab.com/help/mygeotab/fleet-activity/trips/trips-history、https://www.samsara.com/products/telematics/gps-fleet-tracking
- Samsara、Geotab、Verizon Connect 的公开页面都把客户问题翻译成任务入口:车辆在哪里、这一趟怎么跑、哪些风险要通知、报表如何导出。因此首页右侧需要问题式入口,先回答客户语言,再下钻到地图、轨迹、统计、历史证据和告警。
## 对标后的产品改造规则
- 首页第一屏只回答客户任务:看车在哪、查某段时间、导出证据、处理告警。
- 第一屏需要有“客户问题处理台”:现在车辆在哪里、这段时间跑了多少、轨迹能不能回放、需要导出哪些证据、哪些车需要通知处理。
- “32960 / 808 / MQTT”不作为主任务名称只在车辆档案、历史证据、运维质量中作为来源可信度出现。
- 自定义时间窗必须成为跨页面共享的查询意图:轨迹、里程、历史数据、告警复盘使用同一组参数。
- 车辆中心要像资产系统一样把车辆清单变成作业入口:最近上报、待关注、身份维护、报表导出,而不是只提供表格筛选。