feat(platform): add mileage conclusion strip
This commit is contained in:
@@ -891,6 +891,67 @@ export function Mileage({
|
||||
onClick: () => copyOnlineOperationsReport()
|
||||
}
|
||||
];
|
||||
const mileageConclusionItems = [
|
||||
{
|
||||
label: '区间累计',
|
||||
value: `${formatKm(summary.totalMileageKm)} km`,
|
||||
detail: `${summary.vehicleCount.toLocaleString()} 辆车,${mileageRangeText}`,
|
||||
color: 'blue' as const,
|
||||
onClick: () => copyStatisticsSummary()
|
||||
},
|
||||
{
|
||||
label: '明细合计',
|
||||
displayLabel: '当前明细',
|
||||
value: `${formatKm(pageMileageTotal)} km`,
|
||||
detail: `${rows.length.toLocaleString()} 条当前页明细,覆盖 ${formatPercent(pageCoverageRate)}`,
|
||||
color: pageCoverageRate >= 100 ? 'green' as const : 'orange' as const,
|
||||
onClick: () => exportMileage()
|
||||
},
|
||||
{
|
||||
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,
|
||||
onClick: () => anomalyRows[0] ? copyMileageEvidence(anomalyRows[0]) : copyMileageDecision()
|
||||
},
|
||||
{
|
||||
label: '在线影响',
|
||||
value: `${offlineVehicleCount.toLocaleString()} 离线`,
|
||||
detail: `${onlineVehicleCount.toLocaleString()} 在线,在线率 ${formatPercent(onlineRatePercent)}`,
|
||||
color: offlineVehicleCount > 0 ? 'orange' as const : 'green' as const,
|
||||
onClick: () => copyOnlineOperationsReport()
|
||||
}
|
||||
];
|
||||
const mileageConclusionActions = [
|
||||
{
|
||||
label: '复制结论',
|
||||
action: '复制摘要',
|
||||
color: 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: () => copyMileageDeliveryPackage()
|
||||
},
|
||||
{
|
||||
label: '轨迹复核',
|
||||
action: '轨迹回放',
|
||||
color: currentVehicleKeyword ? 'blue' as const : 'grey' as const,
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' })
|
||||
},
|
||||
{
|
||||
label: '导出明细',
|
||||
action: '导出CSV',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: rows.length === 0,
|
||||
onClick: () => exportMileage()
|
||||
},
|
||||
{
|
||||
label: '告警通知',
|
||||
action: '在线态势',
|
||||
color: offlineVehicleCount > 0 ? 'orange' as const : 'green' as const,
|
||||
disabled: false,
|
||||
onClick: () => copyOnlineOperationsReport()
|
||||
}
|
||||
];
|
||||
const mileageCustomerActions = [
|
||||
{
|
||||
label: '导出当前明细',
|
||||
@@ -1549,6 +1610,51 @@ export function Mileage({
|
||||
</Button>
|
||||
)}
|
||||
/>
|
||||
<section className="vp-mileage-conclusion-strip" aria-label="客户里程结论条">
|
||||
<div className="vp-mileage-conclusion-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">客户里程结论条</Tag>
|
||||
<Tag color={mileageDeliveryColor}>{mileageDeliveryState}</Tag>
|
||||
<Tag color={closureStatusColor}>{closureStatus}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>
|
||||
先给客户一个可交付结论,再进入轨迹复核、明细导出和告警通知。
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
当前范围:{currentVehicleKeyword || '全部车辆'} / {mileageRangeText},数据源只作为证据,不作为客户操作入口。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-mileage-conclusion-metrics">
|
||||
{mileageConclusionItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-mileage-conclusion-metric"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户里程结论 ${item.label} ${item.value}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.displayLabel ?? item.label}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="vp-mileage-conclusion-actions">
|
||||
{mileageConclusionActions.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-mileage-conclusion-action"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户里程动作 ${item.label} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<span>{item.action}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<section className="vp-mileage-customer-workbench" aria-label="客户里程统计工作台">
|
||||
<div className="vp-mileage-customer-workbench-main">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user