feat(platform): refine realtime vehicle monitoring copy

This commit is contained in:
lingniu
2026-07-05 12:05:43 +08:00
parent cc3e90e0e9
commit 0e86d45288
2 changed files with 33 additions and 33 deletions

View File

@@ -9060,14 +9060,14 @@ test('frames realtime page as one vehicle service with source evidence', async (
render(<App />);
expect(await screen.findByRole('heading', { name: '实时监控' })).toBeInTheDocument();
expect(screen.getByText('高德地图待配置')).toBeInTheDocument();
expect(screen.getAllByText('高德地图待配置').length).toBeGreaterThan(0);
expect(screen.getByText('客户实时监控')).toBeInTheDocument();
expect(screen.getByText('从实时列表直接完成车辆监控闭环')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 只看在线 在线车辆' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 地图态势 查看地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 异常优先 关注车辆' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 单车复盘 轨迹回放' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 数据交付 导出 CSV' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时监控路径 查询导出 导出 CSV' })).toBeInTheDocument();
expect(screen.getAllByText('定位有效').length).toBeGreaterThan(0);
expect(screen.getByText('车辆核心数据')).toBeInTheDocument();
expect(screen.getByText('实时通道')).toBeInTheDocument();
@@ -9226,8 +9226,8 @@ test('shows realtime freshness status for recently updated and stale vehicles',
expect(screen.getAllByText('数据新鲜').length).toBeGreaterThan(0);
expect(screen.getAllByText('更新超时').length).toBeGreaterThan(0);
expect(screen.getByText('地图客户决策')).toBeInTheDocument();
expect(screen.getByText('先判断车辆是否在线、是否有位置、是否有异常,再进入单车轨迹和数据交付。')).toBeInTheDocument();
expect(screen.getByText('地图页面向客户展示车辆服务状态,协议来源只作为定位、在线和异常追溯据。')).toBeInTheDocument();
expect(screen.getByText('先判断车辆是否在线、是否有位置、是否有异常,再进入单车轨迹和历史查询。')).toBeInTheDocument();
expect(screen.getByText('地图页面向客户展示车辆服务状态,数据通道只作为定位、在线和异常追溯据。')).toBeInTheDocument();
expect(screen.getByText('先看在线')).toBeInTheDocument();
expect(screen.getByText('再看定位')).toBeInTheDocument();
expect(screen.getByText('优先异常')).toBeInTheDocument();
@@ -9239,11 +9239,11 @@ test('shows realtime freshness status for recently updated and stale vehicles',
expect(screen.getByText('实时盯车')).toBeInTheDocument();
expect(screen.getByText('异常优先')).toBeInTheDocument();
expect(screen.getAllByText('轨迹复盘').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('数据交付').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('查询导出').length).toBeGreaterThanOrEqual(1);
expect(screen.getByRole('button', { name: '地图监控任务 实时盯车 只看在线' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '地图监控任务 异常优先 关注车辆' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '地图监控任务 轨迹复盘 轨迹回放' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '地图监控任务 数据交付 导出当前页' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '地图监控任务 查询导出 导出当前页' })).toBeInTheDocument();
expect(screen.getByText('客户地图监控包')).toBeInTheDocument();
expect(screen.getByText('面向客户看图时,先确认车辆范围、在线态势、定位态势和选中车辆,再进入轨迹、里程、历史数据或告警通知。')).toBeInTheDocument();
expect(screen.getByText('车辆范围')).toBeInTheDocument();
@@ -9492,9 +9492,9 @@ test('copies realtime operations summary from realtime page', async () => {
expect(screen.getByText('建议处置')).toBeInTheDocument();
expect(screen.getByText('查看需关注车辆 2')).toBeInTheDocument();
expect(screen.getByText('车辆覆盖概览')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '筛选证据来源 GB32960' })).toHaveTextContent('GB32960');
expect(screen.getByRole('button', { name: '筛选证据来源 JT808' })).toHaveTextContent('2 辆');
expect(screen.getByRole('button', { name: '筛选证据来源 YUTONG_MQTT' })).toHaveTextContent('超时 1');
expect(screen.getByRole('button', { name: '筛选数据通道 GB32960' })).toHaveTextContent('GB32960');
expect(screen.getByRole('button', { name: '筛选数据通道 JT808' })).toHaveTextContent('2 辆');
expect(screen.getByRole('button', { name: '筛选数据通道 YUTONG_MQTT' })).toHaveTextContent('超时 1');
expect(screen.getByText('实时覆盖判读')).toBeInTheDocument();
expect(screen.getByText('在线率')).toBeInTheDocument();
expect(screen.getAllByText('66.7%').length).toBeGreaterThanOrEqual(3);
@@ -9505,17 +9505,17 @@ test('copies realtime operations summary from realtime page', async () => {
fireEvent.click(screen.getByRole('button', { name: '复制实时摘要' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【实时监控摘要】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选:证据来源JT808在线在线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选:数据通道JT808在线在线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆总数3当前页3'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线车辆2定位有效2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('需要关注2据通道3'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('需要关注2据通道3'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('地图配置:已配置'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('重点车辆:'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('粤A摘要3 / YUTONG_MQTT / 车辆离线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时页面http://localhost:3000/#/realtime?protocol=JT808&online=online'));
fireEvent.click(screen.getByRole('button', { name: '复制实时异常处置清单' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【实时异常处置清单】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选:证据来源JT808在线在线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选:数据通道JT808在线在线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常车辆3 / 当前页 3 / 总计 3'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('粤A摘要3 / VIN-RT-SUMMARY-003 / JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('状态:车辆离线;在线:离线;问题:'));
@@ -9536,7 +9536,7 @@ test('copies realtime operations summary from realtime page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('原始记录http://localhost:3000/api/history/raw-frames?protocol=JT808&vin=VIN-RT-SUMMARY-003&limit=20&includeFields=true'));
fireEvent.click(screen.getByRole('button', { name: '实时筛选 需要关注 2' }));
expect(window.location.hash).toBe('#/realtime?protocol=JT808&serviceStatus=degraded&online=online');
fireEvent.click(screen.getByRole('button', { name: '筛选证据来源 GB32960' }));
fireEvent.click(screen.getByRole('button', { name: '筛选数据通道 GB32960' }));
expect(window.location.hash).toBe('#/realtime?protocol=GB32960&serviceStatus=degraded&online=online');
});
@@ -10319,7 +10319,7 @@ test('shows and clears current realtime service filters', async () => {
expect(await screen.findByText('当前实时筛选')).toBeInTheDocument();
expect(screen.getByText('关键词粤ART002')).toBeInTheDocument();
expect(screen.getByText('证据来源JT808')).toBeInTheDocument();
expect(screen.getByText('数据通道JT808')).toBeInTheDocument();
expect(screen.getByText('在线:在线')).toBeInTheDocument();
expect(screen.getByText('服务状态:来源不完整')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '清空筛选' }));
@@ -10358,7 +10358,7 @@ test('updates realtime hash when source filters are submitted', async () => {
await screen.findByRole('heading', { name: '实时监控' });
fireEvent.change(screen.getByPlaceholderText('VIN / 车牌 / 手机号 / OEM'), { target: { value: '粤ART002' } });
fireEvent.click(screen.getByText('全部证据来源'));
fireEvent.click(screen.getByText('全部数据通道'));
fireEvent.click(await screen.findByText('JT808'));
fireEvent.click(screen.getByRole('button', { name: '查询' }));