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 43cbd051..beb83582 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 @@ -254,7 +254,11 @@ test('renders only selectable Semi alert cards on mobile', async () => { expect(view.container.querySelector('.v2-alert-table-scroll.is-mobile-scroll')).toHaveAttribute('tabindex', '0'); expect(view.container.querySelector('.v2-alert-table-scroll.is-mobile-scroll')).toHaveAttribute('aria-label', '告警事件列表,可上下滚动'); expect(view.container.querySelector('.v2-alert-event-table')).not.toBeInTheDocument(); - expect(view.container.querySelectorAll('.v2-alert-kpis .v2-metric-action')).toHaveLength(3); + const mobileMetrics = Array.from(view.container.querySelectorAll('.v2-alert-kpis .v2-metric-action')); + expect(mobileMetrics).toHaveLength(3); + expect(mobileMetrics.map((metric) => metric.textContent)).toEqual(['待处置1', '处理中0', '全部事件1']); + expect(screen.getByRole('button', { name: '筛选待处置,共 1 条' })).toHaveAttribute('aria-pressed', 'false'); + expect(view.container.querySelector('.v2-alert-secondary-states')).not.toBeInTheDocument(); expect(screen.queryByRole('button', { name: /查看未读通知/ })).not.toBeInTheDocument(); expect(screen.getByRole('tab', { name: /站内通知/ })).toBeInTheDocument(); expect(action).toHaveAttribute('aria-expanded', 'false'); 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 0ce5bc8a..62a8e90f 100644 --- a/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx +++ b/vehicle-data-platform/apps/web/src/v2/pages/AlertsPage.tsx @@ -225,12 +225,18 @@ function EventWorkspace({ filters, draft, setDraft, setFilters, rules, unread, e ; - const primaryMetrics = [ - { label: '全部事件', value: allEventCount, tone: 'active', status: '' }, - { label: '未处理', value: sums?.unprocessed, tone: 'unprocessed', status: 'unprocessed' }, - { label: '处理中', value: sums?.processing, tone: 'processing', status: 'processing' }, - ...(mobileLayout ? [] : [{ label: '未读通知', value: unread, tone: 'notice', status: 'notice' }]) - ]; + const primaryMetrics = mobileLayout + ? [ + { label: '待处置', value: sums?.unprocessed, tone: 'unprocessed', status: 'unprocessed' }, + { label: '处理中', value: sums?.processing, tone: 'processing', status: 'processing' }, + { label: '全部事件', value: allEventCount, tone: 'active', status: '' } + ] + : [ + { label: '全部事件', value: allEventCount, tone: 'active', status: '' }, + { label: '未处理', value: sums?.unprocessed, tone: 'unprocessed', status: 'unprocessed' }, + { label: '处理中', value: sums?.processing, tone: 'processing', status: 'processing' }, + { label: '未读通知', value: unread, tone: 'notice', status: 'notice' } + ]; return <> {mobileLayout ?
item.status === 'notice' ? onTab('notifications') : quickStatus(item.status)} />; })} - : null} {events.isError ? events.refetch()} /> : null}
diff --git a/vehicle-data-platform/apps/web/src/v2/styles/workspace.css b/vehicle-data-platform/apps/web/src/v2/styles/workspace.css index d9973dc3..610dd96c 100644 --- a/vehicle-data-platform/apps/web/src/v2/styles/workspace.css +++ b/vehicle-data-platform/apps/web/src/v2/styles/workspace.css @@ -8481,6 +8481,11 @@ font-size: 11px; } + .v2-alert-navigation .v2-alert-tabs > .semi-button:not(.is-active) .v2-segmented-tab-count { + background: #eef2f7; + color: #6e7f95; + } + .v2-alert-navigation-meta { display: none; } @@ -16843,7 +16848,7 @@ } .v2-alert-mobile-discovery > .v2-mobile-filter-toggle.semi-button { - min-height: 58px; + min-height: 52px; margin: 0; } @@ -16957,18 +16962,18 @@ } .v2-alert-context-card.semi-card { - min-height: 96px; + min-height: 58px; } .v2-alert-context-card .v2-alert-kpis { - height: 62px; - min-height: 62px; + height: 58px; + min-height: 58px; grid-template-columns: repeat(3, minmax(0, 1fr)); } .v2-alert-context-card .v2-alert-kpis .v2-metric-action, .v2-alert-context-card .v2-alert-kpis .v2-metric-action-content { - min-height: 62px; + min-height: 58px; } .v2-alert-context-card .v2-alert-kpis .v2-metric-action { @@ -16989,12 +16994,6 @@ color: #28415f; font-size: 18px; } - - .v2-alert-context-card .v2-alert-secondary-states { - min-height: 34px; - grid-template-columns: repeat(3, minmax(0, 1fr)); - padding: 3px 4px; - } } /*