feat(platform): add mileage delivery console

This commit is contained in:
lingniu
2026-07-05 17:48:18 +08:00
parent 67fe8567ef
commit 493834b834
3 changed files with 179 additions and 0 deletions

View File

@@ -1163,6 +1163,58 @@ export function Mileage({
'在线统计运营态势'
);
};
const mileageDeliveryConsoleItems = [
{
label: '交付状态',
value: mileageDeliveryState,
detail: mileageDeliveryState === '可交付'
? '可进入客户查询、BI发布和运营日报。'
: mileageDeliveryState === '暂缓交付'
? '存在阻断项,先完成闭合和异常复核。'
: '复核闭合、覆盖、异常或在线影响后再交付。',
color: mileageDeliveryColor,
action: '复制交付',
onClick: copyMileageDeliveryPackage
},
{
label: '区间里程',
value: `${formatKm(summary.totalMileageKm)} km`,
detail: `范围 ${mileageRangeText},统计车辆 ${summary.vehicleCount.toLocaleString()} 辆。`,
color: 'blue' as const,
action: '复制摘要',
onClick: copyStatisticsSummary
},
{
label: '闭合校验',
value: closureStatus,
detail: closureDeltaKm == null ? '当前页未覆盖全量记录,发布前需要导出或缩小范围。' : `闭合差值 ${formatKm(Math.abs(closureDeltaKm))} km。`,
color: closureStatusColor,
action: '发布审计',
onClick: copyPublishAudit
},
{
label: '异常复核',
value: `${anomalyRows.length.toLocaleString()}`,
detail: anomalyRows[0] ? `${anomalyRows[0].plate || anomalyRows[0].vin} / ${anomalyRows[0].date} 需要复核。` : '当前明细没有异常标记。',
color: anomalyRows.length > 0 ? 'orange' as const : 'green' as const,
action: '轨迹复核',
onClick: () => {
if (anomalyRows[0]) {
openMileageEvidence(anomalyRows[0]);
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: '导出明细',
onClick: exportMileage
}
];
const mileageServiceTasks = [
{
title: '发布判断',
@@ -1327,6 +1379,33 @@ export function Mileage({
</Button>
)}
/>
<section className="vp-mileage-delivery-console" aria-label="客户里程交付台">
<div className="vp-mileage-delivery-console-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color={mileageDeliveryColor}>{mileageDeliveryState}</Tag>
<Tag color={closureStatusColor}>{closureStatus}</Tag>
</Space>
<strong></strong>
<span> CSV </span>
</div>
<div className="vp-mileage-delivery-console-grid">
{mileageDeliveryConsoleItems.map((item) => (
<button
key={item.label}
type="button"
className="vp-mileage-delivery-console-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>
<div className="vp-scope-bar">
<span className="vp-scope-label">{currentVehicleKeyword || '-'}</span>
<Tag color={currentProtocol ? 'blue' : 'green'}>{currentProtocol || '全部数据通道'}</Tag>