From 9ffc5bf67c19aab9c85a297e053db2d39bf48e3a Mon Sep 17 00:00:00 2001 From: biss Date: Mon, 10 Aug 2026 10:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=95=99=E5=AD=A6=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/DashboardView.vue | 8 +++- web/src/views/TeacherDashboardView.vue | 55 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 web/src/views/TeacherDashboardView.vue diff --git a/web/src/views/DashboardView.vue b/web/src/views/DashboardView.vue index f2477bd..aa0a956 100644 --- a/web/src/views/DashboardView.vue +++ b/web/src/views/DashboardView.vue @@ -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(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 () => {