feat(platform): add vehicle service cockpit
This commit is contained in:
@@ -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">
|
||||
32960、808 和宇通 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>
|
||||
|
||||
Reference in New Issue
Block a user