feat(platform): promote alert events surface

This commit is contained in:
lingniu
2026-07-04 17:58:33 +08:00
parent eb8f15ca18
commit 1235e76c32
11 changed files with 135 additions and 70 deletions

View File

@@ -16,7 +16,7 @@ import { useState } from 'react';
import type { VehicleSourceConsistency, VehicleServiceStatus } from '../api/types';
import { isAMapConfigured } from '../config/appConfig';
export type PageKey = 'dashboard' | 'vehicles' | 'map' | 'realtime' | 'detail' | 'history' | 'history-query' | 'mileage' | 'quality' | 'notification-rules' | 'ops-quality';
export type PageKey = 'dashboard' | 'vehicles' | 'map' | 'realtime' | 'detail' | 'history' | 'history-query' | 'mileage' | 'alert-events' | 'quality' | 'notification-rules' | 'ops-quality';
const navItems = [
{ itemKey: 'dashboard', text: '运营驾驶舱', icon: <IconHome /> },
@@ -27,7 +27,7 @@ const navItems = [
{ itemKey: 'history', text: '轨迹回放', icon: <IconMapPin /> },
{ itemKey: 'history-query', text: '历史查询', icon: <IconHistogram /> },
{ itemKey: 'mileage', text: '统计分析', icon: <IconBarChartHStroked /> },
{ itemKey: 'quality', text: '告警事件', icon: <IconHistogram /> },
{ itemKey: 'alert-events', text: '告警事件', icon: <IconHistogram /> },
{ itemKey: 'notification-rules', text: '通知规则', icon: <IconBell /> },
{ itemKey: 'ops-quality', text: '运维质量', icon: <IconPulse /> }
];
@@ -93,6 +93,7 @@ export function AppShell({
const amapConfigured = isAMapConfigured();
const alertLabel = alertButtonLabel(linkIssueCount, activeAlertRuleCount, p0AlertRuleCount);
const alertClassName = alertButtonClassName(linkIssueCount, activeAlertRuleCount, p0AlertRuleCount);
const selectedPage = activePage === 'quality' ? 'alert-events' : activePage;
const search = () => {
const value = keyword.trim();
@@ -113,7 +114,7 @@ export function AppShell({
<span></span>
</div>
<Nav
selectedKeys={[activePage]}
selectedKeys={[selectedPage]}
items={navItems}
onSelect={({ itemKey }) => onChange(itemKey as PageKey)}
style={{ maxWidth: '100%' }}
@@ -159,7 +160,7 @@ export function AppShell({
size="small"
aria-label={`顶部${alertLabel}`}
className={alertClassName}
onClick={() => onChange('quality')}
onClick={() => onChange('alert-events')}
>
{alertLabel}
</Button>