feat(platform): split trajectory replay and history query

This commit is contained in:
lingniu
2026-07-04 17:23:48 +08:00
parent a65db893d2
commit 747894ce1d
11 changed files with 88 additions and 53 deletions

View File

@@ -142,7 +142,7 @@ function priorityIssueNotificationText(row: QualityIssueRow) {
`详情:${row.detail || '-'}`,
`实时定位:${appURL(buildAppHash({ page: 'realtime', keyword: lookup.key, protocol: row.protocol }))}`,
`轨迹证据:${appURL(buildAppHash({ page: 'history', keyword: filters.keyword, protocol: filters.protocol, filters }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history', keyword: rawFilters.keyword, protocol: rawFilters.protocol, filters: rawFilters }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history-query', keyword: rawFilters.keyword, protocol: rawFilters.protocol, filters: rawFilters }))}`,
`车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: lookup.key, protocol: row.protocol }))}`,
`告警筛选:${appURL(buildAppHash({ page: 'quality', protocol: row.protocol, filters: { issueType: row.issueType } }))}`
].join('\n');

View File

@@ -218,6 +218,7 @@ async function copyText(value: string, label: string) {
}
export function History({
mode = 'trajectory',
initialVin,
initialProtocol,
initialTab,
@@ -227,6 +228,7 @@ export function History({
onOpenMileage,
onOpenRaw
}: {
mode?: 'trajectory' | 'query';
initialVin: string;
initialProtocol?: string;
initialTab?: string;
@@ -359,6 +361,13 @@ export function History({
const playbackIntervalMinutes = isFiniteNumber(playbackSpanMinutes) && locationItems.length > 1 ? playbackSpanMinutes / (locationItems.length - 1) : undefined;
const currentVehicleKeyword = filters.keyword?.trim() ?? '';
const currentProtocol = filters.protocol?.trim() ?? '';
const pageTitle = mode === 'query' ? '历史查询' : '轨迹回放';
const pageDescription = mode === 'query'
? '按车辆查询历史位置、RAW 帧和扁平解析字段,支持分页、字段裁剪和证据导出'
: '按车辆查询历史位置、轨迹回放和 RAW 帧证据,数据来源只作为过滤和诊断维度';
const scopeDescription = mode === 'query'
? '历史位置、RAW 帧和解析字段按当前车辆与来源范围分页查询。'
: '历史位置和 RAW 帧按当前车辆与来源范围查询。';
const amapConfigured = isAMapConfigured();
const selectedFieldCount = splitFields(filters.fields).length;
const playbackRows = validLocations.length > 0 ? validLocations : locationItems;
@@ -487,8 +496,8 @@ export function History({
return (
<div className="vp-page">
<PageHeader
title="轨迹回放"
description="按车辆查询历史位置、轨迹回放和 RAW 帧证据,数据来源只作为过滤和诊断维度"
title={pageTitle}
description={pageDescription}
actions={(
<Button disabled={!currentVehicleKeyword} onClick={() => onOpenVehicle(currentVehicleKeyword, currentProtocol)}>
@@ -498,7 +507,7 @@ export function History({
<div className="vp-scope-bar">
<span className="vp-scope-label">{currentVehicleKeyword || '-'}</span>
<Tag color={currentProtocol ? 'blue' : 'green'}>{currentProtocol || '全部来源'}</Tag>
<Typography.Text type="tertiary"> RAW </Typography.Text>
<Typography.Text type="tertiary">{scopeDescription}</Typography.Text>
</div>
<Card bordered>
<Form key={JSON.stringify(filters)} initValues={filters} layout="horizontal" onSubmit={(values) => submit(values)}>

View File

@@ -278,7 +278,7 @@ function priorityIssueNotificationText(row: PriorityIssueRow) {
`详情:${row.detail || '-'}`,
`实时定位:${appURL(buildAppHash({ page: 'realtime', keyword: lookup.key, protocol: row.protocol }))}`,
`轨迹证据:${appURL(buildAppHash({ page: 'history', keyword: lookup.key, protocol: row.protocol, filters: evidenceFilters }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history', keyword: lookup.key, protocol: row.protocol, filters: { tab: 'raw', ...evidenceFilters, includeFields: 'true' } }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history-query', keyword: lookup.key, protocol: row.protocol, filters: { tab: 'raw', ...evidenceFilters, includeFields: 'true' } }))}`,
`车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: lookup.key, protocol: row.protocol }))}`,
`告警筛选:${qualityShareURL()}`
].join('\n');
@@ -335,7 +335,7 @@ function priorityIssueTicketText(row: PriorityIssueRow) {
`验收标准:${acceptanceCriteria(row)}`,
`实时定位:${appURL(buildAppHash({ page: 'realtime', keyword: lookup.key, protocol: row.protocol }))}`,
`轨迹证据:${appURL(buildAppHash({ page: 'history', keyword: lookup.key, protocol: row.protocol, filters: evidenceFilters }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history', keyword: lookup.key, protocol: row.protocol, filters: { tab: 'raw', ...evidenceFilters, includeFields: 'true' } }))}`,
`RAW证据${appURL(buildAppHash({ page: 'history-query', keyword: lookup.key, protocol: row.protocol, filters: { tab: 'raw', ...evidenceFilters, includeFields: 'true' } }))}`,
`车辆服务:${appURL(buildAppHash({ page: 'detail', keyword: lookup.key, protocol: row.protocol }))}`,
`告警筛选:${qualityShareURL()}`
].join('\n');

View File

@@ -346,7 +346,7 @@ export function VehicleDetail({
onOpenRaw(filters.keyword, filters.protocol);
};
const vehicleServiceURL = (hash: string) => `${window.location.origin}${window.location.pathname}${hash}`;
const vehicleServiceHash = (page: 'detail' | 'realtime' | 'history' | 'mileage', filters?: Record<string, string>) => buildAppHash({
const vehicleServiceHash = (page: 'detail' | 'realtime' | 'history' | 'history-query' | 'mileage', filters?: Record<string, string>) => buildAppHash({
page,
keyword: resolvedVIN,
protocol: activeProtocol,
@@ -380,7 +380,7 @@ export function VehicleDetail({
`车辆服务:${vehicleServiceURL(vehicleServiceHash('detail'))}`,
`实时:${vehicleServiceURL(vehicleServiceHash('realtime'))}`,
`轨迹:${vehicleServiceURL(vehicleServiceHash('history'))}`,
`RAW${vehicleServiceURL(vehicleServiceHash('history', { tab: 'raw', includeFields: 'true' }))}`,
`RAW${vehicleServiceURL(vehicleServiceHash('history-query', { tab: 'raw', includeFields: 'true' }))}`,
`里程:${vehicleServiceURL(vehicleServiceHash('mileage'))}`
];
copyText(lines.join('\n'), '诊断摘要');