feat(platform): add customer question shortcuts
This commit is contained in:
@@ -1426,6 +1426,43 @@ export function Dashboard({
|
||||
onClick: () => onOpenQuality()
|
||||
}
|
||||
];
|
||||
const customerQuestionActions = [
|
||||
{
|
||||
question: '这辆车现在在哪里?',
|
||||
answer: `${commandLocatedCount.toLocaleString()} 辆有可用坐标`,
|
||||
action: '打开地图',
|
||||
color: commandLocatedCount > 0 ? 'green' as const : 'orange' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
question: '这段时间跑了多少公里?',
|
||||
answer: dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo),
|
||||
action: '查里程',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorMileage
|
||||
},
|
||||
{
|
||||
question: '能不能回放轨迹?',
|
||||
answer: `${formatCount(summary?.activeToday)} 辆今日活跃`,
|
||||
action: '轨迹回放',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorHistory
|
||||
},
|
||||
{
|
||||
question: '数据能导出给客户吗?',
|
||||
answer: `${formatCount(summary?.frameToday)} 条今日证据`,
|
||||
action: '查询导出',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
question: '哪些车需要马上处理?',
|
||||
answer: highPriorityIssue ? `${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}` : '暂无高优先级告警',
|
||||
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 ? '优先' : '巡检',
|
||||
@@ -1537,6 +1574,22 @@ export function Dashboard({
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<Typography.Text strong>客户常问</Typography.Text>
|
||||
<div className="vp-fleet-question-grid">
|
||||
{customerQuestionActions.map((item) => (
|
||||
<button
|
||||
key={item.question}
|
||||
type="button"
|
||||
className="vp-fleet-question-item"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户常问 ${item.question} ${item.action}`}
|
||||
>
|
||||
<strong>{item.question}</strong>
|
||||
<span>{item.answer}</span>
|
||||
<Tag color={item.color}>{item.action}</Tag>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="vp-fleet-monitor-time">
|
||||
<Space wrap>
|
||||
<Tag color="blue">自定义时间窗</Tag>
|
||||
|
||||
Reference in New Issue
Block a user