实验预约
This commit is contained in:
@@ -49,6 +49,10 @@ const isStatisticsViewer = computed(() =>
|
||||
),
|
||||
)
|
||||
|
||||
const canUseExperiments = computed(() =>
|
||||
hasAnyRole(['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Teacher', 'Student']),
|
||||
)
|
||||
|
||||
function hasAnyRole(allowedRoles: string[]) {
|
||||
return roles.value.some((role) => allowedRoles.includes(role))
|
||||
}
|
||||
@@ -72,6 +76,17 @@ const navigationGroups = computed<NavigationGroup[]>(() => [
|
||||
items: [{ path: '/statistics', label: '统计报表' }],
|
||||
} as NavigationGroup]
|
||||
: []),
|
||||
...(canUseExperiments.value
|
||||
? [{
|
||||
key: 'experiments',
|
||||
label: isStudent.value ? '我的实验' : '实验管理',
|
||||
direct: true,
|
||||
items: [{
|
||||
path: '/experiments',
|
||||
label: isStudent.value ? '我的实验' : '实验管理',
|
||||
}],
|
||||
} as NavigationGroup]
|
||||
: []),
|
||||
{
|
||||
key: 'organization',
|
||||
label: '组织与权限',
|
||||
|
||||
Reference in New Issue
Block a user