刘洋 2 éve
szülő
commit
f5013b865d
1 módosított fájl, 14 hozzáadás és 8 törlés
  1. 14 8
      src/modules/questions/views/ExtractPaperInfo.vue

+ 14 - 8
src/modules/questions/views/ExtractPaperInfo.vue

@@ -507,7 +507,7 @@ export default {
   },
   //初始化
   async created() {
-    await this.getTplList();
+    // await this.getTplList();
     let extractConfigId = this.$route.params.extractConfigId;
     //1.查询考试集合
     this.getExams("");
@@ -515,22 +515,26 @@ export default {
       this.isInsert = true;
       //规则ID存在,表示是修改操作
       this.getExtractConfig(extractConfigId);
+    } else {
+      this.getTplList();
     }
   },
   methods: {
-    async getTplList() {
+    async getTplList(id) {
       let courseId = this.$route.query.courseId;
+      let params = {
+        pageNumber: 1,
+        pageSize: 10000,
+        enable: true,
+        courseId,
+      };
+      !!id && (params.id = id);
       try {
         let res = await this.$http.post(
           QUESTION_API + "/randompaper/page",
           null,
           {
-            params: {
-              pageNumber: 1,
-              pageSize: 10000,
-              enable: true,
-              courseId,
-            },
+            params,
           }
         );
         this.tplList = res.data.content || [];
@@ -1032,6 +1036,8 @@ export default {
           this.extractConfig2.playTime = response.data.playTime || "";
           this.curId = response.data.curId || "";
 
+          this.getTplList(response.data.randomPaperId || "");
+
           //查询该考试下的课程
           this.$http
             .get(