xiatian 2 rokov pred
rodič
commit
94fc679f3e

+ 9 - 14
src/modules/questions/views/InsertPaperStructure.vue

@@ -297,6 +297,8 @@ export default {
         this.getCourses(paperStruct.courseName);
         this.paperStruct = paperStruct;
         this.paperDetailStructs = paperStruct.paperDetailStructs;
+      } else {
+        this.getCourses("");
       }
       this.loading = false;
     },
@@ -527,20 +529,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;
+        });
     },
   },
 };

+ 9 - 14
src/modules/questions/views/PaperStructure.vue

@@ -330,20 +330,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 +369,8 @@ export default {
       }
       if (this.formSearch.courseName) {
         this.getCourses(this.formSearch.courseName);
+      } else {
+        this.getCourses("");
       }
       this.searchPaperStructs();
     },