feat(platform): align realtime time window review copy

This commit is contained in:
lingniu
2026-07-05 15:22:14 +08:00
parent b4bcfbb77a
commit d74e52de2e
2 changed files with 14 additions and 14 deletions

View File

@@ -768,7 +768,7 @@ export function Realtime({
onOpenQuality(timeWindowFilters());
};
const copyTimeWindowPackage = () => copyText([
'【客户时间窗监控包】',
'【客户时间窗复盘包】',
`车辆:${timeWindowRow ? [timeWindowRow.plate, timeWindowRow.vin].filter(Boolean).join(' / ') : timeWindowKeyword || '-'}`,
`数据通道:${timeWindowProtocol || '全部数据通道'}`,
`时间窗:${timeWindow.dateFrom}${timeWindow.dateTo}`,
@@ -778,7 +778,7 @@ export function Realtime({
`历史数据:${timeWindowReady ? window.location.origin + window.location.pathname + buildAppHash({ page: 'history-query', keyword: timeWindowKeyword, protocol: timeWindowProtocol, filters: timeWindowFilters({ tab: 'raw', includeFields: 'true' }) }) : '-'}`,
`统计查询:${timeWindowReady ? window.location.origin + window.location.pathname + buildAppHash({ page: 'mileage', keyword: timeWindowKeyword, protocol: timeWindowProtocol, filters: timeWindowFilters() }) : '-'}`,
`告警通知:${timeWindowReady ? window.location.origin + window.location.pathname + buildAppHash({ page: 'alert-events', keyword: timeWindowKeyword, protocol: timeWindowProtocol, filters: timeWindowFilters() }) : '-'}`
].join('\n'), '客户时间窗监控包');
].join('\n'), '客户时间窗复盘包');
const timeWindowWorkItems = [
{
title: '轨迹回放',
@@ -1291,13 +1291,13 @@ export function Realtime({
<Card bordered className="vp-time-window-monitor">
<div className="vp-time-window-summary">
<Space wrap>
<Tag color="blue"></Tag>
<Tag color="blue"></Tag>
<Tag color={timeWindowReady ? 'green' : 'orange'}>{timeWindowReady ? '时间窗可用' : '先选车辆'}</Tag>
<Tag color="grey">{timeWindowDuration}</Tag>
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary">
</Typography.Text>
<Space wrap>
<Button size="small" theme="solid" type="primary" disabled={!timeWindowReady} onClick={openTimeWindowHistory}></Button>
@@ -1343,7 +1343,7 @@ export function Realtime({
className="vp-time-window-action"
disabled={item.disabled}
onClick={item.onClick}
aria-label={`时间窗监控 ${item.title} ${item.action}`}
aria-label={`时间窗复盘 ${item.title} ${item.action}`}
>
<Tag color={item.color}>{item.title}</Tag>
<strong>{item.value}</strong>
@@ -1731,7 +1731,7 @@ export function Realtime({
</Space>
<Typography.Title heading={5} style={{ margin: 0 }}></Typography.Title>
<Typography.Text type="secondary">
线
线
</Typography.Text>
<Space wrap>
<Button size="small" theme="solid" type="primary" onClick={() => applyFilters({ ...filters, online: 'online' })}>线</Button>

View File

@@ -9198,14 +9198,14 @@ test('frames realtime page as one vehicle service with source evidence', async (
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('定位影响1 辆有有效坐标'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('服务影响0 辆降级 / 1 辆超时'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('地图能力:高德地图未配置,使用坐标预览'));
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();
fireEvent.click(screen.getByRole('button', { name: /复制时间窗包/ }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户时间窗监控包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户时间窗复盘包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史数据http://localhost:3000/#/history-query?keyword=VIN-RT-SERVICE&protocol=GB32960'));
fireEvent.click(screen.getByRole('button', { name: '时间窗监控 历史数据 查询历史' }));
fireEvent.click(screen.getByRole('button', { name: '时间窗复盘 历史数据 查询历史' }));
await waitFor(() => {
const params = new URLSearchParams(window.location.hash.split('?')[1] ?? '');
expect(window.location.hash).toContain('#/history-query?');
@@ -9436,12 +9436,12 @@ test('shows realtime freshness status for recently updated and stale vehicles',
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【地图客户决策说明】'));
});
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('定位判断2 辆有有效坐标 / 0 辆无坐标'));
expect(screen.getByText('自定义时间监控')).toBeInTheDocument();
expect(screen.getByText('自定义时间窗复盘')).toBeInTheDocument();
expect(screen.getByText('按车辆和时间窗复盘发生了什么')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /复制时间窗包/ }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户时间窗监控包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户时间窗复盘包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警通知http://localhost:3000/#/alert-events?keyword=VIN-STALE-001&protocol=JT808'));
fireEvent.click(screen.getByRole('button', { name: '时间窗监控 告警通知 查看告警' }));
fireEvent.click(screen.getByRole('button', { name: '时间窗复盘 告警通知 查看告警' }));
await waitFor(() => {
const params = new URLSearchParams(window.location.hash.split('?')[1] ?? '');
expect(window.location.hash).toContain('#/alert-events?');