feat: 新增系统配置/用户管理页面,重构页面目录结构为 /xxx/index.tsx

This commit is contained in:
2026-05-15 14:05:34 +08:00
parent f31c459610
commit 790b6905ef
9 changed files with 68 additions and 11 deletions

View File

@@ -3,16 +3,11 @@ import { Layout, Menu } from 'antd';
import { useState } from 'react';
import { Outlet, useLocation, useNavigate } from 'react-router';
import { routes } from '../routes';
import { toMenuItems } from '../routes/utils';
const { Header, Sider, Content } = Layout;
const menuItems = routes
.filter((r) => !r.hideInMenu)
.map((r) => ({
key: r.path,
icon: r.icon,
label: r.label,
}));
const menuItems = toMenuItems(routes);
const RootLayout = () => {
const navigate = useNavigate();
@@ -42,6 +37,7 @@ const RootLayout = () => {
<Menu
mode="inline"
selectedKeys={[location.pathname]}
defaultOpenKeys={menuItems.map((item) => item.key)}
items={menuItems}
onClick={({ key }) => navigate(key)}
style={{ height: '100%', borderRight: 0, paddingBottom: 48 }}