feat(platform): add customer vehicle service dashboard
This commit is contained in:
@@ -2385,11 +2385,98 @@ export function Dashboard({
|
||||
onClick: () => onOpenRealtime({ online: 'online' })
|
||||
}
|
||||
];
|
||||
const customerVehicleServiceDashboardItems = [
|
||||
{
|
||||
question: '车辆在哪里',
|
||||
value: `${commandLocatedCount.toLocaleString()} 有定位`,
|
||||
detail: '进入实时地图查看车辆分布、在线状态、最后上报和当前位置。',
|
||||
action: '打开地图',
|
||||
color: commandLocatedCount > 0 ? 'green' as const : 'orange' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
question: '轨迹能否回放',
|
||||
value: `${formatCount(summary?.activeToday)} 活跃`,
|
||||
detail: '按车辆和自定义时间窗回放路线、速度、停驶和里程断点。',
|
||||
action: '轨迹回放',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorHistory
|
||||
},
|
||||
{
|
||||
question: '里程怎么算',
|
||||
value: `${formatCount(serviceSummary?.totalVehicles)} 车辆`,
|
||||
detail: '查询区间里程、每日里程和统计闭合情况,支撑 BI 口径复核。',
|
||||
action: '统计查询',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorMileage
|
||||
},
|
||||
{
|
||||
question: '数据怎么导出',
|
||||
value: `${formatCount(summary?.frameToday)} 今日数据`,
|
||||
detail: '按车辆、时间和字段裁剪导出位置历史、原始记录和解析证据。',
|
||||
action: '历史导出',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
question: '异常谁处理',
|
||||
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 } : {})
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
<PageHeader title="车辆服务工作台" description="面向客户的车辆地图、实时监控、轨迹回放、统计查询、自定义时间窗复盘、历史查询、告警通知和数据导出" />
|
||||
<Spin spinning={loading}>
|
||||
<section className="vp-customer-vehicle-service-dashboard" aria-label="客户车辆服务驾驶舱">
|
||||
<div className="vp-customer-vehicle-service-dashboard-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户车辆服务驾驶舱</Tag>
|
||||
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
|
||||
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} 告警</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={3} style={{ margin: 0 }}>
|
||||
客户进来先看车辆,不先看协议。
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
把实时地图、轨迹回放、里程统计、历史导出和告警通知收敛成一个可交付的车辆服务入口。
|
||||
</Typography.Text>
|
||||
<div className="vp-customer-vehicle-service-dashboard-status" aria-label="客户车辆服务驾驶舱状态">
|
||||
<span>
|
||||
<strong>{formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)}</strong>
|
||||
在线车辆
|
||||
</span>
|
||||
<span>
|
||||
<strong>{dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo)}</strong>
|
||||
服务时间窗
|
||||
</span>
|
||||
<span>
|
||||
<strong>{focusVehicle?.label ?? '暂无重点车辆'}</strong>
|
||||
今日重点
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-customer-vehicle-service-dashboard-grid">
|
||||
{customerVehicleServiceDashboardItems.map((item) => (
|
||||
<button
|
||||
key={item.question}
|
||||
type="button"
|
||||
className="vp-customer-vehicle-service-dashboard-item"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户车辆服务驾驶舱 ${item.question} ${item.value} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.question}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<section className="vp-vehicle-service-cockpit" aria-label="车辆服务驾驶舱">
|
||||
<div className="vp-vehicle-service-cockpit-copy">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user