feat(platform): add mileage service task board
This commit is contained in:
@@ -848,6 +848,56 @@ export function Mileage({
|
||||
'在线统计运营态势'
|
||||
);
|
||||
};
|
||||
const mileageServiceTasks = [
|
||||
{
|
||||
title: '发布判断',
|
||||
value: publishAuditConclusion,
|
||||
detail: publishAuditConclusion === '可发布' ? '当前统计范围可进入运营日报或 BI 口径。' : '发布前需要补齐闭合、覆盖、异常或在线证据。',
|
||||
color: publishAuditColor,
|
||||
primaryAction: 'BI口径',
|
||||
secondaryAction: '发布审计',
|
||||
disabled: false,
|
||||
secondaryDisabled: false,
|
||||
onPrimary: copyBIPublishText,
|
||||
onSecondary: copyPublishAudit
|
||||
},
|
||||
{
|
||||
title: '区间复核',
|
||||
value: closureStatus,
|
||||
detail: `范围 ${mileageRangeText},${closureActionText}`,
|
||||
color: closureStatusColor,
|
||||
primaryAction: '轨迹证据',
|
||||
secondaryAction: 'RAW证据',
|
||||
disabled: !currentVehicleKeyword || !onOpenHistory,
|
||||
secondaryDisabled: !currentVehicleKeyword || !onOpenRaw,
|
||||
onPrimary: () => onOpenHistory?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '' }),
|
||||
onSecondary: () => onOpenRaw?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, dateFrom: filters.dateFrom ?? '', dateTo: filters.dateTo ?? '', includeFields: 'true' })
|
||||
},
|
||||
{
|
||||
title: '异常处理',
|
||||
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,
|
||||
primaryAction: '复制证据',
|
||||
secondaryAction: '车辆档案',
|
||||
disabled: !anomalyRows[0],
|
||||
secondaryDisabled: !currentVehicleKeyword,
|
||||
onPrimary: () => anomalyRows[0] && copyMileageEvidence(anomalyRows[0]),
|
||||
onSecondary: () => currentVehicleKeyword && onOpenVehicle(currentVehicleKeyword, currentProtocol)
|
||||
},
|
||||
{
|
||||
title: '数据交付',
|
||||
value: `${rows.length.toLocaleString()} 条当前页`,
|
||||
detail: `累计 ${formatKm(summary.totalMileageKm)} km,当前页 ${formatKm(pageMileageTotal)} km。`,
|
||||
color: 'blue' as const,
|
||||
primaryAction: '导出明细',
|
||||
secondaryAction: '统计摘要',
|
||||
disabled: rows.length === 0,
|
||||
secondaryDisabled: false,
|
||||
onPrimary: exportMileage,
|
||||
onSecondary: copyStatisticsSummary
|
||||
}
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
const nextFilters = mergeInitialFilters(initialVin, initialProtocol, initialFilters);
|
||||
@@ -945,6 +995,41 @@ export function Mileage({
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered title="里程服务任务板" style={{ marginTop: 16 }}>
|
||||
<div className="vp-mileage-task-grid">
|
||||
{mileageServiceTasks.map((item) => (
|
||||
<div key={item.title} className="vp-mileage-task-item">
|
||||
<div className="vp-mileage-task-head">
|
||||
<Tag color={item.color}>{item.title}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
</div>
|
||||
<Typography.Text type="secondary">{item.detail}</Typography.Text>
|
||||
<Space wrap>
|
||||
<Button
|
||||
size="small"
|
||||
theme="solid"
|
||||
type="primary"
|
||||
disabled={item.disabled}
|
||||
aria-label={`里程服务任务 ${item.title} ${item.primaryAction}`}
|
||||
onClick={item.onPrimary}
|
||||
>
|
||||
{item.primaryAction}
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
theme="light"
|
||||
type="primary"
|
||||
disabled={item.secondaryDisabled}
|
||||
aria-label={`里程服务任务 ${item.title} ${item.secondaryAction}`}
|
||||
onClick={item.onSecondary}
|
||||
>
|
||||
{item.secondaryAction}
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
<Card bordered>
|
||||
<Form key={JSON.stringify(filters)} initValues={filters} layout="horizontal" onSubmit={(values) => {
|
||||
const nextFilters = values as Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user