feat(platform): refine vehicle operations language

This commit is contained in:
lingniu
2026-07-05 00:31:58 +08:00
parent 0613fe9f7b
commit 74ccddb1a7
4 changed files with 49 additions and 49 deletions

View File

@@ -30,11 +30,11 @@ const navGroups = [
] ]
}, },
{ {
title: '查询分析', title: '轨迹与统计',
items: [ items: [
{ itemKey: 'history', text: '轨迹回放', icon: <IconMapPin /> }, { itemKey: 'history', text: '轨迹回放', icon: <IconMapPin /> },
{ itemKey: 'history-query', text: '历史查询', icon: <IconHistogram /> }, { itemKey: 'history-query', text: '数据导出', icon: <IconHistogram /> },
{ itemKey: 'mileage', text: '统计查询', icon: <IconBarChartHStroked /> } { itemKey: 'mileage', text: '里程统计', icon: <IconBarChartHStroked /> }
] ]
}, },
{ {
@@ -133,7 +133,7 @@ export function AppShell({
<span className="vp-brand-mark" /> <span className="vp-brand-mark" />
<span className="vp-brand-copy"> <span className="vp-brand-copy">
<span></span> <span></span>
<span> / </span> <span> / / </span>
</span> </span>
</div> </div>
<div className="vp-nav-groups"> <div className="vp-nav-groups">
@@ -180,8 +180,8 @@ export function AppShell({
<Button size="small" aria-label="顶部地图态势" onClick={() => onChange('map')}></Button> <Button size="small" aria-label="顶部地图态势" onClick={() => onChange('map')}></Button>
<Button size="small" aria-label="顶部实时监控" onClick={() => onChange('realtime')}></Button> <Button size="small" aria-label="顶部实时监控" onClick={() => onChange('realtime')}></Button>
<Button size="small" aria-label="顶部轨迹回放" onClick={() => onChange('history')}></Button> <Button size="small" aria-label="顶部轨迹回放" onClick={() => onChange('history')}></Button>
<Button size="small" aria-label="顶部历史查询" onClick={() => onChange('history-query')}></Button> <Button size="small" aria-label="顶部数据导出" onClick={() => onChange('history-query')}></Button>
<Button size="small" aria-label="顶部统计查询" onClick={() => onChange('mileage')}></Button> <Button size="small" aria-label="顶部里程统计" onClick={() => onChange('mileage')}></Button>
<Button <Button
size="small" size="small"
aria-label={`顶部${alertLabel}`} aria-label={`顶部${alertLabel}`}

View File

@@ -225,7 +225,7 @@ function realtimeOperationsSummaryText({
`当前筛选:${realtimeFilterSummary(filters).join('') || '全部实时车辆'}`, `当前筛选:${realtimeFilterSummary(filters).join('') || '全部实时车辆'}`,
`车辆总数:${total.toLocaleString()},当前页:${rows.length.toLocaleString()}`, `车辆总数:${total.toLocaleString()},当前页:${rows.length.toLocaleString()}`,
`在线车辆:${onlineCount.toLocaleString()},定位有效:${locatedCount.toLocaleString()}`, `在线车辆:${onlineCount.toLocaleString()},定位有效:${locatedCount.toLocaleString()}`,
`降级服务${degradedCount.toLocaleString()}来源类型${sourceTypeCount.toLocaleString()}`, `需要关注${degradedCount.toLocaleString()}数据通道${sourceTypeCount.toLocaleString()}`,
`地图配置:${amapConfigured ? '已配置' : '未配置'}`, `地图配置:${amapConfigured ? '已配置' : '未配置'}`,
'重点车辆:', '重点车辆:',
issueLines, issueLines,
@@ -364,13 +364,13 @@ function realtimeDutyHandoffText({
}) })
.slice(0, 8); .slice(0, 8);
const lines = [ const lines = [
'【实时值班交接包】', '【实时运营交接包】',
`当前筛选:${realtimeFilterSummary(filters).join('') || '全部实时车辆'}`, `当前筛选:${realtimeFilterSummary(filters).join('') || '全部实时车辆'}`,
`页面车辆:${rows.length.toLocaleString()} / 总计 ${total.toLocaleString()};版本:${runtimeRelease || '未标记'}`, `页面车辆:${rows.length.toLocaleString()} / 总计 ${total.toLocaleString()};版本:${runtimeRelease || '未标记'}`,
`在线:${onlineCount.toLocaleString()};离线:${(rows.length - onlineCount).toLocaleString()};定位有效:${locatedCount.toLocaleString()}降级${degradedCount.toLocaleString()};超时:${staleCount.toLocaleString()}来源类型${sourceTypeCount.toLocaleString()}`, `在线:${onlineCount.toLocaleString()};离线:${(rows.length - onlineCount).toLocaleString()};定位有效:${locatedCount.toLocaleString()}需要关注${degradedCount.toLocaleString()};超时:${staleCount.toLocaleString()}数据通道${sourceTypeCount.toLocaleString()}`,
`地图:${amapConfigured ? '高德已配置' : '高德未配置'}`, `地图:${amapConfigured ? '高德已配置' : '高德未配置'}`,
`来源覆盖:${sourceLines.length > 0 ? sourceLines.join('') : '当前页暂无来源明细'}`, `车辆覆盖:${sourceLines.length > 0 ? sourceLines.join('') : '当前页暂无来源明细'}`,
`值班入口:${appURL(buildAppHash({ page: 'realtime', protocol: filters.protocol, filters }))}`, `实时入口:${appURL(buildAppHash({ page: 'realtime', protocol: filters.protocol, filters }))}`,
'' ''
]; ];
if (sampleRows.length === 0) { if (sampleRows.length === 0) {
@@ -663,7 +663,7 @@ export function Realtime({
sourceTypeCount: primaryProtocols.size, sourceTypeCount: primaryProtocols.size,
amapConfigured, amapConfigured,
runtimeRelease: runtime?.platformRelease runtimeRelease: runtime?.platformRelease
}), '实时值班交接包'); }), '实时运营交接包');
const realtimeImpactLevel = degradedCount > 0 || staleCount > 0 || rows.length - onlineCount > 0 ? '需要处置' : '实时稳定'; const realtimeImpactLevel = degradedCount > 0 || staleCount > 0 || rows.length - onlineCount > 0 ? '需要处置' : '实时稳定';
const realtimeImpactColor = realtimeImpactLevel === '实时稳定' ? 'green' as const : degradedCount > 0 || staleCount > 0 ? 'orange' as const : 'blue' as const; const realtimeImpactColor = realtimeImpactLevel === '实时稳定' ? 'green' as const : degradedCount > 0 || staleCount > 0 ? 'orange' as const : 'blue' as const;
const realtimeImpactItems = [ const realtimeImpactItems = [
@@ -780,9 +780,9 @@ export function Realtime({
{ label: '在线车辆', value: onlineCount, color: 'green' as const, action: () => applyFilters({ ...filters, online: 'online' }) }, { label: '在线车辆', value: onlineCount, color: 'green' as const, action: () => applyFilters({ ...filters, online: 'online' }) },
{ label: '离线车辆', value: rows.length - onlineCount, color: rows.length - onlineCount > 0 ? 'orange' as const : 'green' as const, action: () => applyFilters({ ...filters, online: 'offline' }) }, { label: '离线车辆', value: rows.length - onlineCount, color: rows.length - onlineCount > 0 ? 'orange' as const : 'green' as const, action: () => applyFilters({ ...filters, online: 'offline' }) },
{ label: '定位有效', value: locatedCount, color: locatedCount > 0 ? 'blue' as const : 'orange' as const }, { label: '定位有效', value: locatedCount, color: locatedCount > 0 ? 'blue' as const : 'orange' as const },
{ label: '降级服务', value: degradedCount, color: degradedCount > 0 ? 'orange' as const : 'green' as const, action: () => applyFilters({ ...filters, serviceStatus: 'degraded' }) }, { label: '需要关注', value: degradedCount, color: degradedCount > 0 ? 'orange' as const : 'green' as const, action: () => applyFilters({ ...filters, serviceStatus: 'degraded' }) },
{ label: '更新超时', value: staleCount, color: staleCount > 0 ? 'red' as const : 'green' as const }, { label: '更新超时', value: staleCount, color: staleCount > 0 ? 'red' as const : 'green' as const },
{ label: '来源类型', value: primaryProtocols.size, color: 'blue' as const } { label: '数据通道', value: primaryProtocols.size, color: 'blue' as const }
].map((item) => ( ].map((item) => (
item.action ? ( item.action ? (
<button <button
@@ -809,7 +809,7 @@ export function Realtime({
<div className="vp-current-action-list"> <div className="vp-current-action-list">
{degradedCount > 0 ? ( {degradedCount > 0 ? (
<Button size="small" theme="light" type="warning" onClick={() => applyFilters({ ...filters, serviceStatus: 'degraded' })}> <Button size="small" theme="light" type="warning" onClick={() => applyFilters({ ...filters, serviceStatus: 'degraded' })}>
{degradedCount.toLocaleString()} {degradedCount.toLocaleString()}
</Button> </Button>
) : <Tag color="green"></Tag>} ) : <Tag color="green"></Tag>}
{staleCount > 0 ? <Tag color="red"> {staleCount.toLocaleString()}</Tag> : <Tag color="green"></Tag>} {staleCount > 0 ? <Tag color="red"> {staleCount.toLocaleString()}</Tag> : <Tag color="green"></Tag>}
@@ -822,16 +822,16 @@ export function Realtime({
</div> </div>
</div> </div>
<div className="vp-source-coverage-board"> <div className="vp-source-coverage-board">
<div className="vp-current-service-title"></div> <div className="vp-current-service-title"></div>
<div className="vp-source-coverage-grid"> <div className="vp-source-coverage-grid">
{sourceCoverageRows.length === 0 ? ( {sourceCoverageRows.length === 0 ? (
<Typography.Text type="tertiary"></Typography.Text> <Typography.Text type="tertiary"></Typography.Text>
) : sourceCoverageRows.map((item) => ( ) : sourceCoverageRows.map((item) => (
<button <button
key={item.protocol} key={item.protocol}
type="button" type="button"
className="vp-source-coverage-item" className="vp-source-coverage-item"
aria-label={`筛选协议 ${item.protocol}`} aria-label={`筛选数据通道 ${item.protocol}`}
onClick={() => applyFilters({ ...filters, protocol: item.protocol })} onClick={() => applyFilters({ ...filters, protocol: item.protocol })}
> >
<div className="vp-source-coverage-item-head"> <div className="vp-source-coverage-item-head">
@@ -859,7 +859,7 @@ export function Realtime({
<Tag color="green">{onlineCount.toLocaleString()} 线</Tag> <Tag color="green">{onlineCount.toLocaleString()} 线</Tag>
<Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时摘要" onClick={copyRealtimeSummary}></Button> <Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时摘要" onClick={copyRealtimeSummary}></Button>
<Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时异常处置清单" onClick={copyRealtimeIssueChecklist}></Button> <Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时异常处置清单" onClick={copyRealtimeIssueChecklist}></Button>
<Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时值班交接包" onClick={copyRealtimeDutyHandoff}></Button> <Button size="small" theme="light" icon={<IconCopy />} aria-label="复制实时运营交接包" onClick={copyRealtimeDutyHandoff}></Button>
</Space> </Space>
</div> </div>
<VehicleMap <VehicleMap
@@ -876,8 +876,8 @@ export function Realtime({
{ label: '在线车辆', value: onlineCount.toLocaleString(), color: 'green' as const }, { label: '在线车辆', value: onlineCount.toLocaleString(), color: 'green' as const },
{ label: '定位有效', value: locatedCount.toLocaleString(), color: 'green' as const }, { label: '定位有效', value: locatedCount.toLocaleString(), color: 'green' as const },
{ label: '超时车辆', value: staleCount.toLocaleString(), color: staleCount > 0 ? 'orange' as const : '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: 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) => ( ].map((item) => (
<div key={item.label} className="vp-monitor-metric"> <div key={item.label} className="vp-monitor-metric">
<Tag color={item.color}>{item.label}</Tag> <Tag color={item.color}>{item.label}</Tag>
@@ -885,7 +885,7 @@ export function Realtime({
</div> </div>
))} ))}
<Typography.Text type="secondary"> <Typography.Text type="secondary">
Web JS Key Key 线
</Typography.Text> </Typography.Text>
{selectedMapRow ? ( {selectedMapRow ? (
<div className="vp-selected-vehicle-panel"> <div className="vp-selected-vehicle-panel">
@@ -915,7 +915,7 @@ export function Realtime({
</div> </div>
) : null} ) : null}
<div className="vp-map-integration-panel"> <div className="vp-map-integration-panel">
<div className="vp-map-service-queue-title"></div> <div className="vp-map-service-queue-title"></div>
{mapIntegrationRows.map((item) => ( {mapIntegrationRows.map((item) => (
<div key={item.label} className="vp-map-integration-row"> <div key={item.label} className="vp-map-integration-row">
<div> <div>
@@ -927,7 +927,7 @@ export function Realtime({
))} ))}
</div> </div>
<div className="vp-source-consistency-panel"> <div className="vp-source-consistency-panel">
<div className="vp-map-service-queue-title"></div> <div className="vp-map-service-queue-title"></div>
{sourceIssueRows.length === 0 ? ( {sourceIssueRows.length === 0 ? (
<Typography.Text type="tertiary"></Typography.Text> <Typography.Text type="tertiary"></Typography.Text>
) : ( ) : (

View File

@@ -120,7 +120,7 @@ const vehicleExportColumns: CsvColumn<VehicleCoverageRow>[] = [
{ title: 'OEM', value: (row) => row.oem }, { title: 'OEM', value: (row) => row.oem },
{ title: '来源', value: (row) => row.protocols?.join('|') }, { title: '来源', value: (row) => row.protocols?.join('|') },
{ title: '缺失来源', value: (row) => row.missingProtocols?.join('|') }, { title: '缺失来源', value: (row) => row.missingProtocols?.join('|') },
{ title: '来源覆盖', value: (row) => sourceEvidenceText(row) }, { title: '车辆覆盖', value: (row) => sourceEvidenceText(row) },
{ title: '服务状态', value: (row) => vehicleServiceStatus(row).label }, { title: '服务状态', value: (row) => vehicleServiceStatus(row).label },
{ title: '诊断摘要', value: (row) => sourceDiagnosisText(row) }, { title: '诊断摘要', value: (row) => sourceDiagnosisText(row) },
{ title: '档案完整度', value: (row) => vehicleArchiveCompleteness(row).label }, { title: '档案完整度', value: (row) => vehicleArchiveCompleteness(row).label },
@@ -150,7 +150,7 @@ function vehicleFilterSummary(filters: Record<string, string>) {
return [ return [
filters.keyword ? `关键词:${filters.keyword}` : '', filters.keyword ? `关键词:${filters.keyword}` : '',
filters.protocol ? `数据来源:${filters.protocol}` : '', filters.protocol ? `数据来源:${filters.protocol}` : '',
filters.coverage ? `来源覆盖:${coverageLabel[filters.coverage] ?? filters.coverage}` : '', filters.coverage ? `车辆覆盖:${coverageLabel[filters.coverage] ?? filters.coverage}` : '',
filters.missingProtocol ? `缺失来源:${filters.missingProtocol}` : '', filters.missingProtocol ? `缺失来源:${filters.missingProtocol}` : '',
filters.serviceStatus ? `服务状态:${serviceStatusLabel[filters.serviceStatus] ?? filters.serviceStatus}` : '', filters.serviceStatus ? `服务状态:${serviceStatusLabel[filters.serviceStatus] ?? filters.serviceStatus}` : '',
filters.online ? `在线:${onlineLabel[filters.online] ?? filters.online}` : '', filters.online ? `在线:${onlineLabel[filters.online] ?? filters.online}` : '',
@@ -654,7 +654,7 @@ export function Vehicles({
return ( return (
<div className="vp-page"> <div className="vp-page">
<PageHeader title="车辆服务" description="以 VIN 为主对象维护车辆身份、数据来源覆盖、在线状态和绑定状态" /> <PageHeader title="车辆服务" description="以 VIN 为主对象维护车辆身份、车辆覆盖、在线状态和绑定状态" />
<Card bordered> <Card bordered>
<Form key={JSON.stringify(filters)} initValues={filters} layout="horizontal" onSubmit={(values) => { <Form key={JSON.stringify(filters)} initValues={filters} layout="horizontal" onSubmit={(values) => {
const nextFilters = values as Record<string, string>; const nextFilters = values as Record<string, string>;
@@ -666,7 +666,7 @@ export function Vehicles({
<Select.Option value="JT808">JT808</Select.Option> <Select.Option value="JT808">JT808</Select.Option>
<Select.Option value="YUTONG_MQTT">YUTONG_MQTT</Select.Option> <Select.Option value="YUTONG_MQTT">YUTONG_MQTT</Select.Option>
</Form.Select> </Form.Select>
<Form.Select field="coverage" label="来源覆盖" placeholder="全部" style={{ width: 130 }}> <Form.Select field="coverage" label="车辆覆盖" placeholder="全部" style={{ width: 130 }}>
<Select.Option value="single"></Select.Option> <Select.Option value="single"></Select.Option>
<Select.Option value="multi"></Select.Option> <Select.Option value="multi"></Select.Option>
</Form.Select> </Form.Select>

View File

@@ -21,9 +21,9 @@ test('renders vehicle platform shell', () => {
render(<App />); render(<App />);
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.getByText('查询分析')).toBeInTheDocument(); expect(screen.getByText('轨迹与统计')).toBeInTheDocument();
expect(screen.getAllByText('告警通知').length).toBeGreaterThanOrEqual(1); expect(screen.getAllByText('告警通知').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('系统运维')).toBeInTheDocument(); expect(screen.getByText('系统运维')).toBeInTheDocument();
expect(screen.getAllByText('运营驾驶舱').length).toBeGreaterThanOrEqual(1); expect(screen.getAllByText('运营驾驶舱').length).toBeGreaterThanOrEqual(1);
@@ -197,11 +197,11 @@ test('exposes AMap operations shortcuts when map key is configured', async () =>
expect(window.location.hash).toBe('#/realtime'); expect(window.location.hash).toBe('#/realtime');
fireEvent.click(screen.getByRole('button', { name: '顶部轨迹回放' })); fireEvent.click(screen.getByRole('button', { name: '顶部轨迹回放' }));
expect(window.location.hash.startsWith('#/history')).toBe(true); expect(window.location.hash.startsWith('#/history')).toBe(true);
fireEvent.click(screen.getByRole('button', { name: '顶部历史查询' })); fireEvent.click(screen.getByRole('button', { name: '顶部数据导出' }));
expect(window.location.hash.startsWith('#/history-query')).toBe(true); expect(window.location.hash.startsWith('#/history-query')).toBe(true);
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('tab')).toBe('raw'); expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('tab')).toBe('raw');
expect(await screen.findByRole('heading', { name: '历史查询' })).toBeInTheDocument(); expect(await screen.findByRole('heading', { name: '历史查询' })).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '顶部统计查询' })); fireEvent.click(screen.getByRole('button', { name: '顶部里程统计' }));
expect(window.location.hash.startsWith('#/mileage')).toBe(true); expect(window.location.hash.startsWith('#/mileage')).toBe(true);
fireEvent.click(await screen.findByRole('button', { name: '顶部告警事件正常' })); fireEvent.click(await screen.findByRole('button', { name: '顶部告警事件正常' }));
expect(window.location.hash).toBe('#/alert-events'); expect(window.location.hash).toBe('#/alert-events');
@@ -2340,7 +2340,7 @@ test('shows and clears current vehicle service filters', async () => {
expect(await screen.findByText('当前车辆筛选')).toBeInTheDocument(); expect(await screen.findByText('当前车辆筛选')).toBeInTheDocument();
expect(screen.getByText('关键词粤A')).toBeInTheDocument(); expect(screen.getByText('关键词粤A')).toBeInTheDocument();
expect(screen.getByText('数据来源JT808')).toBeInTheDocument(); expect(screen.getByText('数据来源JT808')).toBeInTheDocument();
expect(screen.getByText('来源覆盖:多源')).toBeInTheDocument(); expect(screen.getByText('车辆覆盖:多源')).toBeInTheDocument();
expect(screen.getByText('缺失来源YUTONG_MQTT')).toBeInTheDocument(); expect(screen.getByText('缺失来源YUTONG_MQTT')).toBeInTheDocument();
expect(screen.getByText('服务状态:来源不完整')).toBeInTheDocument(); expect(screen.getByText('服务状态:来源不完整')).toBeInTheDocument();
expect(screen.getByText('在线:在线')).toBeInTheDocument(); expect(screen.getByText('在线:在线')).toBeInTheDocument();
@@ -9160,13 +9160,13 @@ test('copies realtime operations summary from realtime page', async () => {
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: '实时筛选 离线车辆 1' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '实时筛选 离线车辆 1' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '实时筛选 降级服务 2' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: '实时筛选 需要关注 2' })).toBeInTheDocument();
expect(screen.getByText('建议处置')).toBeInTheDocument(); expect(screen.getByText('建议处置')).toBeInTheDocument();
expect(screen.getByText('排查降级服务 2')).toBeInTheDocument(); expect(screen.getByText('查看需关注车辆 2')).toBeInTheDocument();
expect(screen.getByText('协议地图覆盖')).toBeInTheDocument(); expect(screen.getByText('车辆覆盖概览')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '筛选协议 GB32960' })).toHaveTextContent('GB32960'); expect(screen.getByRole('button', { name: '筛选数据通道 GB32960' })).toHaveTextContent('GB32960');
expect(screen.getByRole('button', { name: '筛选协议 JT808' })).toHaveTextContent('2 辆'); expect(screen.getByRole('button', { name: '筛选数据通道 JT808' })).toHaveTextContent('2 辆');
expect(screen.getByRole('button', { name: '筛选协议 YUTONG_MQTT' })).toHaveTextContent('超时 1'); expect(screen.getByRole('button', { name: '筛选数据通道 YUTONG_MQTT' })).toHaveTextContent('超时 1');
expect(screen.getByText('实时覆盖判读')).toBeInTheDocument(); expect(screen.getByText('实时覆盖判读')).toBeInTheDocument();
expect(screen.getByText('在线率')).toBeInTheDocument(); expect(screen.getByText('在线率')).toBeInTheDocument();
expect(screen.getAllByText('66.7%').length).toBeGreaterThanOrEqual(3); expect(screen.getAllByText('66.7%').length).toBeGreaterThanOrEqual(3);
@@ -9180,7 +9180,7 @@ test('copies realtime operations summary from realtime page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选数据来源JT808在线在线')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选数据来源JT808在线在线'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆总数3当前页3')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆总数3当前页3'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线车辆2定位有效2')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线车辆2定位有效2'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('降级服务2来源类型3')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('需要关注2数据通道3'));
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('粤A摘要3 / YUTONG_MQTT / 车辆离线')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('粤A摘要3 / YUTONG_MQTT / 车辆离线'));
@@ -9197,18 +9197,18 @@ test('copies realtime operations summary from realtime page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时监控http://localhost:3000/#/realtime?keyword=VIN-RT-SUMMARY-003&protocol=JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时监控http://localhost:3000/#/realtime?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放http://localhost:3000/#/history?keyword=VIN-RT-SUMMARY-003&protocol=JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放http://localhost:3000/#/history?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件http://localhost:3000/#/alert-events?keyword=VIN-RT-SUMMARY-003&protocol=JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件http://localhost:3000/#/alert-events?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
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('页面车辆3 / 总计 3版本')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('页面车辆3 / 总计 3版本'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线2离线1定位有效2降级2超时')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线2离线1定位有效2需要关注2超时'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('来源覆盖GB32960在线 1/1实时 1/1JT808在线 1/2实时 2/2YUTONG_MQTT在线 0/1实时 1/1')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆覆盖GB32960在线 1/1实时 1/1JT808在线 1/2实时 2/2YUTONG_MQTT在线 0/1实时 1/1'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('值班入口http://localhost:3000/#/realtime?protocol=JT808&online=online')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时入口http://localhost:3000/#/realtime?protocol=JT808&online=online'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-RT-SUMMARY-003&protocol=JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程统计http://localhost:3000/#/mileage?keyword=VIN-RT-SUMMARY-003&protocol=JT808')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程统计http://localhost:3000/#/mileage?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史RAWhttp://localhost:3000/api/history/raw-frames?protocol=JT808&vin=VIN-RT-SUMMARY-003&limit=20&includeFields=true')); expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史RAWhttp://localhost:3000/api/history/raw-frames?protocol=JT808&vin=VIN-RT-SUMMARY-003&limit=20&includeFields=true'));
fireEvent.click(screen.getByRole('button', { name: '实时筛选 降级服务 2' })); fireEvent.click(screen.getByRole('button', { name: '实时筛选 需要关注 2' }));
expect(window.location.hash).toBe('#/realtime?protocol=JT808&serviceStatus=degraded&online=online'); expect(window.location.hash).toBe('#/realtime?protocol=JT808&serviceStatus=degraded&online=online');
fireEvent.click(screen.getByRole('button', { name: '筛选协议 GB32960' })); fireEvent.click(screen.getByRole('button', { name: '筛选数据通道 GB32960' }));
expect(window.location.hash).toBe('#/realtime?protocol=GB32960&serviceStatus=degraded&online=online'); expect(window.location.hash).toBe('#/realtime?protocol=GB32960&serviceStatus=degraded&online=online');
}); });
@@ -9313,7 +9313,7 @@ test('shows production AMap integration status on realtime page', async () => {
render(<App />); render(<App />);
expect(await screen.findByText('地图接入状态')).toBeInTheDocument(); expect(await screen.findByText('地图能力状态')).toBeInTheDocument();
expect(screen.getByText('Web JS Key')).toBeInTheDocument(); expect(screen.getByText('Web JS Key')).toBeInTheDocument();
expect(screen.getByText('服务端 API Key')).toBeInTheDocument(); expect(screen.getByText('服务端 API Key')).toBeInTheDocument();
expect(screen.getAllByText('已配置').length).toBeGreaterThan(0); expect(screen.getAllByText('已配置').length).toBeGreaterThan(0);
@@ -9682,7 +9682,7 @@ test('surfaces multi-source realtime consistency issues with quality drilldown',
render(<App />); render(<App />);
expect(await screen.findByText('多来源一致性检查')).toBeInTheDocument(); expect(await screen.findByText('车辆数据一致性检查')).toBeInTheDocument();
expect(screen.getAllByText('粤A一致监控').length).toBeGreaterThan(0); expect(screen.getAllByText('粤A一致监控').length).toBeGreaterThan(0);
expect(screen.getByText('一致性诊断YUTONG_MQTT 离线GB32960/JT808 仍可支撑车辆服务')).toBeInTheDocument(); expect(screen.getByText('一致性诊断YUTONG_MQTT 离线GB32960/JT808 仍可支撑车辆服务')).toBeInTheDocument();
expect(screen.getByText('一致性YUTONG_MQTT 离线')).toBeInTheDocument(); expect(screen.getByText('一致性YUTONG_MQTT 离线')).toBeInTheDocument();