Explorar o código

fix:编辑调卷规则时,随机抽题情形下遗漏了传参id

刘洋 %!s(int64=2) %!d(string=hai) anos
pai
achega
35fc189b27
Modificáronse 1 ficheiros con 27 adicións e 23 borrados
  1. 27 23
      src/modules/questions/views/ExtractPaperInfo.vue

+ 27 - 23
src/modules/questions/views/ExtractPaperInfo.vue

@@ -384,6 +384,7 @@ export default {
         randomPaperId: "", //抽题模板id
         playTime: 1,
       },
+      curId: "",
       randomTplInfo: {
         paperStructOptions: [],
         paperStructType: "",
@@ -839,29 +840,31 @@ export default {
       const { callType, courseCode, examId, examName, examType } =
         this.extractConfig;
       this.loading = true;
-      this.$http
-        .put(QUESTION_API + "/extractConfig/0", {
-          ...this.extractConfig2,
-          callType,
-          courseCode,
-          examId,
-          examName,
-          examType,
-        })
-        .then(
-          () => {
-            this.loading = false;
-            this.$notify({ type: "success", message: "保存成功" });
-            this.back();
-          },
-          (error) => {
-            this.loading = false;
-            this.$notify({
-              type: "error",
-              message: error.response.data.desc,
-            });
-          }
-        );
+      let params = {
+        ...this.extractConfig2,
+        callType,
+        courseCode,
+        examId,
+        examName,
+        examType,
+      };
+      if (this.curId) {
+        params.id = this.curId;
+      }
+      this.$http.put(QUESTION_API + "/extractConfig/0", params).then(
+        () => {
+          this.loading = false;
+          this.$notify({ type: "success", message: "保存成功" });
+          this.back();
+        },
+        (error) => {
+          this.loading = false;
+          this.$notify({
+            type: "error",
+            message: error.response.data.desc,
+          });
+        }
+      );
     },
     //音频播放次数校验
     checkValue(val) {
@@ -1023,6 +1026,7 @@ export default {
 
           this.extractConfig2.randomPaperId = response.data.randomPaperId || "";
           this.extractConfig2.playTime = response.data.playTime || "";
+          this.curId = response.data.curId || "";
 
           //查询该考试下的课程
           this.$http