jinxia.mo 5 dni temu
rodzic
commit
96296f23cf

+ 4 - 3
back-ui/src/views/dz/papers/components/paper-full-intelligent.vue

@@ -37,7 +37,7 @@
 </template>
 
 <script setup name="PaperFullIntelligent">
-import { ref, computed } from 'vue'
+import { ref, computed, watch, toValue } from 'vue'
 import consts from "@/utils/consts.js";
 import {useProvidePaperFullCondition} from "@/views/dz/papers/hooks/usePaperFullCondition.js";
 import ClassStatisticTable from "@/views/dz/papers/components/plugs/class-statistic-table.vue";
@@ -101,7 +101,8 @@ const handleSubmit = async (qTypes) => {
     // validation
     if (!batchId.value) return ElMessage.error('请选择批次')
     if (!knowledgeCheckNodes.value.length) return ElMessage.error('请选择知识点')
-    if (!qTypes.value.length || qTypes.value.every(t => !t.count)) return ElMessage.error('请填写题量')
+    // qTypes 已经是过滤后的数组(count > 0),不需要再过滤
+    if (!qTypes || !qTypes.length || qTypes.every(t => !t.count)) return ElMessage.error('请填写题量')
     const classIds = selectedClasses.value.map(c => c.classId)
     if (!classIds.length) return ElMessage.error('请选择班级')
 
@@ -112,7 +113,7 @@ const handleSubmit = async (qTypes) => {
         examType: toValue(examType),
         subjectId: toValue(subjectId),
         knowledgeIds: knowledgeCheckNodes.value.map(k => k.id),
-        types: qTypes.value.map(t => ({
+        types: qTypes.map(t => ({
             type: t.dictValue,
             title: t.dictLabel,
             count: t.count,