教师教学驾驶舱
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
import http from '../api/http'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import StudentDashboardView from './StudentDashboardView.vue'
|
||||
import TeacherDashboardView from './TeacherDashboardView.vue'
|
||||
|
||||
interface DashboardData {
|
||||
audience: {
|
||||
@@ -101,6 +102,10 @@ const isStudentOverview = computed(() =>
|
||||
['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor'].includes(role),
|
||||
),
|
||||
)
|
||||
const isTeacherOverview = computed(() =>
|
||||
roles.value.includes('Teacher') &&
|
||||
!roles.value.some((role) => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor', 'Student'].includes(role)),
|
||||
)
|
||||
const loading = ref(true)
|
||||
const loadError = ref('')
|
||||
const data = ref<DashboardData | null>(null)
|
||||
@@ -397,7 +402,7 @@ async function loadDashboard() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
if (isStudentOverview.value) {
|
||||
if (isStudentOverview.value || isTeacherOverview.value) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
@@ -407,6 +412,7 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<StudentDashboardView v-if="isStudentOverview" />
|
||||
<TeacherDashboardView v-else-if="isTeacherOverview" />
|
||||
|
||||
<div v-else v-loading="loading" class="admin-dashboard">
|
||||
<el-result
|
||||
|
||||
Reference in New Issue
Block a user