feat(platform): add customer alert service desk

This commit is contained in:
lingniu
2026-07-05 20:07:19 +08:00
parent dbdce8f312
commit 2765a3c491
3 changed files with 180 additions and 1 deletions

View File

@@ -1128,10 +1128,89 @@ export function Quality({
onClick: copyAlertRecoveryReceipt
}
];
const alertCustomerServiceItems = [
{
label: '影响车辆',
value: `${issueVehicleCount.toLocaleString()}`,
detail: `${issueRecordCount.toLocaleString()} 条告警记录,先判断是否影响实时、轨迹和里程。`,
color: issueVehicleCount > 0 ? 'orange' as const : 'green' as const,
action: '复制影响',
disabled: false,
onClick: () => copyBusinessImpact()
},
{
label: '待通知',
value: `P0 ${priorityP0Count.toLocaleString()} / P1 ${priorityP1Count.toLocaleString()}`,
detail: priorityRows.length > 0 ? '已按优先级生成责任团队通知。' : '当前没有需要通知的告警车辆。',
color: priorityP0Count > 0 ? 'red' as const : priorityP1Count > 0 ? 'orange' as const : 'green' as const,
action: '复制通知',
disabled: priorityRows.length === 0,
onClick: () => copyPriorityDigest()
},
{
label: '焦点车辆',
value: focusIssue?.vehicleLabel || '暂无',
detail: focusIssue ? `${qualityProtocolLabel(focusIssue.protocol)} / ${qualityIssueLabel(focusIssue.issueType)}` : '没有焦点车辆时保持监控。',
color: focusIssue ? 'blue' as const : 'green' as const,
action: '车辆服务',
disabled: !focusIssue || !focusLookup?.key,
onClick: () => focusIssue && onOpenVehicle(focusLookup?.key ?? '', focusIssue.protocol)
},
{
label: '证据闭环',
value: priorityRows.length > 0 ? '可复核' : '待观察',
detail: '通知必须带上车辆服务、实时、轨迹、原始记录和里程证据。',
color: priorityRows.length > 0 ? 'blue' as const : 'green' as const,
action: '复制交接',
disabled: false,
onClick: () => copyNotificationHandoff()
},
{
label: '恢复验收',
value: primaryPolicy?.acceptanceCriteria ? '有标准' : '待补充',
detail: primaryPolicy?.acceptanceCriteria || '车辆服务状态恢复,实时、轨迹、历史和里程证据可查询。',
color: primaryPolicy?.acceptanceCriteria ? 'green' as const : 'orange' as const,
action: '复制回执',
disabled: false,
onClick: () => copyAlertRecoveryReceipt()
}
];
return (
<div className="vp-page">
<PageHeader title="告警事件" description="围绕车辆服务沉淀断链、VIN 缺失、字段缺失和链路健康事件,并形成通知闭环" />
<section className="vp-alert-customer-service-desk" aria-label="客户告警服务台">
<div className="vp-alert-customer-service-summary">
<Space wrap>
<Tag color={customerDecision.color}></Tag>
<Tag color={priorityP0Count > 0 ? 'red' : priorityP1Count > 0 ? 'orange' : 'green'}>
P0 {priorityP0Count.toLocaleString()} / P1 {priorityP1Count.toLocaleString()}
</Tag>
<Tag color={storageWritable ? 'green' : 'red'}>{storageWritable ? '证据可查' : '存储异常'}</Tag>
</Space>
<strong></strong>
<span>
</span>
</div>
<div className="vp-alert-customer-service-grid">
{alertCustomerServiceItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-alert-customer-service-item"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`客户告警服务台 ${item.label} ${item.value} ${item.action}`}
>
<Tag color={item.color}>{item.label}</Tag>
<strong>{item.value}</strong>
<span>{item.detail}</span>
<em>{item.action}</em>
</button>
))}
</div>
</section>
<Card bordered title="客户告警决策台">
<div className="vp-alert-decision-board">
<div className="vp-alert-decision-summary">