前台 — 路由 (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:
biss committed 2026-07-25 13:21:06 +08:00
1 parent a081273ac6
commit 7800951aee
5 files changed
+171 -37

No files matched your search

+1 -1
View File
@@ -104,7 +104,7 @@ const navigationGroups = computed<NavigationGroup[]>(() => [
hasAnyRole(['SuperAdmin', 'AcademicAdmin']),
{ path: '/schedules', label: '排课与课表' },
),
...whenVisible(isStudent.value, { path: '/my-timetable', label: '我的课表' }),
...whenVisible(isStudent.value || isTeacher.value, { path: '/my-timetable', label: isTeacher.value ? '我的授课课表' : '我的课表' }),
...whenVisible(isStudent.value, { path: '/free-classrooms', label: '空闲教室' }),
...whenVisible(!isStudent.value, {
path: '/class-timetable',
+7 -1
View File
@@ -141,7 +141,13 @@ const router = createRouter({
path: 'my-timetable',
name: 'my-timetable',
component: () => import('../views/TimetableView.vue'),
meta: { roles: ['Student'], mine: true },
meta: { roles: ['Student', 'Teacher'], mine: true },
},
{
path: 'teacher-timetable/:teacherId',
name: 'teacher-timetable',
component: () => import('../views/TimetableView.vue'),
meta: { teacherView: true },
},
{
path: 'free-classrooms',
+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>
Loaded 3 of 5 files, more files were not shown because too many files have changed in this diff. Show more