feat(platform): guide mileage anomaly handling
This commit is contained in:
@@ -32,6 +32,21 @@ function canOpenVehicle(vin?: string) {
|
||||
return Boolean(value && value !== 'unknown');
|
||||
}
|
||||
|
||||
function mileageActionRecommendation(row: DailyMileageRow) {
|
||||
if (row.anomalySeverity) {
|
||||
return {
|
||||
label: '核对里程来源',
|
||||
color: 'orange' as const,
|
||||
detail: '日里程异常,优先核对当天首末总里程、来源断链和补传数据。'
|
||||
};
|
||||
}
|
||||
return {
|
||||
label: '可用于日报统计',
|
||||
color: 'green' as const,
|
||||
detail: '该日里程未发现异常,可进入车辆服务查看来源证据。'
|
||||
};
|
||||
}
|
||||
|
||||
function mergeInitialFilters(initialVin: string, initialProtocol?: string, initialFilters: Record<string, string> = {}) {
|
||||
return {
|
||||
keyword: initialVin,
|
||||
@@ -188,6 +203,19 @@ export function Mileage({
|
||||
{ title: '日里程', dataIndex: 'dailyMileageKm' },
|
||||
{ title: '来源', dataIndex: 'source' },
|
||||
{ title: '异常', render: (_: unknown, row: DailyMileageRow) => row.anomalySeverity ? <Tag color="orange">{row.anomalySeverity}</Tag> : <Tag color="green">正常</Tag> },
|
||||
{
|
||||
title: '处置建议',
|
||||
width: 260,
|
||||
render: (_: unknown, row: DailyMileageRow) => {
|
||||
const action = mileageActionRecommendation(row);
|
||||
return (
|
||||
<div>
|
||||
<Tag color={action.color}>{action.label}</Tag>
|
||||
<div style={{ marginTop: 6 }}>{action.detail}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 110,
|
||||
|
||||
Reference in New Issue
Block a user