feat(platform): add customer time window job command

This commit is contained in:
lingniu
2026-07-06 05:34:33 +08:00
parent 44b3839e83
commit 0cb1763326
2 changed files with 109 additions and 0 deletions

View File

@@ -1662,6 +1662,11 @@ test('dashboard guides customer custom time window service path', async () => {
test('time monitor route exposes a dedicated customer time window workspace', async () => {
window.history.replaceState(null, '', '/#/time-monitor?keyword=%E7%B2%A4A%E6%97%B6%E9%97%B4%E7%AA%97&protocol=JT808&dateFrom=2026-07-01&dateTo=2026-07-03');
const writeText = vi.fn(() => Promise.resolve());
Object.defineProperty(navigator, 'clipboard', {
configurable: true,
value: { writeText }
});
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
const path = String(input);
if (path.includes('/api/ops/health')) {
@@ -1743,6 +1748,21 @@ test('time monitor route exposes a dedicated customer time window workspace', as
expect(screen.getByRole('button', { name: '时间窗监控入口 统计查询 3 天窗口' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗监控入口 历史导出 9,988 帧' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗监控入口 告警复盘 2 告警' })).toBeInTheDocument();
expect(screen.getByText('时间窗复盘 SLA 作业台')).toBeInTheDocument();
expect(screen.getByText('把一个时间窗变成可交付作业:谁处理、多久交付、交付哪些证据、异常如何升级。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗复盘SLA 责任动作 客户复盘 复制作业' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗复盘SLA 交付时限 3 天窗口 轨迹复盘' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗复盘SLA 交付物 轨迹/统计/导出/告警 导出证据' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '时间窗复盘SLA 升级条件 2 告警 告警复盘' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /复制时间窗作业单/ })).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /复制时间窗作业单/ }));
await waitFor(() => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户时间窗复盘作业单】'));
});
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('作业范围粤A时间窗 / JT808 / 2026-07-01 至 2026-07-03'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付SLA3 天窗口内完成轨迹复盘、统计核对、历史导出和告警说明'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付物:轨迹回放链接 / 统计查询链接 / 历史导出链接 / 告警复盘链接'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('升级条件2 告警车辆需要先进入告警复盘'));
});
test('dashboard exposes vehicle data center capability matrix', async () => {