You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dianshang-qianduan/docs/教师端页面结构.md

64 lines
3.5 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 教师端页面结构
> 用途:快速熟悉教师端(role 3)页面组成。路由定义见 `src/router/index.js` 的 `teacherRoutes`(L529-L737)。
> 页面文件统一位于 `src/views/teacherEnd/`。
## 1. 页面总览
教师端共 **15 个 .vue 文件**:11 个路由页面 + 1 个首页组件 + 3 个 exam 子页(含在路由内)。
### 1.1 菜单页面(Layout 内,sidebar 可见)
| 菜单标题 | 路由 name | 路由 path | 页面文件 | 备注 |
|---|---|---|---|---|
| 院系管理 | `school` | `/school/index` | `school/index.vue` | |
| 专业管理 | `major` | `/major/index` | `major/index.vue` | |
| 班级管理 | `class` | `/class/index` | `class/index.vue` | |
| 教师管理 | `teacher` | `/teacher/index` | `teacher/index.vue` | |
| 学生管理 | `student` | `/student/index` | `student/index.vue` | |
| 实训任务管理 | `trainingTask` | `/trainingTask/index` | `trainingTask/index.vue` | |
| 任务分配(默认实训任务配置) | `defaultTask` | `/defaultTask/index` | `defaultTask/index.vue` | 菜单 icon 显示"任务分配";需 `requiresManagerTeacher`(管理型教师可见) |
| 任务分配 | `task` | `/task/index` | `task/index.vue` | |
| 任务评阅 | `taskReview` | `/task-review/index` | `score/TaskReviewPanel.vue` | 注意:在 score 目录下 |
| 成绩中心 | `score` | `/score/index` | `score/index.vue` | |
### 1.2 综合考核模块(`/exam`,4 个页面)
| 页面 | name | path | 文件 | 是否隐藏 |
|---|---|---|---|---|
| 综合考核列表 | `TeacherExams` | `/exam/index` | `exam/index.vue` | 否 |
| 考试设置 | `TeacherExamEditor` | `/exam/manage/:id` | `exam/editor.vue` | 隐藏 |
| 考试评阅 | `TeacherExamReview` | `/exam/review/:id` | `exam/review.vue` | 隐藏 |
| 考试分析 | `TeacherExamAnalysis` | `/exam/analysis/:id` | `exam/analysis.vue` | 隐藏 |
### 1.3 隐藏路由(无 Layout,全屏独立页)
| 页面 | path | 文件 |
|---|---|---|
| 学生任务预览 | `/task-review-preview` | `taskReview/StudentTaskReadonlyPreview.vue` |
配套辅助文件:`taskReview/studentTaskPreviewMap.js`(任务类型 → 预览组件映射)。
### 1.4 教师端首页(非路由)
- `teacherEnd/index.vue`:教师端首页组件。
- **挂载方式特殊**:不注册路由,由 `src/views/index.vue` 按角色条件渲染(`<teacher v-else-if="role == '3'" />`),同文件还按角色渲染超管/学生首页。
## 2. 路由规则要点(`teacherRoutes`)
- 顶级路由统一 `component: Layout`,`roles: ["teacher"]`,单 children(path: "index")。
- `meta.affix: true` 的页面固定在标签栏;exam 的三个 `:id` 子页 `affix: false` 且 `hidden: true`。
- 唯一例外:`/task-review-preview` 不套 Layout、`hidden: true`,供任务评阅新窗口打开预览。
## 3. 样式约定(重要)
- 教师端 UI 修改**只改 `teacher-light.scss`,不动模板/逻辑**(项目硬约束)。
- 编辑实训任务弹窗样式必须写在 teacher-light.scss 第 15 节 `body.teacher-light-mode .training-task-drawer` 作用域内(drawer teleport 到 body)。
- 表格操作列按钮不换行:`.action-group { flex-wrap:nowrap; white-space:nowrap }` 等(见项目约定)。
- 全局样式修改必须加选择器边界(如 `:not(.studentLayout)`)防止波及学生端/超管端。
## 4. 与其他端的边界
- `platformAdminRoutes`(超管)与 `schoolAdminRoutes`(校管)路由在 teacherRoutes 之后,勿混淆。
- 学生端页面在 `src/views/studentEnd/` 等目录,由 `studentTrainingNavigation.js` 管理,与教师端无关。