教师教学驾驶舱

This commit is contained in:
2026-08-10 10:27:42 +08:00 Unverified
parent 545071a7dd
commit 9ffc5bf67c
2 changed files with 62 additions and 1 deletions
+7 -1
View File
@@ -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