chore: base layout

This commit is contained in:
2025-08-01 06:37:40 +08:00
parent aee201b741
commit 4a642c24d2

View File

@@ -1,22 +1,20 @@
import type { MenuTheme } from 'antd';
import type { FC } from 'react';
import { AlertFilled, AreaChartOutlined, HomeFilled, VideoCameraFilled } from '@ant-design/icons';
import { Button, Layout, Menu, theme, Typography } from 'antd';
import { AlertFilled, AreaChartOutlined, FileTextFilled, HomeFilled, VideoCameraFilled } from '@ant-design/icons';
import { Layout, Menu, theme } from 'antd';
import { useState } from 'react';
const { Content, Footer, Header, Sider } = Layout;
const { Title } = Typography;
const App: FC = () => {
const { token: { colorBgContainer } } = theme.useToken();
const [menuTheme] = useState<MenuTheme>('light');
const [count, setCount] = useState(0);
return (
<Layout style={{ height: '100%' }}>
<Header style={{ background: colorBgContainer }}>
<Title level={2}></Title>
<h2 style={{ fontWeight: 'bold' }}></h2>
</Header>
<Layout>
<Sider collapsible defaultCollapsed collapsedWidth={64} trigger={null} style={{ background: colorBgContainer }}>
@@ -44,23 +42,23 @@ const App: FC = () => {
theme: menuTheme,
},
{
label: '设备性能统计',
key: 'statistics', // analysis
icon: <AreaChartOutlined />,
theme: menuTheme,
},
{
label: '系统日志记录',
key: 'log',
icon: <FileTextFilled />,
theme: menuTheme,
}
]}
>
</Menu>
</Sider>
<Content style={{ overflow: 'auto' }}>
{/* 内容区域 */}
<Button onClick={() => setCount(count + 1)}>{`count is ${count}`}</Button>
<div style={{ width: '300px', height: '300px', margin: '50px', backgroundColor: 'cadetblue' }}>Content</div>
<div style={{ width: '300px', height: '300px', margin: '50px', backgroundColor: 'cadetblue' }}>Content</div>
<div style={{ width: '300px', height: '300px', margin: '50px', backgroundColor: 'cadetblue' }}>Content</div>
<div style={{ width: '300px', height: '300px', margin: '50px', backgroundColor: 'cadetblue' }}>Content</div>
<div style={{ width: '300px', height: '300px', margin: '50px', backgroundColor: 'cadetblue' }}>Content</div>
<div>Bottom</div>
{/* 内容区域 */}
<Content style={{ overflow: 'auto', background: colorBgContainer }}>
</Content>
</Layout>
<Footer style={{ background: colorBgContainer }}>