前台 — 路由 (router/index.ts)

  - my-timetable 路由的角色从 ['Student'] 扩展为 ['Student', 'Teacher']
  - 新增 teacher-timetable/:teacherId 路由,用于查看指定教师的课表

  前台 — 课表视图 (TimetableView.vue)

  - 新增 isTeacherView 和 isTeacher 计算属性,区分教师个人课表和查看他人课表
  - 教师个人课表:标题显示"我的授课课表",描述改为"展示本人本学期所有授课安排"
  - 查看他人课表:标题显示"教师课表"
  - 两种模式均隐藏资源筛选面板,只保留学期选择
  - 加载逻辑适配教师模式 API

  前台 — 教师档案页 (PersonnelView.vue)

  - 教师行操作列新增 "课表" 按钮(带日历图标),仅在职教师可点击
  - 点击后跳转到该教师的授课课表页面

  前台 — 侧边导航 (AdminLayout.vue)

  - 教师角色可见"我的授课课表"菜单项,与学生的"我的课表"并列
This commit is contained in:
2026-07-25 13:21:06 +08:00 Unverified
parent a081273ac6
commit 7800951aee
5 changed files with 171 additions and 37 deletions
+18 -3
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { Document, Download, Key, Plus, Refresh, Search, Upload } from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
import { Calendar, Document, Download, Key, Plus, Refresh, Search, Upload } from '@element-plus/icons-vue'
import { useRoute, useRouter } from 'vue-router'
import http, { apiErrorMessage } from '../api/http'
import { downloadApiFile, importExcel } from '../api/excel'
import { useAuthStore } from '../stores/auth'
@@ -16,6 +16,7 @@ interface PageResult {
const auth = useAuthStore()
const route = useRoute()
const router = useRouter()
const active = computed<Registry>(() =>
route.meta.registry === 'students' ? 'students' : 'teachers',
)
@@ -341,6 +342,10 @@ async function activateTeacherAccount() {
}
}
function viewTimetable(teacher: any) {
router.push({ name: 'teacher-timetable', params: { teacherId: teacher.id } })
}
onMounted(async () => {
await Promise.all([loadReferences(), load()])
})
@@ -468,7 +473,7 @@ watch(active, async () => {
<el-table-column
v-if="canManage"
label="操作"
:width="active === 'teachers' ? 225 : 145"
:width="active === 'teachers' ? 280 : 145"
fixed="right"
>
<template #default="{ row }">
@@ -482,6 +487,16 @@ watch(active, async () => {
>
激活账号
</el-button>
<el-button
v-if="active === 'teachers'"
link
type="warning"
:icon="Calendar"
:disabled="row.status !== 'Active'"
@click="viewTimetable(row)"
>
课表
</el-button>
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
<el-button link type="danger" @click="remove(row)">删除</el-button>
</template>