feat(platform): add online statistics operations board

This commit is contained in:
lingniu
2026-07-04 22:59:48 +08:00
parent c0f5ec186e
commit f65b035be7
3 changed files with 195 additions and 1 deletions

View File

@@ -7443,6 +7443,13 @@ test('shows vehicle-first statistics domains for one vehicle service', async ()
expect(screen.getByText('闭合影响')).toBeInTheDocument();
expect(screen.getByText('异常影响')).toBeInTheDocument();
expect(screen.getAllByText('发布判断').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('在线统计运营态势')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '复制在线态势' })).toBeInTheDocument();
expect(screen.getByText('离线车辆')).toBeInTheDocument();
expect(screen.getByText('协议覆盖')).toBeInTheDocument();
expect(screen.getByText('当前页离线')).toBeInTheDocument();
expect(screen.getByText('最长离线')).toBeInTheDocument();
expect(screen.getByText('统计证据')).toBeInTheDocument();
expect(await screen.findByText('75%')).toBeInTheDocument();
expect(screen.getAllByText((content) => content.includes('离线 1 车')).length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText((content) => content.includes('Redis 在线 92 key')).length).toBeGreaterThanOrEqual(1);
@@ -7457,10 +7464,20 @@ test('shows vehicle-first statistics domains for one vehicle service', async ()
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线状态3 在线 / 1 离线 / 在线率 75%'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('发布判断:复核后发布'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('业务影响当前统计范围需要先复核轨迹、RAW和离线车辆影响'));
fireEvent.click(screen.getByRole('button', { name: '复制在线态势' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【在线统计运营态势】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆范围VIN-STATS-SERVICE'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('数据来源JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线概览3 在线 / 1 离线 / 在线率 75%'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('Redis 在线 Key92'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前页车辆2 / 当前筛选 2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('最长离线粤A离线1 / 2 小时 / 2026-07-03 18:12:10'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. JT8082/3在线率 66.7%'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 离线车辆优先打开车辆服务核对实时、轨迹、RAW 和告警证据'));
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();
expect(screen.getAllByText('2 小时').length).toBeGreaterThan(0);
fireEvent.click(screen.getByRole('button', { name: '复制在线状态清单' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆在线状态交接】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆范围VIN-STATS-SERVICE'));