feat(platform): add customer mileage query board
This commit is contained in:
@@ -843,6 +843,61 @@ export function Mileage({
|
||||
action: () => onOpenVehicle(currentVehicleKeyword, currentProtocol)
|
||||
}
|
||||
];
|
||||
const mileageCustomerQuerySteps = [
|
||||
{
|
||||
step: '01',
|
||||
title: '选择范围',
|
||||
value: currentVehicleKeyword || '全部车辆',
|
||||
detail: `时间范围 ${mileageRangeText},来源 ${currentProtocol || '全部来源'}。`,
|
||||
action: '调整筛选',
|
||||
color: currentVehicleKeyword ? 'green' as const : 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: () => {
|
||||
const input = document.querySelector<HTMLInputElement>('input[name="keyword"]');
|
||||
input?.focus();
|
||||
}
|
||||
},
|
||||
{
|
||||
step: '02',
|
||||
title: '区间里程',
|
||||
value: `${formatKm(summary.totalMileageKm)} km`,
|
||||
detail: `${summary.vehicleCount.toLocaleString()} 辆车,${summary.recordCount.toLocaleString()} 条日里程记录。`,
|
||||
action: '复制摘要',
|
||||
color: 'blue' as const,
|
||||
disabled: false,
|
||||
onClick: () => copyStatisticsSummary()
|
||||
},
|
||||
{
|
||||
step: '03',
|
||||
title: '发布判断',
|
||||
value: publishAuditConclusion,
|
||||
detail: `闭合 ${closureStatus},覆盖 ${formatPercent(pageCoverageRate)}。`,
|
||||
action: '发布审计',
|
||||
color: publishAuditColor,
|
||||
disabled: false,
|
||||
onClick: () => copyPublishAudit()
|
||||
},
|
||||
{
|
||||
step: '04',
|
||||
title: '复核证据',
|
||||
value: anomalyRows.length > 0 ? `${anomalyRows.length.toLocaleString()} 异常` : '轨迹/RAW',
|
||||
detail: anomalyRows.length > 0 ? '异常日优先回看轨迹和原始记录。' : '可从同一时间窗进入轨迹和RAW证据。',
|
||||
action: '轨迹复核',
|
||||
color: anomalyRows.length > 0 ? 'orange' as const : 'green' as const,
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
onClick: () => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' })
|
||||
},
|
||||
{
|
||||
step: '05',
|
||||
title: '数据交付',
|
||||
value: `${rows.length.toLocaleString()} 当前页`,
|
||||
detail: '导出明细并附带统计口径,支撑BI、客户复盘和运营日报。',
|
||||
action: '导出明细',
|
||||
color: rows.length > 0 ? 'blue' as const : 'grey' as const,
|
||||
disabled: rows.length === 0,
|
||||
onClick: () => exportMileage()
|
||||
}
|
||||
];
|
||||
|
||||
const loadSummary = (values: Record<string, string> = filters) => {
|
||||
setSummaryLoading(true);
|
||||
@@ -1145,6 +1200,43 @@ export function Mileage({
|
||||
<Tag color={currentProtocol ? 'blue' : 'green'}>当前来源:{currentProtocol || '全部来源'}</Tag>
|
||||
<Typography.Text type="tertiary">里程统计按当前车辆与来源范围汇总。</Typography.Text>
|
||||
</div>
|
||||
<Card bordered className="vp-mileage-customer-query-board" bodyStyle={{ padding: 0 }}>
|
||||
<div className="vp-mileage-customer-query-summary">
|
||||
<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">
|
||||
统计查询从车辆服务出发:选择车辆或车队、设定时间窗、判断区间里程和发布状态,再进入轨迹、RAW 和导出明细。
|
||||
</Typography.Text>
|
||||
<Space wrap>
|
||||
<Button size="small" theme="solid" type="primary" onClick={copyStatisticsSummary}>复制统计摘要</Button>
|
||||
<Button size="small" theme="light" type="primary" onClick={copyMileageDecision}>复制决策说明</Button>
|
||||
<Button size="small" disabled={!currentVehicleKeyword || !onOpenHistory} onClick={() => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' })}>轨迹复核</Button>
|
||||
<Button size="small" disabled={rows.length === 0} onClick={exportMileage}>导出明细</Button>
|
||||
</Space>
|
||||
</div>
|
||||
<div className="vp-mileage-customer-query-steps">
|
||||
{mileageCustomerQuerySteps.map((item) => (
|
||||
<button
|
||||
key={item.step}
|
||||
type="button"
|
||||
className="vp-mileage-customer-query-step"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户统计查询 ${item.title} ${item.action}`}
|
||||
>
|
||||
<span>{item.step}</span>
|
||||
<Tag color={item.color}>{item.title}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<small>{item.detail}</small>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="车辆统计服务总览" style={{ marginTop: 16 }}>
|
||||
<div className="vp-table-toolbar">
|
||||
<Space wrap>
|
||||
|
||||
Reference in New Issue
Block a user