From e829f143e7ad5d06cf9d1b9d420296df0f66912e Mon Sep 17 00:00:00 2001 From: lingniu Date: Sun, 5 Jul 2026 14:58:14 +0800 Subject: [PATCH] feat(platform): align history exports with statistics query --- .../apps/web/src/pages/History.tsx | 50 +++++++++---------- .../apps/web/src/test/App.test.tsx | 26 +++++----- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/vehicle-data-platform/apps/web/src/pages/History.tsx b/vehicle-data-platform/apps/web/src/pages/History.tsx index 62a3ca10..d7835561 100644 --- a/vehicle-data-platform/apps/web/src/pages/History.tsx +++ b/vehicle-data-platform/apps/web/src/pages/History.tsx @@ -361,7 +361,7 @@ function historyEvidencePackageText({ `历史位置:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'location' } }))}`, `历史明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'raw', includeFields: 'true' } }))}`, `字段明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'fields', includeFields: 'true', ...(filters.fields?.trim() ? { fields: filters.fields.trim() } : {}) } }))}`, - `里程复核:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, + `统计查询:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}` ].join('\n'); } @@ -398,7 +398,7 @@ function deliveryPackageText({ return [ '【客户查询导出包】', `交付状态:${deliveryState}`, - '交付物:位置历史 / 轨迹回放 / 里程复核 / 历史明细 / 字段明细 / 质量提示', + '交付物:位置历史 / 轨迹回放 / 统计查询 / 历史明细 / 字段明细 / 质量提示', `车辆范围:${vehicle || '全部车辆'}`, `数据通道:${protocol || '全部数据通道'}`, `时间范围:${filters.dateFrom?.trim() || '-'} 至 ${filters.dateTo?.trim() || '-'}`, @@ -411,7 +411,7 @@ function deliveryPackageText({ `导出明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'raw', includeFields: 'true' } }))}`, `导出字段:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'fields', includeFields: 'true', ...(filters.fields?.trim() ? { fields: filters.fields.trim() } : {}) } }))}`, `轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, - `里程复核:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, + `统计查询:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}` ].join('\n'); } @@ -443,7 +443,7 @@ function scheduledHistoryReportPlanText({ `数据通道:${protocol || '全部数据通道'}`, `时间范围:${filters.dateFrom?.trim() || '-'} 至 ${filters.dateTo?.trim() || '-'}`, '推荐频率:日报用于运营复盘,周报用于客户对账,临时导出用于问题解释。', - '交付内容:轨迹报告 / 位置历史 CSV / 历史明细 CSV / 字段明细 CSV / 里程复核链接 / 质量提示。', + '交付内容:轨迹报告 / 位置历史 CSV / 历史明细 CSV / 字段明细 CSV / 统计查询链接 / 质量提示。', `当前数据量:位置 ${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()},历史明细 ${rawCount.toLocaleString()} 帧,字段 ${fieldCount.toLocaleString()} 个。`, `质量提示:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`, '交付前检查:先锁定车辆和时间窗,再确认字段裁剪、分页覆盖和异常说明。', @@ -451,7 +451,7 @@ function scheduledHistoryReportPlanText({ `位置历史:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'location' } }))}`, `历史明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'raw', includeFields: 'true' } }))}`, `字段明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'fields', includeFields: 'true', ...(filters.fields?.trim() ? { fields: filters.fields.trim() } : {}) } }))}`, - `里程复核:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}` + `统计查询:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}` ].join('\n'); } @@ -499,7 +499,7 @@ function trajectoryReviewPackageText({ ...(filters.dateTo?.trim() ? { dateTo: filters.dateTo.trim() } : {}) }; const anomalyAction = anomalySummary.gapCount > 0 || anomalySummary.mileageRollbackCount > 0 || anomalySummary.overspeedCount > 0 - ? '建议核对历史明细、字段明细、当日里程统计,并确认平台是否存在断链或补发。' + ? '建议核对历史明细、字段明细、当日统计查询,并确认平台是否存在断链或补发。' : '当前页未发现明显断点、里程回退或速度异常,可作为轨迹复盘依据使用。'; return [ '【轨迹复盘交接包】', @@ -522,7 +522,7 @@ function trajectoryReviewPackageText({ `历史位置:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'location' } }))}`, `历史明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'raw', includeFields: 'true' } }))}`, `字段明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'fields', includeFields: 'true', ...(filters.fields?.trim() ? { fields: filters.fields.trim() } : {}) } }))}`, - `里程复核:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, + `统计查询:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}` ].join('\n'); } @@ -644,12 +644,12 @@ function trajectoryCustomerDecisionText({ '1. 先看轨迹覆盖:确认是否有足够有效坐标。', '2. 再看时间断点:断点会影响定位连续性和客户解释。', '3. 再看里程速度:区间里程、速度和轨迹方向需要能互相解释。', - '4. 最后回到依据:异常点必须打开历史明细、字段明细和里程统计复核。', + '4. 最后回到依据:异常点必须打开历史明细、字段明细和统计查询复核。', `轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `历史查询导出:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'location' } }))}`, `历史明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'raw', includeFields: 'true' } }))}`, `字段明细:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'fields', includeFields: 'true', ...(filters.fields?.trim() ? { fields: filters.fields.trim() } : {}) } }))}`, - `里程复核:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, + `统计查询:${appURL(buildAppHash({ page: 'mileage', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}` ].join('\n'); } @@ -934,9 +934,9 @@ export function History({ { label: '里程速度', value: formatNumber(mileageDelta, ' km'), - detail: `最高速度 ${formatNumber(maxSpeed, ' km/h')},用于和里程统计互相解释。`, + detail: `最高速度 ${formatNumber(maxSpeed, ' km/h')},用于和统计查询互相解释。`, color: isFiniteNumber(mileageDelta) ? 'blue' as const : 'grey' as const, - action: '里程复核', + action: '统计查询', disabled: !onOpenMileage, onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) }) }, @@ -970,11 +970,11 @@ export function History({ onClick: () => openQueryTab('location') }, { - title: '里程复核', + title: '统计查询', value: formatNumber(mileageDelta, ' km'), - detail: '进入里程统计核对区间里程和日统计闭合。', + detail: '进入统计查询核对区间里程和日统计闭合。', color: isFiniteNumber(mileageDelta) ? 'green' as const : 'grey' as const, - action: '里程复核', + action: '统计查询', disabled: !onOpenMileage, onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) }) }, @@ -1340,7 +1340,7 @@ export function History({ 先锁定车辆和时间窗,再选择交付物并导出 - 面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付位置历史、历史明细、字段明细、CSV 文件、轨迹复盘和里程复核。 + 面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付位置历史、历史明细、字段明细、CSV 文件、轨迹复盘和统计查询。 @@ -1518,7 +1518,7 @@ export function History({ {[ { title: '轨迹复盘', value: validLocations.length > 0 ? '可播放' : '待查询', detail: '回放路线、速度和里程断点。', action: '播放轨迹', color: validLocations.length > 0 ? 'green' as const : 'orange' as const, disabled: validLocations.length === 0, onClick: () => openQueryTab('location') }, { title: '历史明细', value: `${(rawFrames.total ?? 0).toLocaleString()} 帧`, detail: '查看轨迹背后的原始接入证据。', action: '查看明细', color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, disabled: false, onClick: () => openQueryTab('raw') }, - { title: '里程复核', value: formatNumber(mileageDelta, ' km'), detail: '进入同一时间窗的里程统计。', action: '核对里程', color: isFiniteNumber(mileageDelta) ? 'green' as const : 'grey' as const, disabled: !onOpenMileage, onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) }) }, + { title: '统计查询', value: formatNumber(mileageDelta, ' km'), detail: '进入同一时间窗的统计查询。', action: '统计复核', color: isFiniteNumber(mileageDelta) ? 'green' as const : 'grey' as const, disabled: !onOpenMileage, onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) }) }, { title: '客户导出', value: deliveryState, detail: '复制交付说明或导出 CSV 证据。', action: '复制交付', color: deliveryStateColor, disabled: false, onClick: copyDeliveryPackage } ].map((item) => ( - +
@@ -1662,7 +1662,7 @@ export function History({ 车辆服务
@@ -1877,12 +1877,12 @@ export function History({ {currentVehicleKeyword || '全部车辆'} - 轨迹、历史查询导出、历史明细和里程复核按同一车辆范围联动,用于调度复盘、客户问询和断链定位。 + 轨迹、历史查询导出、历史明细和统计查询按同一车辆范围联动,用于调度复盘、客户问询和断链定位。 - +
@@ -2116,9 +2116,9 @@ export function History({ ))}
- {hasTrajectoryAnomaly ? '建议核对历史明细和当日里程统计' : '轨迹质量可用'} + {hasTrajectoryAnomaly ? '建议核对历史明细和当日统计查询' : '轨迹质量可用'} - {hasTrajectoryAnomaly ? '异常点会影响轨迹回放、定位复盘和区间里程判断,请结合字段明细与里程统计交叉确认。' : '当前页轨迹未发现明显断点、里程回退或速度异常。'} + {hasTrajectoryAnomaly ? '异常点会影响轨迹回放、定位复盘和区间里程判断,请结合字段明细与统计查询交叉确认。' : '当前页轨迹未发现明显断点、里程回退或速度异常。'}
@@ -2164,7 +2164,7 @@ export function History({ render: (_: unknown, row: HistoryLocationRow) => ( - + ) @@ -2209,7 +2209,7 @@ export function History({ render: (_: unknown, row: RawFrameRow) => ( - + ) diff --git a/vehicle-data-platform/apps/web/src/test/App.test.tsx b/vehicle-data-platform/apps/web/src/test/App.test.tsx index b078298d..7d276ac5 100644 --- a/vehicle-data-platform/apps/web/src/test/App.test.tsx +++ b/vehicle-data-platform/apps/web/src/test/App.test.tsx @@ -5484,17 +5484,17 @@ test('copies trajectory playback summary from history page', async () => { 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: /复制轨迹摘要/ })); @@ -5519,7 +5519,7 @@ test('copies trajectory playback summary from history page', async () => { 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/#/mileage?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04')); + 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')); fireEvent.click(screen.getByRole('button', { name: /复制轨迹影响/ })); @@ -5545,7 +5545,7 @@ test('copies trajectory playback summary from history page', async () => { expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程速度:区间里程 22.6 km / 最高速度 58.8 km/h')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前回放点:点 1/2,2026-07-03 10:00:00,12.5 km/h,1,000 km')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常判读:断点 1 / 里程回退 0 / 超速 0')); - expect(writeText).toHaveBeenCalledWith(expect.stringContaining('下一步:建议核对历史明细、字段明细、当日里程统计,并确认平台是否存在断链或补发。')); + 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')); }); @@ -6527,7 +6527,7 @@ test('shows parsed field history as a flattened evidence table', async () => { expect(screen.getByText('按车辆和时间窗复盘每一段行程')).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(); @@ -6552,20 +6552,20 @@ test('shows parsed field history as a flattened evidence table', async () => { 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(); 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 () => { @@ -8521,7 +8521,8 @@ test('opens same-day mileage statistics from history location row', async () => render(); expect(await screen.findByText('VIN-HISTORY-MILEAGE')).toBeInTheDocument(); - fireEvent.click(screen.getByRole('button', { name: '核对里程' })); + const locationRow = screen.getByRole('row', { name: /VIN-HISTORY-MILEAGE/ }); + fireEvent.click(within(locationRow).getByRole('button', { name: '统计查询' })); await waitFor(() => { expect(window.location.hash).toBe('#/mileage?keyword=VIN-HISTORY-MILEAGE&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'); @@ -8811,7 +8812,8 @@ test('opens same-day mileage statistics from raw history row', async () => { render(); expect((await screen.findAllByText('raw-jt808-mileage-001')).length).toBeGreaterThanOrEqual(1); - fireEvent.click(screen.getByRole('button', { name: '核对里程' })); + const rawRow = screen.getByRole('row', { name: /raw-jt808-mileage-001/ }); + fireEvent.click(within(rawRow).getByRole('button', { name: '统计查询' })); await waitFor(() => { expect(window.location.hash).toBe('#/mileage?keyword=VIN-RAW-MILEAGE&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04');