feat(platform): add online vehicle statistics detail
This commit is contained in:
@@ -6729,6 +6729,48 @@ test('shows vehicle-first statistics domains for one vehicle service', async ()
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/statistics/online-vehicles')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
items: [
|
||||
{
|
||||
vin: 'VIN-STATS-SERVICE',
|
||||
plate: '粤A统计服务1',
|
||||
phone: '13307795425',
|
||||
oem: 'G7s',
|
||||
protocols: ['JT808', 'GB32960'],
|
||||
online: true,
|
||||
lastSeen: '2026-07-03 20:12:10',
|
||||
offlineDurationMinutes: 0,
|
||||
sourceCount: 2,
|
||||
onlineSourceCount: 2,
|
||||
bindingStatus: 'bound'
|
||||
},
|
||||
{
|
||||
vin: 'VIN-STATS-SERVICE-OFFLINE',
|
||||
plate: '粤A离线1',
|
||||
phone: '13307795426',
|
||||
oem: '广安车联',
|
||||
protocols: ['JT808'],
|
||||
online: false,
|
||||
lastSeen: '2026-07-03 18:12:10',
|
||||
offlineDurationMinutes: 120,
|
||||
sourceCount: 1,
|
||||
onlineSourceCount: 0,
|
||||
bindingStatus: 'bound'
|
||||
}
|
||||
],
|
||||
total: 2,
|
||||
limit: 10,
|
||||
offset: 0
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
@@ -6750,9 +6792,13 @@ test('shows vehicle-first statistics domains for one vehicle service', async ()
|
||||
expect(screen.getByText('当前统计证据')).toBeInTheDocument();
|
||||
expect(screen.getByText('3 车 / 2 来源 / 3 条明细')).toBeInTheDocument();
|
||||
expect(await screen.findByText('75%')).toBeInTheDocument();
|
||||
expect(screen.getByText((content) => content.includes('离线 1 车'))).toBeInTheDocument();
|
||||
expect(screen.getAllByText((content) => content.includes('离线 1 车')).length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText((content) => content.includes('Redis 在线 92 key'))).toBeInTheDocument();
|
||||
expect(screen.getByText((content) => content.includes('由车辆服务覆盖汇总、实时来源状态和 Redis 在线 key 计算'))).toBeInTheDocument();
|
||||
expect(await screen.findByText('在线状态明细')).toBeInTheDocument();
|
||||
expect(await screen.findByText('VIN-STATS-SERVICE-OFFLINE')).toBeInTheDocument();
|
||||
expect(screen.getByText('粤A离线1')).toBeInTheDocument();
|
||||
expect(screen.getByText('2 小时')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('copies mileage statistics summary for operations reporting', async () => {
|
||||
|
||||
Reference in New Issue
Block a user