feat(platform): rename realtime channel columns to evidence
This commit is contained in:
@@ -37,7 +37,7 @@ function vehicleServiceStatus(row: VehicleRealtimeRow) {
|
||||
}
|
||||
|
||||
function sourceEvidenceText(row: VehicleRealtimeRow) {
|
||||
return `${row.onlineSourceCount}/${row.sourceCount} 通道在线`;
|
||||
return `${row.onlineSourceCount}/${row.sourceCount} 来源在线`;
|
||||
}
|
||||
|
||||
function formatPercent(value: number) {
|
||||
@@ -187,11 +187,11 @@ const realtimeExportColumns: CsvColumn<VehicleRealtimeRow>[] = [
|
||||
{ title: '车牌', value: (row) => row.plate },
|
||||
{ title: '手机号', value: (row) => row.phone },
|
||||
{ title: 'OEM', value: (row) => row.oem },
|
||||
{ title: '主要数据通道', value: (row) => row.primaryProtocol },
|
||||
{ title: '数据通道', value: (row) => row.protocols?.join('|') },
|
||||
{ title: '主要来源证据', value: (row) => row.primaryProtocol },
|
||||
{ title: '来源证据', value: (row) => row.protocols?.join('|') },
|
||||
{ title: '在线', value: (row) => row.online ? '在线' : '离线' },
|
||||
{ title: '车辆服务状态', value: (row) => vehicleServiceStatus(row).label },
|
||||
{ title: '通道在线', value: (row) => sourceEvidenceText(row) },
|
||||
{ title: '来源在线', value: (row) => sourceEvidenceText(row) },
|
||||
{ title: '经度', value: (row) => row.longitude },
|
||||
{ title: '纬度', value: (row) => row.latitude },
|
||||
{ title: '速度km/h', value: (row) => row.speedKmh },
|
||||
@@ -826,7 +826,7 @@ export function Realtime({
|
||||
const copyTimeWindowPackage = () => copyText([
|
||||
'【客户时间窗复盘包】',
|
||||
`车辆:${timeWindowRow ? [timeWindowRow.plate, timeWindowRow.vin].filter(Boolean).join(' / ') : timeWindowKeyword || '-'}`,
|
||||
`数据通道:${timeWindowProtocol || '全部数据通道'}`,
|
||||
`来源证据:${timeWindowProtocol || '全部来源证据'}`,
|
||||
`时间窗:${timeWindow.dateFrom} 至 ${timeWindow.dateTo}`,
|
||||
`时间窗判定:${timeWindowDuration}`,
|
||||
`实时状态:${timeWindowRow ? `${vehicleServiceStatus(timeWindowRow).label} / ${dataFreshness(timeWindowRow).detail}` : '未选车辆'}`,
|
||||
@@ -1278,7 +1278,7 @@ export function Realtime({
|
||||
{
|
||||
label: '时间窗复盘',
|
||||
value: mapShiftTimeWindowLabel,
|
||||
detail: timeWindowRow ? `${timeWindowRow.plate || timeWindowRow.vin} / ${timeWindowProtocol || '全部数据通道'}` : '先选择一辆车再复盘。',
|
||||
detail: timeWindowRow ? `${timeWindowRow.plate || timeWindowRow.vin} / ${timeWindowProtocol || '全部来源证据'}` : '先选择一辆车再复盘。',
|
||||
action: '打开轨迹',
|
||||
color: timeWindowReady ? 'blue' as const : 'orange' as const,
|
||||
disabled: !timeWindowReady,
|
||||
@@ -1853,7 +1853,7 @@ export function Realtime({
|
||||
<div className="vp-time-window-target">
|
||||
<span>监控车辆</span>
|
||||
<strong>{timeWindowRow ? [timeWindowRow.plate, timeWindowRow.vin].filter(Boolean).join(' / ') : timeWindowKeyword || '未选择车辆'}</strong>
|
||||
<small>{timeWindowProtocol || '全部数据通道'}</small>
|
||||
<small>{timeWindowProtocol || '全部来源证据'}</small>
|
||||
</div>
|
||||
<label>
|
||||
<span>开始时间</span>
|
||||
@@ -1935,7 +1935,7 @@ export function Realtime({
|
||||
applyFilters(values as Record<string, string>);
|
||||
}}>
|
||||
<Form.Input field="keyword" label="车辆" placeholder="VIN / 车牌 / 手机号 / OEM" style={{ width: 260 }} />
|
||||
<Form.Select field="protocol" label="数据通道" placeholder="全部通道" style={{ width: 160 }}>
|
||||
<Form.Select field="protocol" label="来源证据筛选" placeholder="全部来源证据" style={{ width: 160 }}>
|
||||
<Select.Option value="GB32960">GB32960</Select.Option>
|
||||
<Select.Option value="JT808">JT808</Select.Option>
|
||||
<Select.Option value="YUTONG_MQTT">YUTONG_MQTT</Select.Option>
|
||||
@@ -2525,7 +2525,7 @@ export function Realtime({
|
||||
</Space>
|
||||
<strong>{label}</strong>
|
||||
<span>{issueText}</span>
|
||||
<small>{row.vin} / {protocol || '全部数据通道'} / {row.lastSeen || '-'}</small>
|
||||
<small>{row.vin} / {protocol || '全部来源证据'} / {row.lastSeen || '-'}</small>
|
||||
</div>
|
||||
<div className="vp-realtime-priority-actions">
|
||||
<button type="button" onClick={() => onOpenQuality?.({ keyword: row.vin, protocol })} disabled={!onOpenQuality || !canOpenVehicle(row.vin)} aria-label={`实时处置优先级 ${index + 1} ${label} 查看告警`}>查看告警</button>
|
||||
@@ -2838,7 +2838,7 @@ export function Realtime({
|
||||
{ label: '定位有效', value: locatedCount.toLocaleString(), color: 'green' as const },
|
||||
{ label: '超时车辆', value: staleCount.toLocaleString(), color: staleCount > 0 ? 'orange' as const : 'green' as const },
|
||||
{ label: '需要关注', value: degradedCount.toLocaleString(), color: degradedCount > 0 ? 'orange' as const : 'green' as const },
|
||||
{ label: '数据通道', value: primaryProtocols.size.toLocaleString(), color: 'blue' as const }
|
||||
{ label: '来源证据', value: primaryProtocols.size.toLocaleString(), color: 'blue' as const }
|
||||
].map((item) => (
|
||||
<div key={item.label} className="vp-monitor-metric">
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
@@ -3078,13 +3078,13 @@ export function Realtime({
|
||||
)
|
||||
},
|
||||
{
|
||||
title: '实时通道',
|
||||
title: '实时来源证据',
|
||||
width: 260,
|
||||
render: (_: unknown, row: VehicleRealtimeRow) => (
|
||||
<SourceStatusTags sourceStatus={row.sourceStatus} protocols={row.protocols} lastSeen={row.lastSeen} />
|
||||
)
|
||||
},
|
||||
{ title: '数据覆盖', width: 120, render: (_: unknown, row: VehicleRealtimeRow) => sourceEvidenceText(row) },
|
||||
{ title: '来源覆盖', width: 120, render: (_: unknown, row: VehicleRealtimeRow) => sourceEvidenceText(row) },
|
||||
{ title: '在线', width: 90, render: (_: unknown, row: VehicleRealtimeRow) => <StatusTag status={row.online ? 'ok' : 'offline'} /> },
|
||||
{ title: '最后时间', dataIndex: 'lastSeen', width: 170 },
|
||||
{
|
||||
|
||||
@@ -10595,11 +10595,12 @@ test('frames realtime page as one vehicle service with source evidence', async (
|
||||
expect(screen.getByRole('button', { name: '实时单车服务快照 告警通知 服务正常 查看告警' })).toBeInTheDocument();
|
||||
expect(screen.getAllByText('定位有效').length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('车辆核心数据')).toBeInTheDocument();
|
||||
expect(screen.getByText('实时通道')).toBeInTheDocument();
|
||||
expect(screen.getByText('实时来源证据')).toBeInTheDocument();
|
||||
expect(screen.getByText('来源覆盖')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('2/2 来源在线').length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('GB32960 在线')).toBeInTheDocument();
|
||||
expect(screen.getByText('JT808 在线')).toBeInTheDocument();
|
||||
expect(screen.getByText('YUTONG_MQTT 未接入')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('2/2 通道在线').length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('实时运营影响')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: /复制影响报告/ })).toBeInTheDocument();
|
||||
expect(screen.getAllByText('需要处置').length).toBeGreaterThan(0);
|
||||
|
||||
Reference in New Issue
Block a user