Files
web-Iot/src/pages/Alerts.tsx
2026-08-31 12:40:23 +08:00

67 lines
1.7 KiB
TypeScript

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