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

@@ -352,15 +352,15 @@ function historyEvidencePackageText({
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`位置记录:${locationCount.toLocaleString()},有效定位:${validPointCount.toLocaleString()}`, `位置记录:${locationCount.toLocaleString()},有效定位:${validPointCount.toLocaleString()}`,
`历史明细:${rawCount.toLocaleString()},字段明细${fieldCount.toLocaleString()}`, `明细证据${rawCount.toLocaleString()},字段裁剪${fieldCount.toLocaleString()}`,
`区间里程:${formatNumber(mileageDelta, ' km')},最高速度:${formatNumber(maxSpeed, ' km/h')}`, `区间里程:${formatNumber(mileageDelta, ' km')},最高速度:${formatNumber(maxSpeed, ' km/h')}`,
`起点:${firstLocation?.deviceTime || firstLocation?.serverTime || '-'}`, `起点:${firstLocation?.deviceTime || firstLocation?.serverTime || '-'}`,
`终点:${lastLocation?.deviceTime || lastLocation?.serverTime || '-'}`, `终点:${lastLocation?.deviceTime || lastLocation?.serverTime || '-'}`,
`异常:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`, `异常:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`,
`轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `轨迹回放:${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: '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: '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-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 }))}` `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}`
].join('\n'); ].join('\n');
@@ -398,18 +398,18 @@ function deliveryPackageText({
return [ return [
'【客户查询导出包】', '【客户查询导出包】',
`交付状态:${deliveryState}`, `交付状态:${deliveryState}`,
'交付物:位置历史 / 轨迹回放 / 统计查询 / 历史明细 / 字段明细 / 质量提示', '交付物:轨迹报告 / 位置历史 / 统计查询 / 明细证据 / 字段裁剪 / 质量提示',
`车辆范围:${vehicle || '全部车辆'}`, `车辆范围:${vehicle || '全部车辆'}`,
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`位置历史:${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()},覆盖率 ${formatPercent(coverageRate)}`, `位置历史:${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()},覆盖率 ${formatPercent(coverageRate)}`,
`历史明细:${rawCount.toLocaleString()}`, `明细证据${rawCount.toLocaleString()}`,
`字段明细${fieldCount.toLocaleString()} 个字段`, `字段裁剪${fieldCount.toLocaleString()} 个字段`,
`区间里程:${formatNumber(mileageDelta, ' km')}`, `区间里程:${formatNumber(mileageDelta, ' km')}`,
`质量提示:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`, `质量提示:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`,
`位置导出:${appURL(buildAppHash({ page: 'history-query', keyword: vehicle, protocol, filters: { ...evidenceFilters, tab: 'location' } }))}`, `位置导出:${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: '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-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: '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 }))}` `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}`
@@ -443,14 +443,14 @@ function scheduledHistoryReportPlanText({
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
'推荐频率:日报用于运营复盘,周报用于客户对账,临时导出用于问题解释。', '推荐频率:日报用于运营复盘,周报用于客户对账,临时导出用于问题解释。',
'交付内容:轨迹报告 / 位置历史 CSV / 历史明细 CSV / 字段明细 CSV / 统计查询链接 / 质量提示。', '交付内容:轨迹报告 / 位置历史 CSV / 明细证据 CSV / 字段裁剪 CSV / 统计查询链接 / 质量提示。',
`当前数据量:位置 ${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()}历史明细 ${rawCount.toLocaleString()} 帧,字段 ${fieldCount.toLocaleString()} 个。`, `当前数据量:位置 ${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()},明细证据 ${rawCount.toLocaleString()} 帧,字段裁剪 ${fieldCount.toLocaleString()} 个。`,
`质量提示:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`, `质量提示:断点 ${anomalySummary.gapCount.toLocaleString()} / 里程回退 ${anomalySummary.mileageRollbackCount.toLocaleString()} / 超速 ${anomalySummary.overspeedCount.toLocaleString()}`,
'交付前检查:先锁定车辆和时间窗,再确认字段裁剪、分页覆盖和异常说明。', '交付前检查:先锁定车辆和时间窗,再确认字段裁剪、分页覆盖和异常说明。',
`轨迹报告:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `轨迹报告:${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: '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: '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-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'); ].join('\n');
} }
@@ -499,14 +499,14 @@ function trajectoryReviewPackageText({
...(filters.dateTo?.trim() ? { dateTo: filters.dateTo.trim() } : {}) ...(filters.dateTo?.trim() ? { dateTo: filters.dateTo.trim() } : {})
}; };
const anomalyAction = anomalySummary.gapCount > 0 || anomalySummary.mileageRollbackCount > 0 || anomalySummary.overspeedCount > 0 const anomalyAction = anomalySummary.gapCount > 0 || anomalySummary.mileageRollbackCount > 0 || anomalySummary.overspeedCount > 0
? '建议核对历史明细、字段明细、当日统计查询,并确认平台是否存在断链或补发。' ? '建议核对明细证据、字段裁剪、当日统计查询,并确认平台是否存在断链或补发。'
: '当前页未发现明显断点、里程回退或速度异常,可作为轨迹复盘依据使用。'; : '当前页未发现明显断点、里程回退或速度异常,可作为轨迹复盘依据使用。';
return [ return [
'【轨迹复盘交接包】', '【轨迹复盘交接包】',
`车辆:${vehicle || '全部车辆'}`, `车辆:${vehicle || '全部车辆'}`,
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 历史明细 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`, `轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 明细证据 ${rawCount.toLocaleString()} / 字段裁剪 ${fieldCount.toLocaleString()}`,
`轨迹质量:定位覆盖率 ${formatPercent(coverageRate)} / 回放跨度 ${formatDurationMinutes(playbackSpanMinutes)} / 采样间隔 ${formatDurationMinutes(playbackIntervalMinutes, '/点')}`, `轨迹质量:定位覆盖率 ${formatPercent(coverageRate)} / 回放跨度 ${formatDurationMinutes(playbackSpanMinutes)} / 采样间隔 ${formatDurationMinutes(playbackIntervalMinutes, '/点')}`,
`里程速度:区间里程 ${formatNumber(mileageDelta, ' km')} / 最高速度 ${formatNumber(maxSpeed, ' km/h')}`, `里程速度:区间里程 ${formatNumber(mileageDelta, ' km')} / 最高速度 ${formatNumber(maxSpeed, ' km/h')}`,
`起点:${firstLocation?.deviceTime || firstLocation?.serverTime || '-'}`, `起点:${firstLocation?.deviceTime || firstLocation?.serverTime || '-'}`,
@@ -520,8 +520,8 @@ function trajectoryReviewPackageText({
`下一步:${anomalyAction}`, `下一步:${anomalyAction}`,
`轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `轨迹回放:${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: '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: '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-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 }))}` `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}`
].join('\n'); ].join('\n');
@@ -568,7 +568,7 @@ function trajectoryImpactPackageText({
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`业务状态:${operationState}`, `业务状态:${operationState}`,
`轨迹范围:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 历史明细 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`, `轨迹范围:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 明细证据 ${rawCount.toLocaleString()} / 字段裁剪 ${fieldCount.toLocaleString()}`,
`定位覆盖率:${formatPercent(coverageRate)}`, `定位覆盖率:${formatPercent(coverageRate)}`,
`回放跨度:${formatDurationMinutes(playbackSpanMinutes)},采样间隔:${formatDurationMinutes(playbackIntervalMinutes, '/点')}`, `回放跨度:${formatDurationMinutes(playbackSpanMinutes)},采样间隔:${formatDurationMinutes(playbackIntervalMinutes, '/点')}`,
`里程速度:${formatNumber(mileageDelta, ' km')} / ${formatNumber(maxSpeed, ' km/h')}`, `里程速度:${formatNumber(mileageDelta, ' km')} / ${formatNumber(maxSpeed, ' km/h')}`,
@@ -576,7 +576,7 @@ function trajectoryImpactPackageText({
`地图能力:${amapConfigured ? '高德 JS API 已配置' : '高德 JS API 待配置'}`, `地图能力:${amapConfigured ? '高德 JS API 已配置' : '高德 JS API 待配置'}`,
`轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `轨迹回放:${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: '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: 'raw', includeFields: 'true' } }))}`,
`车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}` `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}`
].join('\n'); ].join('\n');
} }
@@ -631,7 +631,7 @@ function trajectoryCustomerDecisionText({
`车辆范围:${vehicle || '全部车辆'}`, `车辆范围:${vehicle || '全部车辆'}`,
`数据通道:${protocol || '全部数据通道'}`, `数据通道:${protocol || '全部数据通道'}`,
`时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`, `时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 历史明细 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`, `轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 明细证据 ${rawCount.toLocaleString()} / 字段裁剪 ${fieldCount.toLocaleString()}`,
`定位覆盖:${formatPercent(coverageRate)}`, `定位覆盖:${formatPercent(coverageRate)}`,
`回放跨度:${formatDurationMinutes(playbackSpanMinutes)},采样间隔:${formatDurationMinutes(playbackIntervalMinutes, '/点')}`, `回放跨度:${formatDurationMinutes(playbackSpanMinutes)},采样间隔:${formatDurationMinutes(playbackIntervalMinutes, '/点')}`,
`区间里程:${formatNumber(mileageDelta, ' km')},最高速度:${formatNumber(maxSpeed, ' km/h')}`, `区间里程:${formatNumber(mileageDelta, ' km')},最高速度:${formatNumber(maxSpeed, ' km/h')}`,
@@ -644,11 +644,11 @@ function trajectoryCustomerDecisionText({
'1. 先看轨迹覆盖:确认是否有足够有效坐标。', '1. 先看轨迹覆盖:确认是否有足够有效坐标。',
'2. 再看时间断点:断点会影响定位连续性和客户解释。', '2. 再看时间断点:断点会影响定位连续性和客户解释。',
'3. 再看里程速度:区间里程、速度和轨迹方向需要能互相解释。', '3. 再看里程速度:区间里程、速度和轨迹方向需要能互相解释。',
'4. 最后回到依据:异常点必须打开历史明细、字段明细和统计查询复核。', '4. 最后回到依据:异常点必须打开明细证据、字段裁剪和统计查询复核。',
`轨迹回放:${appURL(buildAppHash({ page: 'history', keyword: vehicle, protocol, filters: evidenceFilters }))}`, `轨迹回放:${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: '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: '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-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 }))}` `车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: vehicle, protocol }))}`
].join('\n'); ].join('\n');
@@ -864,11 +864,11 @@ export function History({
const currentProtocol = filters.protocol?.trim() ?? ''; const currentProtocol = filters.protocol?.trim() ?? '';
const pageTitle = mode === 'query' ? '历史查询导出' : '轨迹回放'; const pageTitle = mode === 'query' ? '历史查询导出' : '轨迹回放';
const pageDescription = mode === 'query' const pageDescription = mode === 'query'
? '按车辆时间和数据通道导出位置记录、历史明细和字段明细,支持分页、字段裁剪和 CSV 导出' ? '按车辆时间窗交付轨迹报告、位置记录、明细证据和字段裁剪,支持分页、字段裁剪和 CSV 导出'
: '按车辆查询历史位置和轨迹回放,历史明细只作为复核依据,数据通道仅用于过滤'; : '按车辆查询历史位置和轨迹回放,明细证据只作为复核依据,数据通道仅用于过滤';
const scopeDescription = mode === 'query' const scopeDescription = mode === 'query'
? '位置记录、历史明细和字段明细按当前车辆与时间范围分页查询。' ? '位置记录、明细证据和字段裁剪按当前车辆与时间范围分页查询。'
: '历史位置和历史明细按当前车辆与时间范围查询。'; : '历史位置和明细证据按当前车辆与时间范围查询。';
const amapConfigured = isAMapConfigured(); const amapConfigured = isAMapConfigured();
const selectedFieldCount = splitFields(filters.fields).length; const selectedFieldCount = splitFields(filters.fields).length;
const playbackRows = validLocations.length > 0 ? validLocations : locationItems; const playbackRows = validLocations.length > 0 ? validLocations : locationItems;
@@ -943,9 +943,9 @@ export function History({
{ {
label: '明细复核', label: '明细复核',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: rawFieldRows.length > 0 ? `${rawFieldRows.length.toLocaleString()} 个字段明细可导出。` : '异常点需要回到历史明细和字段明细。', detail: rawFieldRows.length > 0 ? `${rawFieldRows.length.toLocaleString()} 个字段裁剪可导出。` : '异常点需要回到明细证据和字段裁剪。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
action: '历史明细', action: '明细证据',
disabled: false, disabled: false,
onClick: () => openQueryTab('raw') onClick: () => openQueryTab('raw')
} }
@@ -979,20 +979,20 @@ export function History({
onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) }) onClick: () => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) })
}, },
{ {
title: '历史明细', title: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '保留接入明细,用于解释字段值来源。', detail: '保留接入证据,用于解释字段值来源。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
action: '导出明细', action: '导出证据',
disabled: rawFrames.items.length === 0, disabled: rawFrames.items.length === 0,
onClick: () => exportRawFrames() onClick: () => exportRawFrames()
}, },
{ {
title: '字段明细', title: '字段裁剪',
value: `${rawFieldRows.length.toLocaleString()}`, value: `${rawFieldRows.length.toLocaleString()}`,
detail: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 个字段裁剪。` : '可切换字段明细生成字段级交付。', detail: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 个字段裁剪。` : '可切换字段裁剪生成字段级交付。',
color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const, color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
action: '字段明细', action: '字段配置',
disabled: false, disabled: false,
onClick: () => openQueryTab('fields') onClick: () => openQueryTab('fields')
}, },
@@ -1017,18 +1017,18 @@ export function History({
onClick: () => copyTrajectoryReviewPackage() onClick: () => copyTrajectoryReviewPackage()
}, },
{ {
title: '历史明细包', title: '明细证据包',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '适合客户或BI追溯位置、里程、速度、SOC等字段来源。', detail: '适合客户或BI追溯位置、里程、速度、SOC等字段来源。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
action: '明细导出', action: '导出证据',
disabled: false, disabled: false,
onClick: () => openQueryTab('raw') onClick: () => openQueryTab('raw')
}, },
{ {
title: '字段裁剪包', title: '字段裁剪包',
value: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 字段` : `${rawFieldRows.length.toLocaleString()} 字段`, value: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 字段` : `${rawFieldRows.length.toLocaleString()} 字段`,
detail: selectedFieldCount > 0 ? '按客户指定字段裁剪,减少导出体积。' : '先填写字段裁剪或切换字段明细,再生成字段级交付。', detail: selectedFieldCount > 0 ? '按客户指定字段裁剪,减少导出体积。' : '先填写字段裁剪或切换字段裁剪页,再生成字段级交付。',
color: rawFieldRows.length > 0 || selectedFieldCount > 0 ? 'green' as const : 'orange' as const, color: rawFieldRows.length > 0 || selectedFieldCount > 0 ? 'green' as const : 'orange' as const,
action: '字段配置', action: '字段配置',
disabled: false, disabled: false,
@@ -1332,20 +1332,20 @@ export function History({
<Card bordered className="vp-history-customer-export-board" bodyStyle={{ padding: 0 }}> <Card bordered className="vp-history-customer-export-board" bodyStyle={{ padding: 0 }}>
<div className="vp-history-customer-export-summary"> <div className="vp-history-customer-export-summary">
<Space wrap> <Space wrap>
<Tag color="blue"></Tag> <Tag color="blue"></Tag>
<Tag color={deliveryStateColor}>{deliveryState}</Tag> <Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={activeTab === 'location' ? 'green' : activeTab === 'raw' ? 'blue' : 'orange'}> <Tag color={activeTab === 'location' ? 'green' : activeTab === 'raw' ? 'blue' : 'orange'}>
{activeTab === 'location' ? '位置历史' : activeTab === 'raw' ? '历史明细' : '字段明细'} {activeTab === 'location' ? '位置历史' : activeTab === 'raw' ? '明细证据' : '字段裁剪'}
</Tag> </Tag>
</Space> </Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title> <Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
CSV CSV
</Typography.Text> </Typography.Text>
<Space wrap> <Space wrap>
<Button size="small" theme="solid" type="primary" onClick={() => openQueryTab('location')}></Button> <Button size="small" theme="solid" type="primary" onClick={() => openQueryTab('location')}></Button>
<Button size="small" theme="light" type="primary" onClick={() => openQueryTab('raw')}></Button> <Button size="small" theme="light" type="primary" onClick={() => openQueryTab('raw')}></Button>
<Button size="small" theme="light" type="primary" onClick={() => openQueryTab('fields')}></Button> <Button size="small" theme="light" type="primary" onClick={() => openQueryTab('fields')}></Button>
<Button size="small" theme="light" onClick={copyDeliveryPackage}></Button> <Button size="small" theme="light" onClick={copyDeliveryPackage}></Button>
</Space> </Space>
</div> </div>
@@ -1373,20 +1373,20 @@ export function History({
}, },
{ {
step: '03', step: '03',
title: '历史明细', title: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '保留接入明细,用于解释位置、里程和字段来源。', detail: '保留接入证据,用于解释位置、里程和字段来源。',
action: '导出明细', action: '导出证据',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
disabled: rawFrames.items.length === 0, disabled: rawFrames.items.length === 0,
onClick: exportRawFrames onClick: exportRawFrames
}, },
{ {
step: '04', step: '04',
title: '字段明细', title: '字段裁剪',
value: `${rawFieldRows.length.toLocaleString()}`, value: `${rawFieldRows.length.toLocaleString()}`,
detail: selectedFieldCount > 0 ? `已裁剪 ${selectedFieldCount.toLocaleString()} 个字段。` : '需要字段级交付时切换字段明细或填写字段裁剪。', detail: selectedFieldCount > 0 ? `已裁剪 ${selectedFieldCount.toLocaleString()} 个字段。` : '需要字段级交付时切换字段裁剪或填写字段裁剪。',
action: '字段明细', action: '字段配置',
color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const, color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
disabled: false, disabled: false,
onClick: () => openQueryTab('fields') onClick: () => openQueryTab('fields')
@@ -1408,7 +1408,7 @@ export function History({
className="vp-history-customer-export-step" className="vp-history-customer-export-step"
disabled={item.disabled} disabled={item.disabled}
onClick={item.onClick} onClick={item.onClick}
aria-label={`客户数据交付中心 ${item.title} ${item.action}`} aria-label={`客户数据交付 ${item.title} ${item.action}`}
> >
<span>{item.step}</span> <span>{item.step}</span>
<Tag color={item.color}>{item.title}</Tag> <Tag color={item.color}>{item.title}</Tag>
@@ -1433,7 +1433,7 @@ export function History({
</Space> </Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title> <Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
CSV CSV
</Typography.Text> </Typography.Text>
</div> </div>
<div className="vp-history-report-template-grid"> <div className="vp-history-report-template-grid">
@@ -1466,7 +1466,7 @@ export function History({
</Space> </Space>
<Typography.Title heading={3} style={{ margin: 0 }}></Typography.Title> <Typography.Title heading={3} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
线 线
</Typography.Text> </Typography.Text>
</div> </div>
<VehicleMap <VehicleMap
@@ -1517,7 +1517,7 @@ export function History({
<div className="vp-trip-actions"> <div className="vp-trip-actions">
{[ {[
{ 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: 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: `${(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 } { title: '客户导出', value: deliveryState, detail: '复制交付说明或导出 CSV 证据。', action: '复制交付', color: deliveryStateColor, disabled: false, onClick: copyDeliveryPackage }
].map((item) => ( ].map((item) => (
@@ -1543,14 +1543,14 @@ export function History({
<Tag color={deliveryStateColor}>{deliveryState}</Tag> <Tag color={deliveryStateColor}>{deliveryState}</Tag>
<Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag> <Tag color={amapConfigured ? 'green' : 'orange'}>{amapConfigured ? '高德地图可用' : '坐标预览'}</Tag>
</Space> </Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title> <Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
</Typography.Text> </Typography.Text>
<Space wrap> <Space wrap>
<Button size="small" theme="solid" type="primary" icon={<IconCopy />} onClick={copyTrajectoryDecision}></Button> <Button size="small" theme="solid" type="primary" icon={<IconCopy />} onClick={copyTrajectoryDecision}></Button>
<Button size="small" disabled={validLocations.length === 0} onClick={() => openQueryTab('location')}></Button> <Button size="small" disabled={validLocations.length === 0} onClick={() => openQueryTab('location')}></Button>
<Button size="small" disabled={(rawFrames.total ?? 0) === 0} onClick={() => openQueryTab('raw')}></Button> <Button size="small" disabled={(rawFrames.total ?? 0) === 0} onClick={() => openQueryTab('raw')}></Button>
<Button size="small" disabled={!onOpenMileage} onClick={() => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) })}></Button> <Button size="small" disabled={!onOpenMileage} onClick={() => onOpenMileage?.({ keyword: currentVehicleKeyword, protocol: currentProtocol, ...(filters.dateFrom ? { dateFrom: filters.dateFrom } : {}), ...(filters.dateTo ? { dateTo: filters.dateTo } : {}) })}></Button>
</Space> </Space>
</div> </div>
@@ -1580,20 +1580,20 @@ export function History({
<Space wrap> <Space wrap>
<Tag color="blue"></Tag> <Tag color="blue"></Tag>
<Tag color={activeTab === 'location' ? 'green' : 'blue'}> <Tag color={activeTab === 'location' ? 'green' : 'blue'}>
{activeTab === 'location' ? '位置历史' : activeTab === 'raw' ? '历史明细' : '字段明细'} {activeTab === 'location' ? '位置历史' : activeTab === 'raw' ? '明细证据' : '字段裁剪'}
</Tag> </Tag>
</Space> </Space>
<Typography.Text strong>{currentVehicleKeyword || '全部车辆'}</Typography.Text> <Typography.Text strong>{currentVehicleKeyword || '全部车辆'}</Typography.Text>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
BI BI
</Typography.Text> </Typography.Text>
<Typography.Text type="tertiary"> <Typography.Text type="tertiary">
VIN VIN
</Typography.Text> </Typography.Text>
<Space wrap> <Space wrap>
<Button size="small" theme="solid" type="primary" onClick={() => openQueryTab('location')}></Button> <Button size="small" theme="solid" type="primary" onClick={() => openQueryTab('location')}></Button>
<Button size="small" onClick={() => openQueryTab('raw')}></Button> <Button size="small" onClick={() => openQueryTab('raw')}></Button>
<Button size="small" onClick={() => openQueryTab('fields')}></Button> <Button size="small" onClick={() => openQueryTab('fields')}></Button>
</Space> </Space>
</div> </div>
<div className="vp-history-query-grid"> <div className="vp-history-query-grid">
@@ -1607,17 +1607,17 @@ export function History({
onClick: exportLocations onClick: exportLocations
}, },
{ {
label: '历史明细', label: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '保存协议接入后的历史明细,可按车辆和时间追溯。', detail: '保存接入后的证据明细,可按车辆和时间追溯。',
action: '导出明细', action: '导出证据',
color: 'blue' as const, color: 'blue' as const,
onClick: exportRawFrames onClick: exportRawFrames
}, },
{ {
label: '字段明细', label: '字段裁剪',
value: rawFieldRows.length.toLocaleString(), value: rawFieldRows.length.toLocaleString(),
detail: selectedFieldCount > 0 ? `已裁剪 ${selectedFieldCount.toLocaleString()} 个字段。` : '可勾选字段明细或填写字段裁剪后查询。', detail: selectedFieldCount > 0 ? `已裁剪 ${selectedFieldCount.toLocaleString()} 个字段。` : '可勾选字段裁剪或填写字段裁剪后查询。',
action: '导出字段', action: '导出字段',
color: rawFieldRows.length > 0 ? 'green' as const : 'grey' as const, color: rawFieldRows.length > 0 ? 'green' as const : 'grey' as const,
onClick: exportRawFields onClick: exportRawFields
@@ -1652,7 +1652,7 @@ export function History({
</Space> </Space>
<Typography.Text strong>{deliveryScopeText}</Typography.Text> <Typography.Text strong>{deliveryScopeText}</Typography.Text>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
</Typography.Text> </Typography.Text>
<Space wrap> <Space wrap>
<Button size="small" theme="solid" type="primary" icon={<IconCopy />} onClick={copyDeliveryPackage}> <Button size="small" theme="solid" type="primary" icon={<IconCopy />} onClick={copyDeliveryPackage}>
@@ -1678,20 +1678,20 @@ export function History({
onClick: exportLocations onClick: exportLocations
}, },
{ {
label: '历史明细', label: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '用于追溯数据来自接入协议解析后的真实明细。', detail: '用于追溯数据来自接入协议解析后的真实证据。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const, color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const,
action: '导出明细', action: '导出证据',
disabled: rawFrames.items.length === 0, disabled: rawFrames.items.length === 0,
onClick: exportRawFrames onClick: exportRawFrames
}, },
{ {
label: '字段明细', label: '字段裁剪',
value: `${rawFieldRows.length.toLocaleString()}`, value: `${rawFieldRows.length.toLocaleString()}`,
detail: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 个字段裁剪。` : '需要字段级交付时切换字段明细。', detail: selectedFieldCount > 0 ? `${selectedFieldCount.toLocaleString()} 个字段裁剪。` : '需要字段级交付时切换字段裁剪。',
color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const, color: rawFieldRows.length > 0 ? 'green' as const : 'orange' as const,
action: '字段明细', action: '字段配置',
disabled: false, disabled: false,
onClick: () => openQueryTab('fields') onClick: () => openQueryTab('fields')
}, },
@@ -1819,13 +1819,13 @@ export function History({
onSecondary: () => currentVehicleKeyword && onOpenVehicle(currentVehicleKeyword, currentProtocol) onSecondary: () => currentVehicleKeyword && onOpenVehicle(currentVehicleKeyword, currentProtocol)
}, },
{ {
title: '历史明细', title: '明细证据',
tag: (rawFrames.total ?? 0) > 0 ? '有明细' : '待加载', tag: (rawFrames.total ?? 0) > 0 ? '有明细' : '待加载',
tagColor: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'orange' as const, tagColor: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'orange' as const,
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: '保留接入侧历史明细,用于解释位置、里程和字段值的来源。', detail: '保留接入侧证据,用于解释位置、里程和字段值的来源。',
primaryText: '看明细', primaryText: '看证据',
secondaryText: '导出明细', secondaryText: '导出证据',
disabled: false, disabled: false,
secondaryDisabled: rawFrames.items.length === 0, secondaryDisabled: rawFrames.items.length === 0,
onPrimary: () => openQueryTab('raw'), onPrimary: () => openQueryTab('raw'),
@@ -1838,8 +1838,8 @@ export function History({
value: `${rawFieldRows.length.toLocaleString()} 个字段`, value: `${rawFieldRows.length.toLocaleString()} 个字段`,
detail: selectedFieldCount > 0 detail: selectedFieldCount > 0
? '按配置字段返回明细,减少接口体积并加快复核。' ? '按配置字段返回明细,减少接口体积并加快复核。'
: '需要字段级核对时,切到字段明细或填写字段裁剪。', : '需要字段级核对时,切到字段裁剪或填写字段裁剪。',
primaryText: '字段明细', primaryText: '字段裁剪',
secondaryText: '导出字段', secondaryText: '导出字段',
disabled: false, disabled: false,
secondaryDisabled: rawFieldRows.length === 0, secondaryDisabled: rawFieldRows.length === 0,
@@ -1877,7 +1877,7 @@ export function History({
</Space> </Space>
<Typography.Text strong>{currentVehicleKeyword || '全部车辆'}</Typography.Text> <Typography.Text strong>{currentVehicleKeyword || '全部车辆'}</Typography.Text>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
</Typography.Text> </Typography.Text>
<Space wrap> <Space wrap>
<Button size="small" icon={<IconCopy />} onClick={copyTrajectoryImpactPackage}></Button> <Button size="small" icon={<IconCopy />} onClick={copyTrajectoryImpactPackage}></Button>
@@ -1906,9 +1906,9 @@ export function History({
color: hasTrajectoryAnomaly ? 'orange' as const : 'green' as const color: hasTrajectoryAnomaly ? 'orange' as const : 'green' as const
}, },
{ {
label: '历史明细', label: '明细证据',
value: `${(rawFrames.total ?? 0).toLocaleString()}`, value: `${(rawFrames.total ?? 0).toLocaleString()}`,
detail: rawFieldRows.length > 0 ? `${rawFieldRows.length.toLocaleString()} 个字段明细可直接导出。` : '可切换历史明细并请求字段明细。', detail: rawFieldRows.length > 0 ? `${rawFieldRows.length.toLocaleString()} 个字段裁剪可直接导出。` : '可切换明细证据并请求字段裁剪。',
color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const color: (rawFrames.total ?? 0) > 0 ? 'blue' as const : 'grey' as const
}, },
{ {
@@ -2116,9 +2116,9 @@ export function History({
))} ))}
</div> </div>
<div className="vp-trajectory-anomaly-action"> <div className="vp-trajectory-anomaly-action">
<Tag color={hasTrajectoryAnomaly ? 'orange' : 'green'}>{hasTrajectoryAnomaly ? '建议核对历史明细和当日统计查询' : '轨迹质量可用'}</Tag> <Tag color={hasTrajectoryAnomaly ? 'orange' : 'green'}>{hasTrajectoryAnomaly ? '建议核对明细证据和当日统计查询' : '轨迹质量可用'}</Tag>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
{hasTrajectoryAnomaly ? '异常点会影响轨迹回放、定位复盘和区间里程判断,请结合字段明细与统计查询交叉确认。' : '当前页轨迹未发现明显断点、里程回退或速度异常。'} {hasTrajectoryAnomaly ? '异常点会影响轨迹回放、定位复盘和区间里程判断,请结合字段裁剪与统计查询交叉确认。' : '当前页轨迹未发现明显断点、里程回退或速度异常。'}
</Typography.Text> </Typography.Text>
</div> </div>
</Card> </Card>

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((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.getByText('客户需要看到路线、起止时间、里程变化、速度异常和可导出的证据。历史明细和字段只作为轨迹复盘的依据。')).toBeInTheDocument(); expect(screen.getByText('客户需要看到路线、起止时间、里程变化、速度异常和可导出的证据。明细证据和字段裁剪只作为轨迹复盘的依据。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '轨迹回放指标 轨迹点 2' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '轨迹回放指标 轨迹点 2' })).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(); 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();
fireEvent.click(screen.getAllByRole('button', { name: /复制决策说明/ })[0]); 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('决策结论:可复盘,需附异常说明'));
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: /复制轨迹摘要/ })); 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('【数据复核包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('位置记录2有效定位2')); 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('异常:断点 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?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=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'));
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=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')); 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('车辆VIN-HISTORY-SUMMARY'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('数据通道JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('数据通道JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('业务状态:需要复核')); 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('定位覆盖率100%'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('回放跨度60 分钟采样间隔60 分钟/点')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('回放跨度60 分钟采样间隔60 分钟/点'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常影响:断点 1 / 里程回退 0 / 超速 0')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常影响:断点 1 / 里程回退 0 / 超速 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('地图能力:高德 JS API 待配置')); 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=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: /复制轨迹复盘包/ })); fireEvent.click(screen.getByRole('button', { name: /复制轨迹复盘包/ }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【轨迹复盘交接包】')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【轨迹复盘交接包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆VIN-HISTORY-SUMMARY')); 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('轨迹质量:定位覆盖率 100% / 回放跨度 60 分钟 / 采样间隔 60 分钟/点'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程速度:区间里程 22.6 km / 最高速度 58.8 km/h')); 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/22026-07-03 10:00:0012.5 km/h1,000 km'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常判读:断点 1 / 里程回退 0 / 超速 0')); 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')); 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 () => { 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 />); render(<App />);
expect(await screen.findByRole('heading', { name: '历史查询导出' })).toBeInTheDocument(); 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.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.getByText('面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付位置历史、历史明细、字段明细、CSV 文件、轨迹复盘和统计查询。')).toBeInTheDocument(); expect(screen.getByText('面向客户的数据导出以车辆服务为中心:同一个筛选范围可以交付轨迹报告、位置历史、明细证据、字段裁剪、CSV 文件和统计查询。')).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();
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(); 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.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.getAllByRole('button', { name: /复制决策说明/ }).length).toBeGreaterThanOrEqual(1); 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.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();
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();
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: /复制交付清单/ })); fireEvent.click(screen.getByRole('button', { name: /复制交付清单/ }));
await waitFor(() => { await waitFor(() => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付物:位置历史 / 轨迹回放 / 统计查询 / 历史明细 / 字段明细 / 质量提示')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('交付物:轨迹报告 / 位置历史 / 统计查询 / 明细证据 / 字段裁剪 / 质量提示'));
}); });
fireEvent.click(screen.getByRole('button', { name: '报表交付模板 周期交付计划 复制计划' })); fireEvent.click(screen.getByRole('button', { name: '报表交付模板 周期交付计划 复制计划' }));
await waitFor(() => { await waitFor(() => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【历史数据周期交付计划】')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【历史数据周期交付计划】'));
}); });
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(await screen.findByRole('tab', { name: '字段明细' })).toHaveAttribute('aria-selected', 'true');
expect(fetchMock).toHaveBeenCalledWith('/api/history/raw-frames/query', expect.objectContaining({ expect(fetchMock).toHaveBeenCalledWith('/api/history/raw-frames/query', expect.objectContaining({
method: 'POST', 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('2 km')).toBeInTheDocument();
expect(screen.getByText('速度异常')).toBeInTheDocument(); expect(screen.getByText('速度异常')).toBeInTheDocument();
expect(screen.getAllByText('132 km/h').length).toBeGreaterThan(0); 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 () => { test('opens amap route from trajectory playback workspace', async () => {