fix(teacher): 检查学生作业完成状态后再跳转记录页
防止未完成作业的学生跳转到记录页面,添加完成状态检查并提示
Showing
1 changed file
with
8 additions
and
1 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-11-19 21:00:00 | 2 | * @Date: 2025-11-19 21:00:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-15 11:39:57 | 4 | + * @LastEditTime: 2025-12-15 13:21:41 |
| 5 | * @FilePath: /mlaj/src/views/teacher/taskHomePage.vue | 5 | * @FilePath: /mlaj/src/views/teacher/taskHomePage.vue |
| 6 | * @Description: 教师端作业主页(头部介绍、统计、日历与学生完成情况) | 6 | * @Description: 教师端作业主页(头部介绍、统计、日历与学生完成情况) |
| 7 | --> | 7 | --> |
| ... | @@ -125,6 +125,7 @@ import checkCorner from '@/assets/images/dui.png' | ... | @@ -125,6 +125,7 @@ import checkCorner from '@/assets/images/dui.png' |
| 125 | import { getTeacherTaskDetailAPI } from '@/api/teacher' | 125 | import { getTeacherTaskDetailAPI } from '@/api/teacher' |
| 126 | import { getCheckinTeacherCheckedDatesAPI } from '@/api/checkin' | 126 | import { getCheckinTeacherCheckedDatesAPI } from '@/api/checkin' |
| 127 | import dayjs from 'dayjs' | 127 | import dayjs from 'dayjs' |
| 128 | +import { showToast } from 'vant' | ||
| 128 | 129 | ||
| 129 | const $route = useRoute() | 130 | const $route = useRoute() |
| 130 | const $router = useRouter() | 131 | const $router = useRouter() |
| ... | @@ -443,6 +444,12 @@ const go_student_record = (stu) => { | ... | @@ -443,6 +444,12 @@ const go_student_record = (stu) => { |
| 443 | if (task_type.value === 'checkin') { | 444 | if (task_type.value === 'checkin') { |
| 444 | return | 445 | return |
| 445 | } | 446 | } |
| 447 | + | ||
| 448 | + if (!stu.completed) { | ||
| 449 | + showToast('该学员未完成该作业') | ||
| 450 | + return | ||
| 451 | + } | ||
| 452 | + | ||
| 446 | // 跳转到作业记录页面 | 453 | // 跳转到作业记录页面 |
| 447 | $router.push({ | 454 | $router.push({ |
| 448 | name: 'StudentRecord', | 455 | name: 'StudentRecord', | ... | ... |
-
Please register or login to post a comment