feat(platform): add customer delivery cockpit
This commit is contained in:
@@ -1584,6 +1584,40 @@ export function Dashboard({
|
||||
onClick: () => onOpenQuality(highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {})
|
||||
}
|
||||
];
|
||||
const customerDeliveryItems = [
|
||||
{
|
||||
title: '在线车辆交付',
|
||||
value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
|
||||
detail: `地图有效定位 ${commandLocatedCount.toLocaleString()} 辆,先交付客户最关心的车辆当前位置和在线态势。`,
|
||||
action: '实时地图',
|
||||
color: 'green' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
title: '时间窗复盘',
|
||||
value: dayRangeText(timeMonitorScopeValue.dateFrom, timeMonitorScopeValue.dateTo),
|
||||
detail: '同一时间范围同步到轨迹、统计、历史证据和告警复盘,避免客户反复给条件。',
|
||||
action: '轨迹回放',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorHistory
|
||||
},
|
||||
{
|
||||
title: '数据证据交付',
|
||||
value: `${formatCount(summary?.frameToday)} 今日数据`,
|
||||
detail: '按车辆、时间和字段裁剪导出位置、原始记录、解析字段和统计依据。',
|
||||
action: '历史导出',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
title: '告警通知交付',
|
||||
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">
|
||||
@@ -1742,6 +1776,39 @@ export function Dashboard({
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered className="vp-customer-delivery-board" bodyStyle={{ padding: 0 }}>
|
||||
<div className="vp-customer-delivery-summary">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户交付驾驶舱</Tag>
|
||||
<Tag color={(summary?.issueVehicles ?? 0) > 0 ? 'orange' : 'green'}>{formatCount(summary?.issueVehicles)} 告警车辆</Tag>
|
||||
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '地图可交付' : '坐标可交付'}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>把车辆位置、时间窗、里程统计、历史证据和告警通知组织成客户可以直接使用的服务包。</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
客户打开首页后,先知道今天能交付什么,再选择地图、轨迹、统计、导出或通知。
|
||||
</Typography.Text>
|
||||
<Space wrap>
|
||||
<Button size="small" theme="solid" type="primary" onClick={copyCustomerServiceGuide}>复制客户服务说明</Button>
|
||||
<Button size="small" theme="light" type="primary" aria-label="客户交付驾驶舱 导出驾驶舱 CSV" onClick={exportDashboardSnapshot}>导出驾驶舱 CSV</Button>
|
||||
</Space>
|
||||
</div>
|
||||
<div className="vp-customer-delivery-grid">
|
||||
{customerDeliveryItems.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-customer-delivery-item"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户交付驾驶舱 ${item.title} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.title}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card
|
||||
bordered
|
||||
title={<Space><span>自定义时间窗复盘</span><Tag color="blue">{timeMonitorSummary}</Tag></Space>}
|
||||
|
||||
Reference in New Issue
Block a user