Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
145c0912
提交
145c0912
authored
6月 14, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 增加菜单权限控制
上级
a2e8f8e4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
24 行增加
和
5 行删除
+24
-5
menus.ts
src/assets/menus.ts
+19
-1
Aside.vue
src/components/layout/Aside.vue
+3
-3
Header.vue
src/components/layout/Header.vue
+1
-1
types.ts
src/types.ts
+1
-0
没有找到文件。
src/assets/menus.ts
浏览文件 @
145c0912
...
@@ -2,21 +2,30 @@ import type { IMenuItem } from '@/types'
...
@@ -2,21 +2,30 @@ import type { IMenuItem } from '@/types'
import
{
VideoCamera
,
Suitcase
,
Collection
,
Files
,
Monitor
,
Edit
,
User
,
Filter
,
Coordinate
,
Notebook
,
Picture
}
from
'@element-plus/icons-vue'
import
{
VideoCamera
,
Suitcase
,
Collection
,
Files
,
Monitor
,
Edit
,
User
,
Filter
,
Coordinate
,
Notebook
,
Picture
}
from
'@element-plus/icons-vue'
export
const
menus
:
IMenuItem
[]
=
[
export
const
menus
:
IMenuItem
[]
=
[
{
{
tag
:
'v1-resource'
,
name
:
'资源管理'
,
name
:
'资源管理'
,
path
:
'/resource'
,
path
:
'/resource'
,
children
:
[
children
:
[
{
{
tag
:
'v1-resource-video-list'
,
icon
:
VideoCamera
,
icon
:
VideoCamera
,
name
:
'视频'
,
name
:
'视频'
,
path
:
'/resource/video'
path
:
'/resource/video'
},
},
{
icon
:
Suitcase
,
name
:
'课件'
,
path
:
'/resource/courseware'
},
{
{
tag
:
'v1-resource-courseware-list'
,
icon
:
Suitcase
,
name
:
'课件'
,
path
:
'/resource/courseware'
},
{
tag
:
'v1-resource-lesson-plan-list'
,
icon
:
Collection
,
icon
:
Collection
,
name
:
'教案'
,
name
:
'教案'
,
path
:
'/resource/lessonplan'
path
:
'/resource/lessonplan'
},
},
{
{
tag
:
'v1-resource-other-information-list'
,
icon
:
Files
,
icon
:
Files
,
name
:
'其他资料'
,
name
:
'其他资料'
,
path
:
'/resource/other'
path
:
'/resource/other'
...
@@ -32,15 +41,18 @@ export const menus: IMenuItem[] = [
...
@@ -32,15 +41,18 @@ export const menus: IMenuItem[] = [
]
]
},
},
{
{
tag
:
'v1-course'
,
name
:
'课程管理'
,
name
:
'课程管理'
,
path
:
'/course'
,
path
:
'/course'
,
children
:
[
children
:
[
{
{
tag
:
'v1-course-list'
,
icon
:
Monitor
,
icon
:
Monitor
,
name
:
'我的课程'
,
name
:
'我的课程'
,
path
:
'/course/my'
path
:
'/course/my'
},
},
{
{
tag
:
'v1-course-create'
,
icon
:
Edit
,
icon
:
Edit
,
name
:
'新建课程'
,
name
:
'新建课程'
,
path
:
'/course/create'
path
:
'/course/create'
...
@@ -48,15 +60,18 @@ export const menus: IMenuItem[] = [
...
@@ -48,15 +60,18 @@ export const menus: IMenuItem[] = [
]
]
},
},
{
{
tag
:
'v1-backend'
,
name
:
'后台管理'
,
name
:
'后台管理'
,
path
:
'/admin'
,
path
:
'/admin'
,
children
:
[
children
:
[
{
{
tag
:
'v1-backend-lecturer-list'
,
icon
:
User
,
icon
:
User
,
name
:
'讲师管理'
,
name
:
'讲师管理'
,
path
:
'/admin/teacher'
path
:
'/admin/teacher'
},
},
{
{
tag
:
'v1-backend-category-list'
,
icon
:
Filter
,
icon
:
Filter
,
name
:
'类别管理'
,
name
:
'类别管理'
,
path
:
'/admin/category'
path
:
'/admin/category'
...
@@ -69,15 +84,18 @@ export const menus: IMenuItem[] = [
...
@@ -69,15 +84,18 @@ export const menus: IMenuItem[] = [
]
]
},
},
{
{
tag
:
'v1-backend'
,
name
:
'系统管理'
,
name
:
'系统管理'
,
path
:
'/system'
,
path
:
'/system'
,
children
:
[
children
:
[
{
{
tag
:
'v1-backend-data-dictionary-list'
,
icon
:
Notebook
,
icon
:
Notebook
,
name
:
'数据字典'
,
name
:
'数据字典'
,
path
:
'/system/dictionary'
path
:
'/system/dictionary'
},
},
{
{
tag
:
'v1-backend-cover-list'
,
icon
:
Picture
,
icon
:
Picture
,
name
:
'封面管理'
,
name
:
'封面管理'
,
path
:
'/system/cover'
path
:
'/system/cover'
...
...
src/components/layout/Aside.vue
浏览文件 @
145c0912
...
@@ -34,15 +34,15 @@ const defaultActive = computed(() => {
...
@@ -34,15 +34,15 @@ const defaultActive = computed(() => {
<nav
class=
"nav"
>
<nav
class=
"nav"
>
<el-menu
:default-active=
"defaultActive"
:router=
"true"
class=
"app-menu"
>
<el-menu
:default-active=
"defaultActive"
:router=
"true"
class=
"app-menu"
>
<template
v-for=
"item in menuList"
:key=
"item.path"
>
<template
v-for=
"item in menuList"
:key=
"item.path"
>
<el-sub-menu
:index=
"item.path"
v-if=
"item.children"
>
<el-sub-menu
:index=
"item.path"
v-
permission=
"item.tag"
v-
if=
"item.children"
>
<template
#
title
>
<template
#
title
>
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{
item
.
name
}}
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{
item
.
name
}}
</
template
>
</
template
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
>
<el-menu-item
:index=
"subitem.path"
v-for=
"subitem in item.children"
:key=
"subitem.path"
v-permission=
"subitem.tag"
>
{{ subitem.name }}
{{ subitem.name }}
</el-menu-item>
</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item
:index=
"item.path"
v-else
>
<el-menu-item
:index=
"item.path"
v-
permission=
"item.tag"
v-
else
>
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{ item.name }}
<el-icon><component
:is=
"item.icon"
></component></el-icon>
{{ item.name }}
</el-menu-item>
</el-menu-item>
</template>
</template>
...
...
src/components/layout/Header.vue
浏览文件 @
145c0912
...
@@ -35,7 +35,7 @@ function genNavClassName(data: IMenuItem) {
...
@@ -35,7 +35,7 @@ function genNavClassName(data: IMenuItem) {
<h1
class=
"app-name"
>
统一资源管理平台
</h1>
<h1
class=
"app-name"
>
统一资源管理平台
</h1>
</div>
</div>
<div
class=
"app-header-nav"
>
<div
class=
"app-header-nav"
>
<div
class=
"app-header-nav-item"
v-for=
"(item, index) in menus"
:key=
"index"
:class=
"genNavClassName(item)"
>
<div
class=
"app-header-nav-item"
v-for=
"(item, index) in menus"
:key=
"index"
:class=
"genNavClassName(item)"
v-permission=
"item.tag"
>
<router-link
:to=
"item.path"
>
{{
item
.
name
}}
</router-link>
<router-link
:to=
"item.path"
>
{{
item
.
name
}}
</router-link>
</div>
</div>
</div>
</div>
...
...
src/types.ts
浏览文件 @
145c0912
import
type
{
Component
}
from
'vue'
import
type
{
Component
}
from
'vue'
export
interface
IMenuItem
{
export
interface
IMenuItem
{
tag
?:
string
name
:
string
name
:
string
path
:
string
path
:
string
icon
?:
Component
icon
?:
Component
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论