diff --git a/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.test.tsx b/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.test.tsx index 7c6c5970..e0087eb5 100644 --- a/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.test.tsx +++ b/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.test.tsx @@ -132,6 +132,9 @@ test('clears old alert rows and inspector evidence when the event scope changes' expect(view.container.querySelector(`.${className}.semi-card`)).toBeInTheDocument(); } expect(view.container.querySelector('.v2-alert-navigation')).toBeInTheDocument(); + expect(screen.getByLabelText('告警中心工作区')).toHaveClass('v2-workspace-command-bar', 'v2-alert-command-bar'); + expect(screen.getByRole('heading', { level: 5, name: '告警处置工作台' })).toBeInTheDocument(); + expect(screen.getByText('核验事件证据、治理规则并追踪通知状态')).toBeInTheDocument(); expect(screen.getByText('可处置事件')).toBeInTheDocument(); expect(screen.queryByRole('heading', { level: 2, name: '告警中心' })).not.toBeInTheDocument(); expect(view.container.querySelector('.v2-alert-inspector')).not.toBeInTheDocument(); diff --git a/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx b/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx index a2ff78a3..c8288e4f 100644 --- a/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx +++ b/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx @@ -10,6 +10,7 @@ import { InlineError, PanelEmpty, PanelLoading } from '../shared/AsyncState'; import { MetricActionButton } from '../shared/MetricActionButton'; import { SegmentedTabs } from '../shared/SegmentedTabs'; import { TablePagination } from '../shared/TablePagination'; +import { WorkspaceCommandBar } from '../shared/WorkspaceCommandBar'; import { WorkspacePanelHeader } from '../shared/WorkspacePanelHeader'; import { WorkspaceFilterPanel } from '../shared/WorkspaceFilterPanel'; import { detailTriggerRow } from '../shared/detailTriggerRow'; @@ -443,5 +444,23 @@ export default function AlertsPage() { const setTab = (next: Tab) => { setTabState(next); const copy = new URLSearchParams(params); copy.set('tab', next); setParams(copy, { replace: true }); }; const setFilters = (next: Filters) => { setFilterState(next); const copy = new URLSearchParams(); if (tab !== 'events') copy.set('tab', tab); Object.entries(next).forEach(([key, value]) => { if (value) copy.set(key, value); }); setParams(copy, { replace: true }); }; const tabs = [{ key: 'events' as const, label: '告警事件', icon: }, ...(admin ? [{ key: 'rules' as const, label: '规则配置', icon: }] : []), { key: 'notifications' as const, label: '站内通知', icon: , count: unread || undefined }]; - return
{operator ? '可处置事件' : '只读查看'}{unread ? `${unread.toLocaleString('zh-CN')} 条未读` : '通知已读'}
{activeTab !== 'notifications' && rules.isError ? rules.refetch()} /> : null}{activeTab === 'rules' && metrics.isError ? metrics.refetch()} /> : null}{activeTab === 'events' ? : activeTab === 'rules' ? : }
; + return
+ {operator ? '可处置事件' : '只读查看'}} + actions={} + /> + {activeTab !== 'notifications' && rules.isError ? rules.refetch()} /> : null} + {activeTab === 'rules' && metrics.isError ? metrics.refetch()} /> : null} + {activeTab === 'events' + ? + : activeTab === 'rules' + ? + : } +
; } diff --git a/vehicle-data-platform/apps/web/src/v2/productionEntry.test.ts b/vehicle-data-platform/apps/web/src/v2/productionEntry.test.ts index 7965cd9e..9ea2b0ff 100644 --- a/vehicle-data-platform/apps/web/src/v2/productionEntry.test.ts +++ b/vehicle-data-platform/apps/web/src/v2/productionEntry.test.ts @@ -165,7 +165,8 @@ describe('V2 production entry', () => { expect(corePageSources.AlertsPage).toContain(' .semi-typography:first-child { + font-size: 14px; +} + +.v2-alert-command-bar .v2-workspace-command-copy > .semi-typography:last-child { + max-width: 310px; + font-size: 10px; +} + +.v2-alert-command-bar .v2-workspace-command-actions { + flex: 1 1 auto; + justify-content: flex-end; + gap: 9px; +} + +.v2-alert-command-bar .v2-workspace-command-actions > .v2-alert-tabs { + order: -1; +} + .v2-alert-navigation .v2-alert-tabs.v2-segmented-tabs { width: auto; min-height: 40px; @@ -7349,6 +7378,22 @@ padding: 4px; } + .v2-alert-command-bar.v2-workspace-command-bar { + display: block; + min-height: 50px; + } + + .v2-alert-command-bar .v2-workspace-command-copy, + .v2-alert-command-bar .v2-workspace-command-actions > .semi-tag, + .v2-alert-command-bar .v2-workspace-command-meta { + display: none; + } + + .v2-alert-command-bar .v2-workspace-command-actions { + display: block; + width: 100%; + } + .v2-alert-navigation .v2-alert-tabs.v2-segmented-tabs { position: static; width: 100%;