feat(platform): add history evidence package

This commit is contained in:
lingniu
2026-07-04 20:16:58 +08:00
parent bd0b69ddad
commit 09e9cc937d
2 changed files with 115 additions and 7 deletions

View File

@@ -4651,7 +4651,25 @@ test('copies trajectory playback summary from history page', async () => {
return {
ok: true,
json: async () => ({
data: { items: [], total: 0, limit: 10, offset: 0 },
data: {
items: [{
id: 'raw-history-evidence-001',
vin: 'VIN-HISTORY-SUMMARY',
plate: '粤A轨迹1',
protocol: 'JT808',
frameType: '0x0200',
rawSizeBytes: 96,
deviceTime: '2026-07-03 10:00:00',
serverTime: '2026-07-03 10:00:02',
parsedFields: {
'jt808.location.longitude': 113.201,
'jt808.location.total_mileage_km': 1000
}
}],
total: 1,
limit: 10,
offset: 0
},
traceId: 'trace-test',
timestamp: 1783094400000
})
@@ -4681,6 +4699,20 @@ test('copies trajectory playback summary from history page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('最高速度58.8 km/h'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('起点2026-07-03 10:00:00'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('终点2026-07-03 11:00:00'));
fireEvent.click(screen.getAllByRole('button', { name: /复制历史证据包/ })[0]);
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【历史证据包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('位置记录2有效定位2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW帧1解析字段2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常:断点 1 / 里程回退 0 / 超速 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放http://localhost:3000/#/history?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史位置http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=location&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('解析字段http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=fields&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程复核http://localhost:3000/#/mileage?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-HISTORY-SUMMARY&protocol=JT808'));
});
test('opens same-day mileage statistics from quality issue row', async () => {