diff --git a/src/App.tsx b/src/layouts/app-layout.tsx similarity index 66% rename from src/App.tsx rename to src/layouts/app-layout.tsx index 527ad04..ac81865 100644 --- a/src/App.tsx +++ b/src/layouts/app-layout.tsx @@ -2,12 +2,13 @@ import type { MenuTheme } from 'antd'; import type { FC } from 'react'; import { AlertFilled, AreaChartOutlined, FileTextFilled, HomeFilled, VideoCameraFilled } from '@ant-design/icons'; +import { Link, Outlet } from '@tanstack/react-router'; import { Layout, Menu, theme } from 'antd'; import { useState } from 'react'; const { Content, Footer, Header, Sider } = Layout; -const App: FC = () => { +export const AppLayout: FC = () => { const { token: { colorBgContainer } } = theme.useToken(); const [menuTheme] = useState('light'); @@ -19,46 +20,48 @@ const App: FC = () => { 实时数据看板, + key: '/dashboard', icon: , theme: menuTheme, }, { - label: '实时设备状态', - key: 'device', + label: 实时设备状态, + key: '/device', icon: , theme: menuTheme, }, { - label: '设备告警记录', - key: 'alarm', + label: 设备告警记录, + key: '/alarm', icon: , theme: menuTheme, }, { - label: '设备性能统计', - key: 'statistics', // analysis + label: 设备性能统计, + key: '/statistics', // analysis icon: , theme: menuTheme, }, { - label: '系统日志记录', - key: 'log', + label: 系统日志记录, + key: '/log', icon: , theme: menuTheme, - } + }, ]} > {/* 内容区域 */} - + +