feat(platform): summarize vehicle service status

This commit is contained in:
lingniu
2026-07-04 01:47:24 +08:00
parent 8e800f795c
commit aa3b39f5e3
7 changed files with 156 additions and 0 deletions

View File

@@ -489,6 +489,14 @@ test('shows selected source scope on vehicle detail', async () => {
{ protocol: 'GB32960', online: false, lastSeen: '2026-07-03 20:11:10', hasRealtime: true, hasHistory: true, hasRaw: true, hasMileage: true },
{ protocol: 'JT808', online: true, lastSeen: '2026-07-03 20:12:10', hasRealtime: true, hasHistory: true, hasRaw: true, hasMileage: true }
],
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
detail: '1/2 个来源在线,车辆服务可用但需要关注离线来源。',
sourceCount: 2,
onlineSourceCount: 1
},
realtime: [],
history: { items: [], total: 0, limit: 20, offset: 0 },
raw: { items: [], total: 0, limit: 10, offset: 0 },
@@ -516,5 +524,7 @@ test('shows selected source scope on vehicle detail', async () => {
expect(await screen.findByText('当前查看范围')).toBeInTheDocument();
expect(screen.getByText('单一来源JT808')).toBeInTheDocument();
expect(screen.getByText('车辆服务状态')).toBeInTheDocument();
expect(screen.getByText('部分来源离线')).toBeInTheDocument();
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/vehicle-service?keyword=VIN001&protocol=JT808'), undefined);
});