wyq %!s(int64=3) %!d(string=hai) anos
pai
achega
00d7b7750c
Modificáronse 1 ficheiros con 30 adicións e 30 borrados
  1. 30 30
      src/components/knowledgeExtra/AddTermSet.vue

+ 30 - 30
src/components/knowledgeExtra/AddTermSet.vue

@@ -58,7 +58,7 @@
       .left_box {
         margin: 30px 0;
         overflow: hidden;
-        min-height: calc(100vh - 410px)
+        min-height: calc(100vh - 410px);
       }
       .tabs {
         max-width: 100%;
@@ -78,7 +78,7 @@
       .right_box {
         margin: 30px 0;
         overflow: hidden;
-        min-height: calc(100vh - 410px)
+        min-height: calc(100vh - 410px);
       }
       .tabs {
         max-width: 100%;
@@ -203,9 +203,14 @@
           <div class="left_header">
             <h5 class="tips">关联的术语({{form.concepts.length}})</h5>
             <div style="display:flex">
-              <el-input v-model="searchtext" @input="searchList" placeholder="关键词" class="inp"></el-input>
+              <el-input v-model.trim="searchtext" @input="searchList" placeholder="关键词" class="inp"></el-input>
               <span style="display:flex;align-items: center;margin:0 5px">-</span>
-              <el-input v-model="searchtext2" @input="searchList" placeholder="关键词" class="inp"></el-input>
+              <el-input
+                v-model.trim="searchtext2"
+                @input="searchList"
+                placeholder="关键词"
+                class="inp"
+              ></el-input>
             </div>
           </div>
 
@@ -216,6 +221,7 @@
               style="min-height: 200px"
               height="calc(100vh - 393px)"
               class="tabs"
+              ref="table"
               :header-row-style="{height:'40px'}"
               :header-cell-style="{height:'40px',background:'#f7f7f7'}"
             >
@@ -248,21 +254,21 @@
               <el-option label="or" value="1"></el-option>
             </el-select>
             <el-input
-              v-model="formInline.name1"
+              v-model.trim="formInline.name1"
               @input="searchConcept"
               placeholder="关键词"
               class="inp"
             ></el-input>
             <span style="display:flex;align-items: center;margin:0 5px">-</span>
             <el-input
-              v-model="formInline.name2"
+              v-model.trim="formInline.name2"
               @input="searchConcept"
               placeholder="关键词"
               class="inp"
             ></el-input>
             <span style="display:flex;align-items: center;margin:0 5px">-</span>
             <el-input
-              v-model="formInline.name3"
+              v-model.trim="formInline.name3"
               @input="searchConcept"
               placeholder="关键词"
               class="inp"
@@ -276,6 +282,7 @@
               style="min-height: 200px"
               height="calc(100vh - 393px)"
               class="tabs"
+              ref="tables"
               @row-click="btn"
               :header-row-style="{height:'40px'}"
               :header-cell-style="{height:'40px',background:'#f7f7f7'}"
@@ -465,6 +472,7 @@ export default {
           arr.push(concepts[i]);
         }
       }
+      this.$refs.table.bodyWrapper.scrollTop = 0;
       this.leftList = arr;
     },
     getCollectionLib(newValue) {
@@ -483,6 +491,7 @@ export default {
       }
       this.timeout = setTimeout(() => {
         this.getTreeSearchList();
+        this.$refs.tables.bodyWrapper.scrollTop = 0;
       }, 800);
     },
     async getTreeSearchList() {
@@ -530,8 +539,8 @@ export default {
     add() {
       if (this.multipleSelection.length == 0) {
         this.$message({
-          message: '数据不能为空',
-          type: 'error'
+          message: '添加数据不能为空',
+          type: 'warning'
         });
         return;
       }
@@ -586,26 +595,17 @@ export default {
     },
     // 移除术语
     showDelDialog(row) {
-      if (this.searchtext == '' && this.searchtext2 == '') {
-        this.form.concepts.forEach((item, index) => {
-          if (item.conceptId == row.conceptId) {
-            this.form.concepts.splice(index, 1);
-            this.excludedConceptIds.splice(index, 1);
-          }
-        });
-      } else {
-        this.leftList.forEach((item, index) => {
-          if (item.conceptId == row.conceptId) {
-            this.leftList.splice(index, 1);
-          }
-        });
-        this.form.concepts.forEach((item, index) => {
-          if (item.conceptId == row.conceptId) {
-            this.form.concepts.splice(index, 1);
-            this.excludedConceptIds.splice(index, 1);
-          }
-        });
-      }
+      this.leftList.forEach((item, index) => {
+        if (item.conceptId == row.conceptId) {
+          this.leftList.splice(index, 1);
+        }
+      });
+      this.form.concepts.forEach((item, index) => {
+        if (item.conceptId == row.conceptId) {
+          this.form.concepts.splice(index, 1);
+          this.excludedConceptIds.splice(index, 1);
+        }
+      });
       this.getTreeSearchList();
     },
     saveSet() {
@@ -627,7 +627,7 @@ export default {
         } else {
           this.$message({
             message: res.data.msg,
-            type: 'warning'
+            type: 'error'
           });
         }
       });