weiwenhai 6 жил өмнө
parent
commit
2568691604

+ 4 - 0
src/modules/questions/styles/Common.css

@@ -98,3 +98,7 @@
   margin-left: 40%;
 }
 
+.font_length {
+  text-overflow: ellipsis;
+  overflow: hidden;
+}

+ 1 - 1
src/modules/questions/styles/EditPaper.css

@@ -151,5 +151,5 @@ textarea {
   padding: 2px 10px;
   transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
   outline: none;
-  width: 210px;
+  width: 110px;
 }

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

@@ -199,6 +199,7 @@
               remote
               clearable
               placeholder="请选择课程"
+              @focus="e => getCourses(e.target.value)"
             >
               <el-option
                 v-for="item in courseInfoSelect"

+ 1 - 1
src/modules/questions/views/EditPaper.vue

@@ -21,7 +21,7 @@
           <el-tooltip class="item" effect="dark" placement="top-start">
             <div slot="content">{{ paper.name }}</div>
             <input
-              class="paperName-input"
+              class="paperName-input font_length"
               placeholder="试卷名称"
               v-model="paper.name"
             />

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

@@ -276,6 +276,7 @@
               filterable
               clearable
               placeholder="全部"
+              @focus="e => getCourses(e.target.value)"
             >
               <el-option
                 v-for="item in courseInfoSelect"

+ 8 - 13
src/modules/questions/views/ImportPaperInfo.vue

@@ -24,6 +24,7 @@
               clearable
               placeholder="请选择"
               @change="searchCourseName"
+              @focus="e => getCourses(e.target.value)"
             >
               <el-option
                 v-for="item in courseInfoSelect"
@@ -263,19 +264,13 @@ export default {
     //查询所有课程
     getCourses(query) {
       query = query.trim();
-      if (query) {
-        if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
-          this.courseLoading = true;
-          this.$http
-            .get(CORE_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(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .then(response => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+        });
     }
   },
   computed: {

+ 11 - 18
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -61,6 +61,7 @@
                   @change="clearCourseProperty"
                   placeholder="课程名称"
                   size="small"
+                  @focus="e => getCourses(e.target.value)"
                 >
                   <el-option
                     v-for="item in courseInfoSelect"
@@ -595,24 +596,16 @@ export default {
     //查询所有课程
     getCourses(query) {
       query = query.trim();
-      if (query) {
-        if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
-          this.courseLoading = true;
-          this.$http
-            .get(CORE_API + "/course/query?name=" + query + "&enable=true")
-            .then(response => {
-              this.courseList = response.data;
-              this.courseLoading = false;
-              if (this.blueStruct.courseNo) {
-                this.getCoursePropertyList();
-              }
-            });
-        } else {
-          this.getCoursePropertyList();
-        }
-      } else {
-        this.courseList = [];
-      }
+      this.courseLoading = true;
+      this.$http
+        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .then(response => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+          if (this.blueStruct.courseNo) {
+            this.getCoursePropertyList();
+          }
+        });
     },
     clearCourseProperty() {
       this.blueStruct.coursePropertyId = "";

+ 8 - 13
src/modules/questions/views/InsertPaperTitle.vue

@@ -13,6 +13,7 @@
               remote
               placeholder="请输入课程名称(代码)"
               :remote-method="queryCoursesByKeyword"
+              @focus="e => queryCoursesByKeyword(e.target.value)"
             >
               <el-option
                 v-for="item in courseInfoSelect"
@@ -165,19 +166,13 @@ export default {
     //远端查询课程
     queryCoursesByKeyword(query) {
       query = query.trim();
-      if (query) {
-        if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
-          this.courseLoading = true;
-          this.$http
-            .get(CORE_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(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .then(response => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+        });
     },
     //根据课程查询试卷集合
     searchGenPaper() {