feat(platform): link raw frames to mileage evidence

This commit is contained in:
lingniu
2026-07-04 12:18:06 +08:00
parent 2991a01738
commit 8dbf91ca25
2 changed files with 116 additions and 2 deletions

View File

@@ -294,6 +294,15 @@ export function History({
...(day ? { dateFrom: day, dateTo: nextDate(day) } : {})
});
};
const openRawMileage = (row: RawFrameRow) => {
if (!canOpenVehicle(row.vin)) return;
const day = dateOnly(row.deviceTime || row.serverTime);
onOpenMileage?.({
keyword: row.vin,
protocol: row.protocol,
...(day ? { dateFrom: day, dateTo: nextDate(day) } : {})
});
};
return (
<div className="vp-page">
@@ -500,10 +509,11 @@ export function History({
{ title: '入库时间', dataIndex: 'serverTime', width: 190 },
{
title: '操作',
width: 200,
width: 280,
render: (_: unknown, row: RawFrameRow) => (
<Space>
<Space wrap>
<Button onClick={() => setSelectedRaw(row)}></Button>
<Button disabled={!canOpenVehicle(row.vin) || !onOpenMileage} onClick={() => openRawMileage(row)}></Button>
<Button disabled={!canOpenVehicle(row.vin)} onClick={() => onOpenVehicle(row.vin, row.protocol)}></Button>
</Space>
)