3
This commit is contained in:
1 parent
6c3021ea8d
commit
30d793773c
23 files changed
+3479
-79
No files matched your search
Vendored
+1
@@ -24,6 +24,7 @@ declare module 'vue' {
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { DataAnalysis, OfficeBuilding, Operation, User } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Collection,
|
||||
DataAnalysis,
|
||||
OfficeBuilding,
|
||||
Operation,
|
||||
User,
|
||||
UserFilled,
|
||||
} from '@element-plus/icons-vue'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -14,6 +21,8 @@ const pageTitle = computed(() => {
|
||||
const titles: Record<string, string> = {
|
||||
dashboard: '教务总览',
|
||||
'base-data': '基础数据',
|
||||
personnel: '人员档案',
|
||||
courses: '课程库',
|
||||
users: '用户与权限',
|
||||
}
|
||||
return titles[String(route.name)] ?? '教务管理'
|
||||
@@ -60,6 +69,17 @@ onMounted(() => auth.refresh().catch(() => undefined))
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
<template #title>基础数据</template>
|
||||
</el-menu-item>
|
||||
<el-menu-item
|
||||
v-if="auth.user?.roles.some((role) => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor'].includes(role))"
|
||||
index="/personnel"
|
||||
>
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
<template #title>人员档案</template>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/courses">
|
||||
<el-icon><Collection /></el-icon>
|
||||
<template #title>课程库</template>
|
||||
</el-menu-item>
|
||||
<el-menu-item v-if="auth.isSuperAdmin" index="/users">
|
||||
<el-icon><User /></el-icon>
|
||||
<template #title>用户与权限</template>
|
||||
|
||||
@@ -26,6 +26,19 @@ const router = createRouter({
|
||||
name: 'base-data',
|
||||
component: () => import('../views/BaseDataView.vue'),
|
||||
},
|
||||
{
|
||||
path: 'personnel',
|
||||
name: 'personnel',
|
||||
component: () => import('../views/PersonnelView.vue'),
|
||||
meta: {
|
||||
roles: ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'courses',
|
||||
name: 'courses',
|
||||
component: () => import('../views/CoursesView.vue'),
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
name: 'users',
|
||||
|
||||
Loaded 3 of 23 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user