刘洋 2 år sedan
förälder
incheckning
6a887c4059

+ 2 - 2
src/modules/oe/views/examScheduling.vue

@@ -126,7 +126,7 @@
             <el-table-column
               label="学习中心"
               prop="orgName"
-              width="120"
+              min-width="120"
             ></el-table-column>
             <el-table-column
               label="课程"
@@ -171,7 +171,7 @@
             <el-table-column
               label="专业"
               prop="specialtyName"
-              width="90"
+              min-width="90"
             ></el-table-column>
 
             <el-table-column

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

@@ -454,8 +454,32 @@ export default {
         this.getCurCallType();
       }
     },
-    "extractConfig2.randomPaperId"(val) {
-      let item = this.tplList.find((v) => v.id == val);
+    "extractConfig2.randomPaperId"() {
+      this.getData();
+    },
+  },
+  //初始化
+  async created() {
+    // await this.getTplList();
+    let extractConfigId = this.$route.params.extractConfigId;
+    //1.查询考试集合
+    this.getExams("");
+    if (extractConfigId) {
+      this.isInsert = true;
+      //规则ID存在,表示是修改操作
+      this.getExtractConfig(extractConfigId);
+    } else {
+      this.getTplList();
+    }
+  },
+  methods: {
+    getData() {
+      if (!this.tplList.length || !this.extractConfig2.randomPaperId) {
+        return;
+      }
+      let item = this.tplList.find(
+        (v) => v.id == this.extractConfig2.randomPaperId
+      );
       this.randomTplInfo.paperStructType = item ? item.paperStructType : "";
 
       let apiUrl = "/api/ecs_ques/paperStruct/1/10000";
@@ -478,20 +502,6 @@ export default {
           this.curStructInfo.difficulty = structItem
             ? structItem.difficulty
             : "";
-
-          // this.$http
-          //   .post(
-          //     "/api/ecs_ques/randompaper/struct/question/view/info",
-          //     qs.stringify({
-          //       paperIds: this.randomTplInfo.paperIds.join(","),
-          //       structId: this.curStructInfo.paperStructId,
-          //     }),
-          //     {
-          //       headers: {
-          //         "content-type": "application/x-www-form-urlencoded",
-          //       },
-          //     }
-          //   )
           this.$http
             .post("/api/ecs_ques/randompaper/struct/question/info", null, {
               params: { structId: this.curStructInfo.paperStructId },
@@ -504,22 +514,6 @@ export default {
         });
       }
     },
-  },
-  //初始化
-  async created() {
-    // await this.getTplList();
-    let extractConfigId = this.$route.params.extractConfigId;
-    //1.查询考试集合
-    this.getExams("");
-    if (extractConfigId) {
-      this.isInsert = true;
-      //规则ID存在,表示是修改操作
-      this.getExtractConfig(extractConfigId);
-    } else {
-      this.getTplList();
-    }
-  },
-  methods: {
     async getTplList(id) {
       let courseId = this.$route.query.courseId;
       let params = {
@@ -538,6 +532,7 @@ export default {
           }
         );
         this.tplList = res.data.content || [];
+        this.getData();
       } catch (e) {
         this.$message.error("获取抽题模板失败");
       }