feat(platform): add customer daily operations home
This commit is contained in:
@@ -2739,6 +2739,70 @@ export function Dashboard({
|
||||
onClick: openTimeMonitorRaw
|
||||
}
|
||||
];
|
||||
const copyTodayVehicleServiceBrief = () => {
|
||||
const rawFilters = { tab: 'raw', includeFields: 'true' };
|
||||
const lines = [
|
||||
'【客户今日车辆服务简报】',
|
||||
`在线车辆:${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} / ${formatCount(serviceSummary?.totalVehicles)}`,
|
||||
`地图可见:${commandLocatedCount.toLocaleString()} 辆有坐标`,
|
||||
`今日活跃:${formatCount(summary?.activeToday)}`,
|
||||
`今日数据:${formatCount(summary?.frameToday)}`,
|
||||
`告警车辆:${formatCount(summary?.issueVehicles)}`,
|
||||
`当前时间窗:${timeMonitorWindowLabel}`,
|
||||
highPriorityIssue
|
||||
? `优先告警:${qualityIssueLabel(highPriorityIssue.issueType)} / ${priorityIssueVehicleLabel(highPriorityIssue)}`
|
||||
: '优先告警:暂无高优先级告警',
|
||||
`车辆地图:${appURL(buildAppHash({ page: 'map', filters: { online: 'online' } }))}`,
|
||||
`实时监控:${appURL(buildAppHash({ page: 'realtime', filters: { online: 'online' } }))}`,
|
||||
`轨迹回放:${appURL(buildAppHash({ page: 'history', filters: timeMonitorScopeValue }))}`,
|
||||
`里程报表:${appURL(buildAppHash({ page: 'mileage', filters: timeMonitorScopeValue }))}`,
|
||||
`历史导出:${appURL(buildAppHash({ page: 'history-query', filters: rawFilters }))}`,
|
||||
`告警通知:${appURL(buildAppHash({ page: 'alert-events', filters: highPriorityIssue?.issueType ? { issueType: highPriorityIssue.issueType } : {} }))}`
|
||||
];
|
||||
copyText(lines.join('\n'), '今日服务简报');
|
||||
};
|
||||
const todayOperationsItems = [
|
||||
{
|
||||
label: '车辆在线',
|
||||
value: `${formatCount(serviceSummary?.onlineVehicles ?? summary?.onlineVehicles)} 在线`,
|
||||
detail: `${formatCount(serviceSummary?.totalVehicles)} 辆车辆服务资产,先确认客户能看到多少车。`,
|
||||
action: '打开地图',
|
||||
color: 'green' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
label: '地图可见',
|
||||
value: `${commandLocatedCount.toLocaleString()} 有坐标`,
|
||||
detail: '有效坐标决定客户能不能直接看地图态势和位置分布。',
|
||||
action: '实时地图',
|
||||
color: commandLocatedCount > 0 ? 'blue' as const : 'orange' as const,
|
||||
onClick: () => onOpenMap({ online: 'online' })
|
||||
},
|
||||
{
|
||||
label: '轨迹复盘',
|
||||
value: `${formatCount(summary?.activeToday)} 活跃`,
|
||||
detail: '今日活跃车辆可按同一时间窗回放轨迹、速度和停驶片段。',
|
||||
action: '回放轨迹',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorHistory
|
||||
},
|
||||
{
|
||||
label: '里程报表',
|
||||
value: timeMonitorWindowLabel,
|
||||
detail: '从报表周期进入里程核对,避免客户只看到协议帧量。',
|
||||
action: '核对里程',
|
||||
color: 'blue' as const,
|
||||
onClick: openTimeMonitorMileage
|
||||
},
|
||||
{
|
||||
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 } : {})
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="vp-page">
|
||||
@@ -2851,6 +2915,40 @@ export function Dashboard({
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<section className="vp-today-operations-home" aria-label="客户今日运营台">
|
||||
<div className="vp-today-operations-home-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户今日运营台</Tag>
|
||||
<Tag color="green">{vehicleServiceOnlineText(serviceSummary, summary)}</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">
|
||||
今天先看在线和地图,再处理告警、复盘轨迹、核对里程,最后把证据导出给客户。
|
||||
</Typography.Text>
|
||||
<Button size="small" icon={<IconCopy />} theme="solid" type="primary" onClick={copyTodayVehicleServiceBrief}>
|
||||
复制今日服务简报
|
||||
</Button>
|
||||
</div>
|
||||
<div className="vp-today-operations-home-grid">
|
||||
{todayOperationsItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-today-operations-home-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>
|
||||
) : null}
|
||||
{focusMode === 'time-window' ? (
|
||||
|
||||
Reference in New Issue
Block a user