wyq 4 vuotta sitten
vanhempi
commit
32e3b2cef0
1 muutettua tiedostoa jossa 17 lisäystä ja 9 poistoa
  1. 17 9
      src/components/knowledgeExtra/AddTermSet.vue

+ 17 - 9
src/components/knowledgeExtra/AddTermSet.vue

@@ -390,16 +390,16 @@ export default {
     },
     searchList(val) {
       let concepts = JSON.parse(JSON.stringify(this.form.concepts));
-      let str = ".*" + val + ".*"
-      let reg = new RegExp(str)
-      let arr=[]
+      let str = '.*' + val + '.*';
+      let reg = new RegExp(str);
+      let arr = [];
       //通过附加信息查询
-      for(var i=0;i<concepts.length;i++){
-        if(reg.test(concepts[i].conceptLibName)){
-          arr.push(concepts[i])
+      for (var i = 0; i < concepts.length; i++) {
+        if (reg.test(concepts[i].conceptLibName)) {
+          arr.push(concepts[i]);
         }
       }
-      this.getList(arr)
+      this.getList(arr);
     },
     getCollectionLib(newValue) {
       this.form.collectionLibName = newValue.conceptName;
@@ -459,7 +459,11 @@ export default {
         }
       });
       this.searchConcept();
-      this.getList(this.form.concepts);
+      if (this.searchtext != '') {
+        this.searchList(this.searchtext);
+      } else {
+        this.getList(this.form.concepts);
+      }
     },
     getchk(num) {
       return num % 2 == 0 ? '偶数' : '奇数'; //判断是否能整除2
@@ -510,7 +514,11 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next) {
-    if (this.startCount !== this.editCount && this.form.concepts.length > 0 && !this.isSaveSuccess) {
+    if (
+      this.startCount !== this.editCount &&
+      this.form.concepts.length > 0 &&
+      !this.isSaveSuccess
+    ) {
       this.$alert('还有未保存的内容,确定要退出当前页面吗?', '提示', {
         confirmButtonText: '确定',
         // cancelButtonText: '取消',