优化:修复侧栏滚动与权限管理位置 (#77)

## 本次改动

- 修复小屏时左侧导航无法滚动、末尾菜单不可见的问题
- 将“权限管理”调整至“监控审计”板块之前

## 范围

仅修改 `src/app/(main)/layout.tsx`。

---------

Co-authored-by: linkeyu <798648091@qq.com>
Reviewed-on: #77
Co-authored-by: linkeyu <linkeyu@wonderable.ai>
Co-committed-by: linkeyu <linkeyu@wonderable.ai>
This commit was merged in pull request #77.
This commit is contained in:
2026-07-27 11:36:20 +08:00
committed by guke
parent c055cd705d
commit dd28307413
+14 -4
View File
@@ -91,6 +91,7 @@ const NAV_GROUPS: NavGroup[] = [
{ key: '/users', icon: <UserOutlined />, label: '用户管理' },
],
},
{ key: '/admins', icon: <TeamOutlined />, label: '权限管理' },
{
key: 'monitoring-audit',
icon: <FileSearchOutlined />,
@@ -103,7 +104,6 @@ const NAV_GROUPS: NavGroup[] = [
{ key: '/audit-logs', icon: <FileSearchOutlined />, label: '审计日志' },
],
},
{ key: '/admins', icon: <TeamOutlined />, label: '权限管理' },
];
// 导航项 key(/dashboard)→ 权限页 key(dashboard),与后端 permissions.py 目录对齐
@@ -223,8 +223,7 @@ export default function MainLayout({ children }: { children: React.ReactNode })
position: 'sticky',
top: 0,
height: '100vh',
overflowY: 'auto',
overflowX: 'hidden',
overflow: 'hidden',
}}
>
<nav className={`side-nav${collapsed ? ' side-nav-collapsed' : ''}`} aria-label="后台导航">
@@ -314,8 +313,19 @@ export default function MainLayout({ children }: { children: React.ReactNode })
.side-nav {
display: flex;
flex-direction: column;
box-sizing: border-box;
gap: 4px;
padding: 0 10px 14px;
height: calc(100vh - 48px);
min-height: 0;
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
padding: 0 10px 20px;
scrollbar-gutter: stable;
-webkit-overflow-scrolling: touch;
}
.side-nav:focus-within {
scroll-behavior: smooth;
}
.nav-group {
padding: 6px 0 8px;