feat(platform): add customer problem desk
This commit is contained in:
@@ -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">
|
||||
客户首先关心的是车辆、位置、时间、里程、告警和导出;GB32960、JT808、MQTT 只放在证据层。
|
||||
</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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user