import { Avatar, Divider, Dropdown, theme } from "antd"; import { Icon } from "@nicestack/iconer"; import CollapsibleSection from "../presentation/collapse-section"; import { useAuth } from "@web/src/providers/auth-provider"; import { RolePerms } from "@nicestack/common"; export default function SidebarContent() { const { logout, user, isAuthenticated, hasSomePermissions } = useAuth(); return (
, // link: "/", // }, { key: "trouble", label: "问题列表", icon: , link: "/troubles", }, hasSomePermissions( RolePerms.MANAGE_ANY_DEPT, RolePerms.MANAGE_ANY_STAFF, RolePerms.MANAGE_ANY_ROLE, RolePerms.MANAGE_DOM_STAFF, RolePerms.MANAGE_BASE_SETTING ) && { key: "4", label: "系统设置", icon: , children: [ hasSomePermissions( RolePerms.MANAGE_BASE_SETTING ) && { key: "4-0", icon: , label: "参数配置", link: "/admin/base-setting", }, hasSomePermissions( RolePerms.MANAGE_ANY_TERM, // RolePerms.MANAGE_DOM_TERM ) && { key: "4-1", icon: , label: "分类配置", link: "/admin/term", }, hasSomePermissions( RolePerms.MANAGE_ANY_DEPT ) && { key: "4-5", icon: , label: "组织架构", link: "/admin/department", }, hasSomePermissions( RolePerms.MANAGE_ANY_STAFF, RolePerms.MANAGE_DOM_STAFF ) && { key: "4-6", icon: , label: "用户管理", link: "/admin/staff", }, hasSomePermissions( RolePerms.MANAGE_ANY_ROLE, RolePerms.MANAGE_DOM_ROLE ) && { key: "4-7", icon: , label: "角色管理", link: "/admin/role", }, ].filter(Boolean), }, ].filter(Boolean)}>
); }