feat(platform): reshape history delivery around customer workflows

This commit is contained in:
lingniu
2026-07-05 15:35:08 +08:00
parent d74e52de2e
commit 1f74ad063c
2 changed files with 113 additions and 113 deletions

View File

@@ -5479,22 +5479,22 @@ test('copies trajectory playback summary from history page', async () => {
expect((await screen.findAllByText('VIN-HISTORY-SUMMARY')).length).toBeGreaterThan(0);
expect(screen.getByText('轨迹回放工作台')).toBeInTheDocument();
expect(screen.getByText('按车辆和时间窗复盘每一段行程')).toBeInTheDocument();
expect(screen.getByText('客户需要看到路线、起止时间、里程变化、速度异常和可导出的证据。历史明细和字段只作为轨迹复盘的依据。')).toBeInTheDocument();
expect(screen.getByText('客户需要看到路线、起止时间、里程变化、速度异常和可导出的证据。明细证据和字段裁剪只作为轨迹复盘的依据。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '轨迹回放指标 轨迹点 2' })).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();
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.getByRole('button', { name: '客户轨迹决策 明细复核 明细证据' })).toBeInTheDocument();
fireEvent.click(screen.getAllByRole('button', { name: /复制决策说明/ })[0]);
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户轨迹决策说明】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('决策结论:可复盘,需附异常说明'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('客户复盘路径:'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('4. 最后回到依据:异常点必须打开历史明细、字段明细和统计查询复核。'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('4. 最后回到依据:异常点必须打开明细证据、字段裁剪和统计查询复核。'));
fireEvent.click(screen.getByRole('button', { name: /复制轨迹摘要/ }));
@@ -5513,12 +5513,12 @@ test('copies trajectory playback summary from history page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【数据复核包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('位置记录2有效定位2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史明细1字段明细2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('明细证据1字段裁剪2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常:断点 1 / 里程回退 0 / 超速 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放http://localhost:3000/#/history?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史位置http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=location&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史明细http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('字段明细http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=fields&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('明细证据http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('字段裁剪http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=fields&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('统计查询http://localhost:3000/#/mileage?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-HISTORY-SUMMARY&protocol=JT808'));
@@ -5528,25 +5528,25 @@ test('copies trajectory playback summary from history page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('数据通道JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('业务状态:需要复核'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹范围:位置 2 / 有效定位 2 / 历史明细 1 / 字段明细 2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹范围:位置 2 / 有效定位 2 / 明细证据 1 / 字段裁剪 2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('定位覆盖率100%'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('回放跨度60 分钟采样间隔60 分钟/点'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常影响:断点 1 / 里程回退 0 / 超速 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('地图能力:高德 JS API 待配置'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史查询导出http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=location&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史明细http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('明细证据http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
fireEvent.click(screen.getByRole('button', { name: /复制轨迹复盘包/ }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【轨迹复盘交接包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹规模:位置 2 / 有效定位 2 / 历史明细 1 / 字段明细 2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹规模:位置 2 / 有效定位 2 / 明细证据 1 / 字段裁剪 2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹质量:定位覆盖率 100% / 回放跨度 60 分钟 / 采样间隔 60 分钟/点'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程速度:区间里程 22.6 km / 最高速度 58.8 km/h'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前回放点:点 1/22026-07-03 10:00:0012.5 km/h1,000 km'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常判读:断点 1 / 里程回退 0 / 超速 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('下一步:建议核对历史明细、字段明细、当日统计查询,并确认平台是否存在断链或补发。'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史明细http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('下一步:建议核对明细证据、字段裁剪、当日统计查询,并确认平台是否存在断链或补发。'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('明细证据http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
});
test('opens same-day mileage statistics from quality issue row', async () => {
@@ -6522,50 +6522,50 @@ test('shows parsed field history as a flattened evidence table', async () => {
render(<App />);
expect(await screen.findByRole('heading', { name: '历史查询导出' })).toBeInTheDocument();
expect(screen.getByText('客户数据交付中心')).toBeInTheDocument();
expect(screen.getByText('客户数据交付')).toBeInTheDocument();
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.getByText('面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付位置历史、历史明细、字段明细、CSV 文件、轨迹复盘和统计查询。')).toBeInTheDocument();
expect(screen.getByText('面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付轨迹报告、位置历史、明细证据、字段裁剪、CSV 文件和统计查询。')).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: '客户数据交付中心 交付说明 复制交付' })).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: '客户数据交付 交付说明 复制交付' })).toBeInTheDocument();
expect(screen.getByText('报表交付模板')).toBeInTheDocument();
expect(screen.getByText('按客户问题选择导出模板')).toBeInTheDocument();
expect(screen.getByText('车队报表不只是下载 CSV先选择用途再生成轨迹报告、历史明细包、字段裁剪包或周期交付计划。')).toBeInTheDocument();
expect(screen.getByText('车队报表不只是下载 CSV先选择用途再生成轨迹报告、明细证据包、字段裁剪包或周期交付计划。')).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: '报表交付模板 周期交付计划 复制计划' })).toBeInTheDocument();
expect(screen.getByText('客户轨迹决策台')).toBeInTheDocument();
expect(screen.getAllByRole('button', { name: /复制决策说明/ }).length).toBeGreaterThanOrEqual(1);
expect(screen.getByRole('button', { name: '客户轨迹决策 明细复核 历史明细' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户轨迹决策 明细复核 明细证据' })).toBeInTheDocument();
expect(screen.getByText('客户查询导出包')).toBeInTheDocument();
expect(screen.getByText('面向客户交付时,先确认车辆、时间、交付物和质量提示,再导出位置、历史明细或字段明细,避免把内部排查过程直接暴露给客户。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户查询导出 历史明细 导出明细' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户查询导出 字段明细 字段明细' })).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.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: '客户交付清单 字段明细 字段明细' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户交付清单 明细证据 导出证据' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户交付清单 字段裁剪 字段配置' })).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('交付物:轨迹报告 / 位置历史 / 统计查询 / 明细证据 / 字段裁剪 / 质量提示'));
});
fireEvent.click(screen.getByRole('button', { name: '报表交付模板 周期交付计划 复制计划' }));
await waitFor(() => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【历史数据周期交付计划】'));
});
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('推荐频率:日报用于运营复盘,周报用于客户对账,临时导出用于问题解释。'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付内容:轨迹报告 / 位置历史 CSV / 历史明细 CSV / 字段明细 CSV / 统计查询链接 / 质量提示。'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付内容:轨迹报告 / 位置历史 CSV / 明细证据 CSV / 字段裁剪 CSV / 统计查询链接 / 质量提示。'));
expect(await screen.findByRole('tab', { name: '字段明细' })).toHaveAttribute('aria-selected', 'true');
expect(fetchMock).toHaveBeenCalledWith('/api/history/raw-frames/query', expect.objectContaining({
method: 'POST',
@@ -6837,7 +6837,7 @@ test('flags trajectory playback anomalies for gap mileage and speed review', asy
expect(screen.getByText('2 km')).toBeInTheDocument();
expect(screen.getByText('速度异常')).toBeInTheDocument();
expect(screen.getAllByText('132 km/h').length).toBeGreaterThan(0);
expect(screen.getByText('建议核对历史明细和当日统计查询')).toBeInTheDocument();
expect(screen.getByText('建议核对明细证据和当日统计查询')).toBeInTheDocument();
});
test('opens amap route from trajectory playback workspace', async () => {