feat(platform): refine customer source wording

This commit is contained in:
lingniu
2026-07-05 04:08:14 +08:00
parent 348c51398e
commit 442e4e9390
3 changed files with 23 additions and 23 deletions

View File

@@ -212,7 +212,7 @@ function mergeInitialFilters(initialVin: string, initialProtocol?: string, initi
const locationExportColumns: CsvColumn<HistoryLocationRow>[] = [
{ title: 'VIN', value: (row) => row.vin },
{ title: '车牌', value: (row) => row.plate },
{ title: '据来源', value: (row) => row.protocol },
{ title: '据来源', value: (row) => row.protocol },
{ title: '经度', value: (row) => row.longitude },
{ title: '纬度', value: (row) => row.latitude },
{ title: '速度km/h', value: (row) => row.speedKmh },
@@ -225,7 +225,7 @@ const rawExportColumns: CsvColumn<RawFrameRow>[] = [
{ title: 'ID', value: (row) => row.id },
{ title: 'VIN', value: (row) => row.vin },
{ title: '车牌', value: (row) => row.plate },
{ title: '据来源', value: (row) => row.protocol },
{ title: '据来源', value: (row) => row.protocol },
{ title: '帧类型', value: (row) => row.frameType },
{ title: '大小B', value: (row) => row.rawSizeBytes },
{ title: '设备时间', value: (row) => row.deviceTime },
@@ -237,7 +237,7 @@ const rawFieldExportColumns: CsvColumn<RawFieldRow>[] = [
{ title: '原始记录ID', value: (row) => row.rawId },
{ title: 'VIN', value: (row) => row.vin },
{ title: '车牌', value: (row) => row.plate },
{ title: '据来源', value: (row) => row.protocol },
{ title: '据来源', value: (row) => row.protocol },
{ title: '帧类型', value: (row) => row.frameType },
{ title: '字段', value: (row) => row.fieldPath },
{ title: '值', value: (row) => formatFieldValue(row.fieldValue) },
@@ -302,7 +302,7 @@ function trajectorySummaryText({
return [
'【轨迹回放摘要】',
`车辆:${vehicle}`,
`据来源:${protocol}`,
`据来源:${protocol}`,
`查询范围:${range}`,
`轨迹点:${totalPoints.toLocaleString()},有效定位:${validPointCount.toLocaleString()}`,
`区间里程:${formatNumber(mileageDelta, ' km')}`,
@@ -349,7 +349,7 @@ function historyEvidencePackageText({
return [
'【数据复核包】',
`车辆:${vehicle || '全部车辆'}`,
`据来源:${protocol || '全部来源'}`,
`据来源:${protocol || '全部来源'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`位置记录:${locationCount.toLocaleString()},有效定位:${validPointCount.toLocaleString()}`,
`原始记录:${rawCount.toLocaleString()},字段明细:${fieldCount.toLocaleString()}`,
@@ -400,7 +400,7 @@ function deliveryPackageText({
`交付状态:${deliveryState}`,
'交付物:位置历史 / 轨迹回放 / 里程复核 / RAW证据 / 字段明细 / 质量提示',
`车辆范围:${vehicle || '全部车辆'}`,
`据来源:${protocol || '全部来源'}`,
`据来源:${protocol || '全部来源'}`,
`时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`位置历史:${locationCount.toLocaleString()} 条,有效定位 ${validPointCount.toLocaleString()},覆盖率 ${formatPercent(coverageRate)}`,
`原始证据:${rawCount.toLocaleString()}`,
@@ -465,7 +465,7 @@ function trajectoryReviewPackageText({
return [
'【轨迹复盘交接包】',
`车辆:${vehicle || '全部车辆'}`,
`据来源:${protocol || '全部来源'}`,
`据来源:${protocol || '全部来源'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 原始记录 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`,
`轨迹质量:定位覆盖率 ${formatPercent(coverageRate)} / 回放跨度 ${formatDurationMinutes(playbackSpanMinutes)} / 采样间隔 ${formatDurationMinutes(playbackIntervalMinutes, '/点')}`,
@@ -526,7 +526,7 @@ function trajectoryImpactPackageText({
return [
'【轨迹运营影响】',
`车辆:${vehicle || '全部车辆'}`,
`据来源:${protocol || '全部来源'}`,
`据来源:${protocol || '全部来源'}`,
`查询范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`业务状态:${operationState}`,
`轨迹范围:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 原始记录 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`,
@@ -590,7 +590,7 @@ function trajectoryCustomerDecisionText({
`决策结论:${decision}`,
`交付状态:${deliveryState}`,
`车辆范围:${vehicle || '全部车辆'}`,
`据来源:${protocol || '全部来源'}`,
`据来源:${protocol || '全部来源'}`,
`时间范围:${filters.dateFrom?.trim() || '-'}${filters.dateTo?.trim() || '-'}`,
`轨迹规模:位置 ${locationCount.toLocaleString()} / 有效定位 ${validPointCount.toLocaleString()} / 原始记录 ${rawCount.toLocaleString()} / 字段明细 ${fieldCount.toLocaleString()}`,
`定位覆盖:${formatPercent(coverageRate)}`,
@@ -826,7 +826,7 @@ export function History({
const pageTitle = mode === 'query' ? '数据导出' : '轨迹回放';
const pageDescription = mode === 'query'
? '按车辆、时间和数据通道导出位置记录、原始记录和字段明细,支持分页、字段裁剪和 CSV 导出'
: '按车辆查询历史位置和轨迹回放,原始记录只作为复核证据,据来源仅用于过滤';
: '按车辆查询历史位置和轨迹回放,原始记录只作为复核证据,据来源仅用于过滤';
const scopeDescription = mode === 'query'
? '位置记录、原始记录和字段明细按当前车辆与时间范围分页查询。'
: '历史位置和原始记录按当前车辆与时间范围查询。';
@@ -848,7 +848,7 @@ export function History({
}));
const filterSummary = [
currentVehicleKeyword ? `车辆:${currentVehicleKeyword}` : '',
currentProtocol ? `据来源:${currentProtocol}` : '',
currentProtocol ? `据来源:${currentProtocol}` : '',
filters.dateFrom?.trim() ? `开始时间:${filters.dateFrom.trim()}` : '',
filters.dateTo?.trim() ? `结束时间:${filters.dateTo.trim()}` : '',
isIncludeFieldsEnabled(filters.includeFields) ? '返回字段明细' : '',
@@ -1462,7 +1462,7 @@ export function History({
<Card bordered>
<Form key={JSON.stringify(filters)} initValues={filters} layout="horizontal" onSubmit={(values) => submit(values)}>
<Form.Input field="keyword" label="车辆关键词" placeholder="VIN / 车牌 / 手机号" style={{ width: 260 }} />
<Form.Select field="protocol" label="据来源" placeholder="全部来源" style={{ width: 190 }}>
<Form.Select field="protocol" label="据来源" placeholder="全部来源" style={{ width: 190 }}>
<Select.Option value="GB32960">GB32960</Select.Option>
<Select.Option value="JT808">JT808</Select.Option>
<Select.Option value="YUTONG_MQTT">YUTONG_MQTT</Select.Option>
@@ -1858,7 +1858,7 @@ export function History({
}}
columns={[
{ title: 'VIN', dataIndex: 'vin', width: 190 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '经度', dataIndex: 'longitude', width: 120 },
{ title: '纬度', dataIndex: 'latitude', width: 120 },
{ title: '速度 km/h', dataIndex: 'speedKmh', width: 120 },
@@ -1905,7 +1905,7 @@ export function History({
{ title: 'ID', dataIndex: 'id', width: 260 },
{ title: 'VIN', dataIndex: 'vin', width: 190 },
{ title: '车牌', dataIndex: 'plate', width: 120 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '帧类型', dataIndex: 'frameType', width: 190 },
{ title: '大小 B', dataIndex: 'rawSizeBytes', width: 100 },
{ title: '设备时间', dataIndex: 'deviceTime', width: 190 },
@@ -1949,7 +1949,7 @@ export function History({
},
{ title: 'VIN', dataIndex: 'vin', width: 190 },
{ title: '车牌', dataIndex: 'plate', width: 120 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '据来源', dataIndex: 'protocol', width: 120 },
{ title: '帧类型', dataIndex: 'frameType', width: 190 },
{ title: '设备时间', dataIndex: 'deviceTime', width: 190 },
{ title: '原始记录ID', dataIndex: 'rawId', width: 260 },

View File

@@ -77,7 +77,7 @@ const serviceStatusLabel: Record<string, string> = {
healthy: '服务正常',
degraded: '来源不完整',
offline: '车辆离线',
no_data: '暂无数据来源',
no_data: '暂无来源证据',
identity_required: '身份未绑定'
};
@@ -149,7 +149,7 @@ type VehicleActionQueueItem = {
function vehicleFilterSummary(filters: Record<string, string>) {
return [
filters.keyword ? `关键词:${filters.keyword}` : '',
filters.protocol ? `据来源:${filters.protocol}` : '',
filters.protocol ? `据来源:${filters.protocol}` : '',
filters.coverage ? `车辆覆盖:${coverageLabel[filters.coverage] ?? filters.coverage}` : '',
filters.missingProtocol ? `缺失来源:${filters.missingProtocol}` : '',
filters.serviceStatus ? `服务状态:${serviceStatusLabel[filters.serviceStatus] ?? filters.serviceStatus}` : '',
@@ -920,7 +920,7 @@ export function Vehicles({
applyFilters(nextFilters);
}}>
<Form.Input field="keyword" label="关键词" placeholder="VIN / 车牌 / 手机号 / OEM" style={{ width: 260 }} />
<Form.Select field="protocol" label="据来源" placeholder="全部来源" style={{ width: 180 }}>
<Form.Select field="protocol" label="据来源" placeholder="全部来源" style={{ width: 180 }}>
<Select.Option value="GB32960">GB32960</Select.Option>
<Select.Option value="JT808">JT808</Select.Option>
<Select.Option value="YUTONG_MQTT">YUTONG_MQTT</Select.Option>
@@ -938,7 +938,7 @@ export function Vehicles({
<Select.Option value="healthy"></Select.Option>
<Select.Option value="degraded"></Select.Option>
<Select.Option value="offline">线</Select.Option>
<Select.Option value="no_data"></Select.Option>
<Select.Option value="no_data"></Select.Option>
<Select.Option value="identity_required"></Select.Option>
</Form.Select>
<Form.Select field="online" label="在线" placeholder="全部" style={{ width: 130 }}>

View File

@@ -2471,7 +2471,7 @@ test('shows and clears current vehicle service filters', async () => {
expect(await screen.findByText('当前车辆筛选')).toBeInTheDocument();
expect(screen.getByText('关键词粤A')).toBeInTheDocument();
expect(screen.getByText('据来源JT808')).toBeInTheDocument();
expect(screen.getByText('据来源JT808')).toBeInTheDocument();
expect(screen.getByText('车辆覆盖:多源')).toBeInTheDocument();
expect(screen.getByText('缺失来源YUTONG_MQTT')).toBeInTheDocument();
expect(screen.getByText('服务状态:来源不完整')).toBeInTheDocument();
@@ -5417,7 +5417,7 @@ 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('据来源JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('据来源JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('查询范围2026-07-03 至 2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹点2有效定位2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('区间里程22.6 km'));
@@ -5443,7 +5443,7 @@ 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('据来源JT808'));
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('定位覆盖率100%'));
@@ -6352,7 +6352,7 @@ test('shows and clears current history filters while keeping vehicle scope', asy
expect(await screen.findByText('当前历史筛选')).toBeInTheDocument();
expect(screen.getByText('车辆VIN-HISTORY-001')).toBeInTheDocument();
expect(screen.getByText('据来源JT808')).toBeInTheDocument();
expect(screen.getByText('据来源JT808')).toBeInTheDocument();
expect(screen.getByText('开始时间2026-07-01 00:00:00')).toBeInTheDocument();
expect(screen.getByText('结束时间2026-07-01 23:59:59')).toBeInTheDocument();
expect(screen.getAllByText('返回字段明细').length).toBeGreaterThanOrEqual(2);