feat(platform): add customer mileage workbench
This commit is contained in:
@@ -838,6 +838,59 @@ export function Mileage({
|
||||
detail: `${onlineVehicleCount.toLocaleString()} 在线 / ${offlineVehicleCount.toLocaleString()} 离线`
|
||||
}
|
||||
];
|
||||
const mileageCustomerWorkbenchItems = [
|
||||
{
|
||||
label: '区间里程',
|
||||
value: `${formatKm(summary.totalMileageKm)} km`,
|
||||
detail: `${summary.vehicleCount.toLocaleString()} 辆车,${mileageRangeText}。`,
|
||||
color: 'blue' as const,
|
||||
action: '复制摘要',
|
||||
disabled: false,
|
||||
onClick: () => copyStatisticsSummary()
|
||||
},
|
||||
{
|
||||
label: '每日闭合',
|
||||
value: closureStatus,
|
||||
detail: closureDeltaKm == null ? `当前页覆盖 ${formatPercent(pageCoverageRate)},发布前需要拉齐全量。` : `闭合差值 ${formatKm(Math.abs(closureDeltaKm))} km。`,
|
||||
color: closureStatusColor,
|
||||
action: '发布审计',
|
||||
disabled: false,
|
||||
onClick: () => copyPublishAudit()
|
||||
},
|
||||
{
|
||||
label: '轨迹回放',
|
||||
value: peakMileage?.date || mileageRangeText,
|
||||
detail: peakMileage ? `${peakMileage.plate || peakMileage.vin} 最大单日 ${formatKm(peakMileage.dailyMileageKm)} km。` : '选择车辆后用同一时间窗回放轨迹。',
|
||||
color: currentVehicleKeyword ? 'blue' as const : 'grey' as const,
|
||||
action: '回放轨迹',
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => {
|
||||
if (peakMileage) {
|
||||
openMileageEvidence(peakMileage);
|
||||
return;
|
||||
}
|
||||
onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' });
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '历史导出',
|
||||
value: `${rows.length.toLocaleString()} 条`,
|
||||
detail: `当前页覆盖 ${formatPercent(pageCoverageRate)},用于客户对账和 BI 复核。`,
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
action: '导出明细',
|
||||
disabled: rows.length === 0,
|
||||
onClick: () => exportMileage()
|
||||
},
|
||||
{
|
||||
label: '告警通知',
|
||||
value: `${offlineVehicleCount.toLocaleString()} 离线`,
|
||||
detail: offlineVehicleCount > 0 ? '离线会影响定位、里程解释和客户通知。' : '当前在线状态未形成主要统计风险。',
|
||||
color: offlineVehicleCount > 0 ? 'orange' as const : 'green' as const,
|
||||
action: '在线态势',
|
||||
disabled: false,
|
||||
onClick: () => copyOnlineOperationsReport()
|
||||
}
|
||||
];
|
||||
const mileageCustomerActions = [
|
||||
{
|
||||
label: '导出当前明细',
|
||||
@@ -1446,6 +1499,40 @@ export function Mileage({
|
||||
</Button>
|
||||
)}
|
||||
/>
|
||||
<section className="vp-mileage-customer-workbench" aria-label="客户里程统计工作台">
|
||||
<div className="vp-mileage-customer-workbench-main">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户里程统计工作台</Tag>
|
||||
<Tag color={mileageDeliveryColor}>{mileageDeliveryState}</Tag>
|
||||
<Tag color={publishAuditColor}>{publishAuditConclusion}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>
|
||||
统计页先回答客户这段时间跑了多少、每日是否闭合、异常在哪里、能否导出。
|
||||
</Typography.Title>
|
||||
<div className="vp-mileage-customer-workbench-meta">
|
||||
<span>车辆范围:{currentVehicleKeyword || '全部车辆'}</span>
|
||||
<span>时间范围:{mileageRangeText}</span>
|
||||
<span>来源证据只用于统计可信度:{currentProtocol || '全部数据通道'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-mileage-customer-workbench-grid">
|
||||
{mileageCustomerWorkbenchItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-mileage-customer-workbench-item"
|
||||
disabled={item.disabled}
|
||||
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-mileage-reconciliation-desk" aria-label="客户里程对账台">
|
||||
<div className="vp-mileage-reconciliation-summary">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user