|
@@ -53,7 +53,7 @@
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <el-button class="confirm-button" type="primary" @click="onConfirmProblem">确定</el-button>
|
|
|
+ <el-button class="confirm-button" type="primary" @click="onConfirmSubmitProblem">确定</el-button>
|
|
|
<el-button class="confirm-button" plain @click="problemVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -67,7 +67,7 @@
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { debounce } from 'lodash-es'
|
|
|
-import { ElButton, ElRadioGroup, ElRadioButton, ElRadio } from 'element-plus'
|
|
|
+import { ElButton, ElRadioGroup, ElRadioButton, ElRadio, ElMessage } from 'element-plus'
|
|
|
import { minus } from '@/utils/common'
|
|
|
import { useSetImgBg } from '@/hooks/useSetImgBg'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
@@ -204,32 +204,50 @@ const onSubmit: InstanceType<typeof ScoringPanelWithConfirm>['onSubmit'] = async
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/** 提交问题卷 */
|
|
|
-const onConfirmProblem = async () => {
|
|
|
+const onSubmitSimilar = async () => {
|
|
|
+ if (!currentTask.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const markHistory = await useFetch('getMarkHistory').fetch()
|
|
|
+ if (!markHistory.length) {
|
|
|
+ return ElMessage.warning('暂无评卷记录')
|
|
|
+ }
|
|
|
+ return push({
|
|
|
+ name: 'SubmitSimilar',
|
|
|
+ params: { taskId: currentTask.value.taskId },
|
|
|
+ query: {
|
|
|
+ secretNumber: currentTask.value.secretNumber,
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const onSubmitProblem = async () => {
|
|
|
+ if (!currentTask.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ await submitMarkTask({
|
|
|
+ markScore: 0,
|
|
|
+ markScores: [],
|
|
|
+ spentTime: getSpentTime(),
|
|
|
+ problem: true,
|
|
|
+ problemType: problemType.value,
|
|
|
+ taskId: currentTask.value.taskId,
|
|
|
+ })
|
|
|
+ await getNextTask(true)
|
|
|
+ await getMarkStatus()
|
|
|
+}
|
|
|
+
|
|
|
+/** 提交问题卷 & 雷同卷 */
|
|
|
+const onConfirmSubmitProblem = async () => {
|
|
|
try {
|
|
|
if (!currentTask.value) {
|
|
|
return
|
|
|
}
|
|
|
problemVisible.value = false
|
|
|
if (problemClass.value === 'similar') {
|
|
|
- push({
|
|
|
- name: 'SubmitSimilar',
|
|
|
- params: { taskId: currentTask.value.taskId },
|
|
|
- query: {
|
|
|
- secretNumber: currentTask.value.secretNumber,
|
|
|
- },
|
|
|
- })
|
|
|
+ await onSubmitSimilar()
|
|
|
} else {
|
|
|
- await submitMarkTask({
|
|
|
- markScore: 0,
|
|
|
- markScores: [],
|
|
|
- spentTime: getSpentTime(),
|
|
|
- problem: true,
|
|
|
- problemType: problemType.value,
|
|
|
- taskId: currentTask.value.taskId,
|
|
|
- })
|
|
|
- await getNextTask(true)
|
|
|
- await getMarkStatus()
|
|
|
+ await onSubmitProblem()
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error(error)
|