zhangjie 2 жил өмнө
parent
commit
94980c050d

+ 1 - 0
src/modules/questions/views/CheckDuplicateList.vue

@@ -551,6 +551,7 @@ export default {
           firstPropertyId: "",
           secondPropertyId: "",
         };
+        this.getCourses("");
       }
       this.searchQues();
     },

+ 1 - 0
src/modules/questions/views/GenPaperDetail.vue

@@ -783,6 +783,7 @@ export default {
       })
       .finally(() => {});
     this.searchPaper();
+    this.searchPaperStructs();
   },
   methods: {
     frozenChange(val, paperId) {

+ 1 - 0
src/modules/questions/views/ImportPaperInfo.vue

@@ -181,6 +181,7 @@ export default {
       key: this.user.key,
       token: this.user.token,
     };
+    this.getCourses("");
   },
   mounted() {
     setTimeout(() => {

+ 11 - 15
src/modules/questions/views/InsertPaperStructure.vue

@@ -54,8 +54,9 @@
             remote
             clearable
             placeholder="请选择"
+            @clear="getCourses('')"
           >
-            <el-option key="" label="公用" value=""></el-option>
+            <el-option label="公用" :value="-1"></el-option>
             <el-option
               v-for="item in courseInfoSelect"
               :key="item.courseId"
@@ -297,6 +298,8 @@ export default {
         this.getCourses(paperStruct.courseName);
         this.paperStruct = paperStruct;
         this.paperDetailStructs = paperStruct.paperDetailStructs;
+      } else {
+        this.getCourses("");
       }
       this.loading = false;
     },
@@ -527,20 +530,13 @@ export default {
     },
     //查询所有课程
     getCourses(query) {
-      query = query.trim();
-      if (query) {
-        if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
-          this.courseLoading = true;
-          this.$http
-            .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
-            .then((response) => {
-              this.courseList = response.data;
-              this.courseLoading = false;
-            });
-        }
-      } else {
-        this.courseList = [];
-      }
+      this.courseLoading = true;
+      this.$http
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
+        .then((response) => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+        });
     },
   },
 };

+ 1 - 0
src/modules/questions/views/InsertPaperTitle.vue

@@ -235,6 +235,7 @@ export default {
         );
       }
     });
+    this.queryCoursesByKeyword("");
   },
   methods: {
     //远端查询课程

+ 12 - 16
src/modules/questions/views/PaperStructure.vue

@@ -23,10 +23,11 @@
             filterable
             :remote-method="getCourses"
             remote
+            clearable
             placeholder="请选择"
+            @clear="getCourses('')"
           >
-            <el-option key="ALL" label="请选择" value="ALL"></el-option>
-            <el-option key label="公用" value></el-option>
+            <el-option label="公用" value="-1"></el-option>
             <el-option
               v-for="item in courseInfoSelect"
               :key="item.courseId"
@@ -330,20 +331,13 @@ export default {
     },
     //查询所有课程
     getCourses(query) {
-      query = query.trim();
-      if (query) {
-        if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
-          this.courseLoading = true;
-          this.$http
-            .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
-            .then((response) => {
-              this.courseList = response.data;
-              this.courseLoading = false;
-            });
-        }
-      } else {
-        this.courseList = [];
-      }
+      this.courseLoading = true;
+      this.$http
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
+        .then((response) => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+        });
     },
     getType(val) {
       if (val == "ENSEMBLE") {
@@ -376,6 +370,8 @@ export default {
       }
       if (this.formSearch.courseName) {
         this.getCourses(this.formSearch.courseName);
+      } else {
+        this.getCourses("");
       }
       this.searchPaperStructs();
     },

+ 3 - 0
src/modules/questions/views/Question.vue

@@ -630,6 +630,7 @@ export default {
           secondPropertyId: "",
         };
         this.currentPage = 1;
+        this.getCourses("");
       } else {
         this.formSearch = JSON.parse(sessionStorage.getItem("question"));
         this.currentPage = parseInt(
@@ -637,6 +638,8 @@ export default {
         );
         if (this.formSearch && this.formSearch.courseId) {
           this.getCourseById(this.formSearch.courseId);
+        } else {
+          this.getCourses("");
         }
       }
       this.searchQues();