Files
web-Iot/src/pages/Alerts.tsx

67 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-05-07 14:13:26 +08:00
import React, { useState, useEffect } from 'react';
import { Layout, Menu, Typography } from 'antd';
import {
2026-05-07 14:13:26 +08:00
AlertOutlined, ClockCircleOutlined, FileTextOutlined, BarChartOutlined,
SettingOutlined, BellOutlined
2026-04-17 17:20:41 +08:00
} from '@ant-design/icons';
2026-05-07 14:13:26 +08:00
import { getMenuList } from '../api/mune';
import AlarmOverview from '../components/alerts/AlarmOverview';
2026-08-14 09:02:52 +08:00
2026-08-12 11:29:44 +08:00
import { useTranslation } from 'react-i18next';
2026-04-17 17:20:41 +08:00
2026-05-07 14:13:26 +08:00
const { Header, Content } = Layout;
const { Text } = Typography;
2026-04-17 17:20:41 +08:00
2026-05-07 14:13:26 +08:00
export default function AlarmCenterPage() {
2026-08-12 11:29:44 +08:00
const { t } = useTranslation();
2026-05-07 14:13:26 +08:00
const [activeTab, setActiveTab] = useState('overview');
2026-04-17 17:20:41 +08:00
2026-04-28 14:45:07 +08:00
2026-05-07 14:13:26 +08:00
// 渲染对应组件
const renderTabContent = () => {
switch (activeTab) {
case 'overview': return <AlarmOverview />;
2026-08-03 14:22:17 +08:00
2026-05-07 14:13:26 +08:00
}
};
2026-05-07 14:13:26 +08:00
return (
2026-05-14 10:47:56 +08:00
<Layout style={{ minHeight: '100vh', overflow: 'hidden' }}>
2026-05-14 17:23:12 +08:00
<div style={{ display: 'flex', paddingBottom: "4px" }}>
<div style={{ padding: '8px 12px 0' }}>
2026-08-12 11:29:44 +08:00
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>{t('router.alerts')}</Typography.Title>
2026-05-11 10:47:51 +08:00
</div>
2026-05-14 17:23:12 +08:00
<Header style={{ padding: 0, borderBottom: '1px solid #f0f0f0', position: 'sticky', top: 0, zIndex: 10, height: 40, lineHeight: '40px' }}>
2026-05-14 10:47:56 +08:00
{/*<Menu
2026-05-11 10:47:51 +08:00
mode="horizontal"
selectedKeys={[activeTab]}
onClick={({ key }) => setActiveTab(key)}
items={showTabs}
2026-05-14 10:47:56 +08:00
style={{
border: 'none',
2026-05-14 17:23:12 +08:00
height: 40,
lineHeight: '40px',
2026-05-14 10:47:56 +08:00
background: 'transparent !important',
backgroundColor: 'transparent !important',
}}
/>*/}
2026-05-11 10:47:51 +08:00
</Header>
2026-05-07 17:09:19 +08:00
</div>
2026-05-07 14:13:26 +08:00
<Content style={{
2026-05-14 17:23:12 +08:00
maxHeight: 'calc(100vh - 40px)', overflowY: 'auto', background: '#f5f7fa',
2026-05-07 14:13:26 +08:00
scrollbarWidth: 'none', msOverflowStyle: 'none',
}}>
{renderTabContent()}
</Content>
</Layout>
);
2026-04-17 17:20:41 +08:00
}