From 9c7fc197aa9a483ddc9c565c84b7186322780a8f Mon Sep 17 00:00:00 2001 From: shawko Date: Mon, 11 May 2026 20:05:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=96=B0=E5=A2=9E=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E6=89=B9=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/service/question-bank/task-mgr.ts | 7 +++ .../task-mgr/components/Student.vue | 43 ++++++++++++++++++- .../task-mgr/task-mgr-detail.vue | 1 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/playground/src/api/service/question-bank/task-mgr.ts b/playground/src/api/service/question-bank/task-mgr.ts index e89a092..029ae91 100644 --- a/playground/src/api/service/question-bank/task-mgr.ts +++ b/playground/src/api/service/question-bank/task-mgr.ts @@ -66,6 +66,13 @@ class TaskMgrService extends BasicService { }) } + // 重新批改学生试卷 + async regradePaper(recordId: any) { + return await post(`/school/paper/regrade`, { + recordId, + }) + } + // 统计试卷记录学生完成信息 async getListRecordStudentInfo(taskId: any, status: any) { return await get(`/school/recordReport/listRecordStudentInfo`, { diff --git a/playground/src/views/question-bank/task-mgr/components/Student.vue b/playground/src/views/question-bank/task-mgr/components/Student.vue index 4967eea..c1dea65 100644 --- a/playground/src/views/question-bank/task-mgr/components/Student.vue +++ b/playground/src/views/question-bank/task-mgr/components/Student.vue @@ -2,7 +2,7 @@ import { computed, ref } from 'vue' import MdKatex from '@vscode/markdown-it-katex' -import { ElMessage } from 'element-plus' +import { ElMessage, ElMessageBox } from 'element-plus' import MarkdownIt from 'markdown-it' import { uploadImgToPath } from '#/api/global' @@ -26,6 +26,7 @@ const props = defineProps({ default: () => [], }, }) +const emit = defineEmits(['refresh']) const studentDialogVisible = ref(false) const paperRecordDetail = ref({}) const aiReasonMarkdown = new MarkdownIt({ @@ -89,6 +90,7 @@ const rows = computed(() => { gradingStatusText: getGradingStatusText(item), recordId: item?.recordId ?? '', canView, + canRegrade: canView, } }) }) @@ -214,6 +216,35 @@ const handleView = (row: any) => { }) } +const regradingRecordId = ref('') + +async function handleRegrade(row: any) { + if (!row.recordId) { + ElMessage.warning('缺少学生答卷记录ID') + return + } + try { + await ElMessageBox.confirm('确定重新批改该学生试卷吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + } catch { + return + } + + regradingRecordId.value = row.recordId + try { + await taskMgrService.regradePaper(row.recordId) + ElMessage.success('已发起重新批改') + emit('refresh') + } catch { + ElMessage.error('重新批改失败,请重试') + } finally { + regradingRecordId.value = '' + } +} + const correctionDialogVisible = ref(false) const correctionForm = ref({ itemId: 0, @@ -417,7 +448,7 @@ async function submitCorrection() { label="操作" header-align="center" align="center" - width="160" + width="240" > diff --git a/playground/src/views/question-bank/task-mgr/task-mgr-detail.vue b/playground/src/views/question-bank/task-mgr/task-mgr-detail.vue index 9a7af8f..86ae9b0 100644 --- a/playground/src/views/question-bank/task-mgr/task-mgr-detail.vue +++ b/playground/src/views/question-bank/task-mgr/task-mgr-detail.vue @@ -254,6 +254,7 @@ watch( :resource-id="resourceId" :class-id="filterData.classId" :students="studentList" + @refresh="getStudentInfoFun" v-if="situationType === 'student'" />