feat(platform): add mileage next actions
This commit is contained in:
@@ -1175,6 +1175,58 @@ export function Mileage({
|
||||
onSecondary: copyStatisticsSummary
|
||||
}
|
||||
];
|
||||
const mileageNextActions = [
|
||||
{
|
||||
title: publishAuditConclusion === '阻断发布' ? '先解除发布阻断' : publishAuditConclusion === '复核后发布' ? '先完成发布复核' : '可交付里程报告',
|
||||
value: publishAuditConclusion,
|
||||
detail: publishAuditConclusion === '可发布'
|
||||
? '闭合、覆盖和异常检查通过后,可复制交付包或导出明细给客户。'
|
||||
: '先处理闭合、覆盖、异常和在线影响,再进入客户交付。',
|
||||
color: publishAuditColor,
|
||||
action: publishAuditConclusion === '可发布' ? '复制交付包' : '发布审计',
|
||||
disabled: false,
|
||||
onClick: publishAuditConclusion === '可发布' ? copyMileageDeliveryPackage : copyPublishAudit
|
||||
},
|
||||
{
|
||||
title: anomalyRows.length > 0 ? '优先复核异常日' : '按时间窗核对轨迹',
|
||||
value: anomalyRows.length > 0 ? `${anomalyRows.length.toLocaleString()} 条异常` : mileageRangeText,
|
||||
detail: anomalyRows[0]
|
||||
? `${anomalyRows[0].plate || anomalyRows[0].vin} / ${anomalyRows[0].date} 建议先回放轨迹。`
|
||||
: '用同一个车辆和时间窗进入轨迹回放,核对位置、速度和里程变化。',
|
||||
color: anomalyRows.length > 0 ? 'orange' as const : 'blue' as const,
|
||||
action: '轨迹回放',
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => {
|
||||
if (anomalyRows[0]) {
|
||||
openMileageEvidence(anomalyRows[0]);
|
||||
return;
|
||||
}
|
||||
onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' });
|
||||
}
|
||||
},
|
||||
{
|
||||
title: pageCoverageRate >= 100 ? '明细覆盖完整' : '拉齐全量明细',
|
||||
value: formatPercent(pageCoverageRate),
|
||||
detail: pageCoverageRate >= 100
|
||||
? '当前页已经覆盖筛选范围内全部明细,可直接导出复核。'
|
||||
: `${rows.length.toLocaleString()} / ${summary.recordCount.toLocaleString()} 条记录在当前页,导出前建议拉齐。`,
|
||||
color: pageCoverageRate >= 100 ? 'green' as const : 'orange' as const,
|
||||
action: '导出明细',
|
||||
disabled: rows.length === 0,
|
||||
onClick: exportMileage
|
||||
},
|
||||
{
|
||||
title: offlineVehicleCount > 0 ? '关注离线影响' : '在线状态正常',
|
||||
value: `${offlineVehicleCount.toLocaleString()} 离线`,
|
||||
detail: offlineVehicleCount > 0
|
||||
? '离线车辆会影响实时位置、当日里程和告警触达,建议同步运营处理。'
|
||||
: '当前筛选范围内在线状态未形成主要统计风险。',
|
||||
color: offlineVehicleCount > 0 ? 'orange' as const : 'green' as const,
|
||||
action: '在线态势',
|
||||
disabled: false,
|
||||
onClick: copyOnlineOperationsReport
|
||||
}
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
const nextFilters = mergeInitialFilters(initialVin, initialProtocol, initialFilters);
|
||||
@@ -1237,6 +1289,38 @@ export function Mileage({
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="里程报告建议" style={{ marginTop: 16 }}>
|
||||
<div className="vp-mileage-next-actions">
|
||||
<div className="vp-mileage-next-summary">
|
||||
<Space wrap>
|
||||
<Tag color={publishAuditColor}>{publishAuditConclusion}</Tag>
|
||||
<Tag color={mileageDeliveryColor}>{mileageDeliveryState}</Tag>
|
||||
<Tag color={confidenceColor}>{confidenceStatus}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>从车辆服务视角安排下一步</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
里程页不再让客户先理解 GB32960、JT808、MQTT 的差异,而是直接给出交付、轨迹回放、历史查询、导出和在线影响的下一步动作。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-mileage-next-grid">
|
||||
{mileageNextActions.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-mileage-next-action"
|
||||
disabled={item.disabled}
|
||||
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>
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="车辆统计服务总览" style={{ marginTop: 16 }}>
|
||||
<div className="vp-table-toolbar">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user