3
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user