mirror of
https://github.com/PlayEdu/backend
synced 2025-07-20 02:29:34 +08:00
左侧菜单优化
This commit is contained in:
parent
bbcac7d54a
commit
80428f3c40
@ -30,7 +30,7 @@ const items = [
|
||||
),
|
||||
getItem(
|
||||
"资源管理",
|
||||
"3",
|
||||
"resource",
|
||||
<i className="iconfont icon-icon-file" />,
|
||||
[
|
||||
getItem("视频", "/videos", null, null, null),
|
||||
@ -40,46 +40,41 @@ const items = [
|
||||
),
|
||||
getItem(
|
||||
"课程中心",
|
||||
"4",
|
||||
"courses",
|
||||
<i className="iconfont icon-icon-study" />,
|
||||
[getItem("线上课", "/course", null, null, null)],
|
||||
null
|
||||
),
|
||||
getItem(
|
||||
"学员管理",
|
||||
"5",
|
||||
"user",
|
||||
<i className="iconfont icon-icon-user" />,
|
||||
[
|
||||
getItem("学员", "/member", null, null, null),
|
||||
getItem("部门", "/department", null, null, null),
|
||||
getItem("学员", "/member", null, null, null),
|
||||
],
|
||||
null
|
||||
),
|
||||
getItem(
|
||||
"系统设置",
|
||||
"6",
|
||||
"system",
|
||||
<i className="iconfont icon-icon-setting" />,
|
||||
[
|
||||
getItem("管理人员", "/system/administrator", null, null, null),
|
||||
getItem("系统配置", "/system/index", null, null, null),
|
||||
getItem("角色配置", "/system/adminroles", null, null, null),
|
||||
getItem("系统配置", "/system/index", null, null, null),
|
||||
],
|
||||
null
|
||||
),
|
||||
];
|
||||
|
||||
const children2Parent: any = {
|
||||
"/videos": ["3"],
|
||||
"/images": ["3"],
|
||||
|
||||
"/member": ["4"],
|
||||
"/department": ["4"],
|
||||
|
||||
"/course": ["5"],
|
||||
|
||||
"/system/administrator": ["6"],
|
||||
"/system/adminroles": ["6"],
|
||||
"/system/index": ["6"],
|
||||
"^/video": ["resource"],
|
||||
"^/image": ["resource"],
|
||||
"^/member": ["user"],
|
||||
"^/department": ["user"],
|
||||
"^/course": ["courses"],
|
||||
"^/system": ["system"],
|
||||
};
|
||||
|
||||
export const LeftMenu: React.FC = () => {
|
||||
@ -91,6 +86,12 @@ export const LeftMenu: React.FC = () => {
|
||||
if (children2Parent[location.pathname]) {
|
||||
defaultOpenKeys = children2Parent[location.pathname];
|
||||
}
|
||||
for (let p in children2Parent) {
|
||||
if (location.pathname.search(p) >= 0) {
|
||||
defaultOpenKeys = children2Parent[p];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const onClick = (e: any) => {
|
||||
navigate(e.key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user