feat(platform): add vehicle service cockpit

This commit is contained in:
lingniu
2026-07-05 23:03:14 +08:00
parent 934691e956
commit 15a318112d
3 changed files with 182 additions and 0 deletions

View File

@@ -1502,6 +1502,56 @@ export function Dashboard({
onClick: () => onOpenQuality()
}
];
const customerServiceCockpitItems = [
{
label: '车辆总览',
value: `${formatCount(serviceSummary?.totalVehicles)}`,
detail: '按 VIN、车牌、手机号或 OEM 进入车辆服务,不从协议列表开始。',
action: '车辆中心',
color: 'blue' as const,
onClick: () => onOpenVehicles({})
},
{
label: '实时可见',
value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
detail: `${commandLocatedCount.toLocaleString()} 辆有有效坐标,先回答客户车辆在哪里。`,
action: '地图看车',
color: commandLocatedCount > 0 ? 'green' as const : 'orange' as const,
onClick: () => onOpenMap({ online: 'online' })
},
{
label: '轨迹复盘',
value: `${formatCount(summary?.activeToday)} 今日活跃`,
detail: '同一辆车、同一时间窗回放路线、速度、停驶和里程断点。',
action: '回放轨迹',
color: 'blue' as const,
onClick: openTimeMonitorHistory
},
{
label: '里程统计',
value: dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo),
detail: '核对区间里程、每日闭合、异常记录和 BI 统计口径。',
action: '统计查询',
color: 'blue' as const,
onClick: openTimeMonitorMileage
},
{
label: '数据交付',
value: `${formatCount(summary?.frameToday)} 今日数据`,
detail: '按车辆、时间和字段裁剪历史位置、原始记录和解析证据。',
action: '导出证据',
color: 'blue' as const,
onClick: openTimeMonitorRaw
},
{
label: '告警通知',
value: `${formatCount(summary?.issueVehicles)} 告警`,
detail: 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 customerCockpitWorkflows = [
{
title: '实时看车',
@@ -2144,6 +2194,37 @@ export function Dashboard({
<div className="vp-page">
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、统计查询、自定义时间窗复盘、历史查询、告警通知和数据导出" />
<Spin spinning={loading}>
<section className="vp-vehicle-service-cockpit" aria-label="车辆服务驾驶舱">
<div className="vp-vehicle-service-cockpit-copy">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color="green"></Tag>
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} </Tag>
</Space>
<Typography.Title heading={4} style={{ margin: 0 }}>
线
</Typography.Title>
<Typography.Text type="secondary">
32960808 MQTT
</Typography.Text>
</div>
<div className="vp-vehicle-service-cockpit-grid">
{customerServiceCockpitItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-vehicle-service-cockpit-item"
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>
<section className="vp-customer-service-journey" aria-label="车辆服务闭环">
<div className="vp-customer-service-journey-copy">
<Tag color="blue"></Tag>