wyq 3 роки тому
батько
коміт
3baa7a8c29
1 змінених файлів з 35 додано та 26 видалено
  1. 35 26
      src/components/knowledgeExtra/AddTermSet.vue

+ 35 - 26
src/components/knowledgeExtra/AddTermSet.vue

@@ -59,7 +59,7 @@
       .left_box {
         margin: 30px 0;
         overflow: hidden;
-        min-height: calc(100vh - 410px);
+        min-height: 530px;
       }
       .tabs {
         max-width: 100%;
@@ -79,7 +79,7 @@
       .right_box {
         margin: 30px 0;
         overflow: hidden;
-        min-height: calc(100vh - 410px);
+        min-height: 530px;
       }
       .tabs {
         max-width: 100%;
@@ -125,8 +125,8 @@
   /deep/ .el-form-item.is-success .el-textarea__inner {
     border-color: #c9c9c9 !important;
   }
-  /deep/ .el-table th.gutter{
-    display: table-cell!important;
+  /deep/ .el-table th.gutter {
+    display: table-cell !important;
   }
 }
 .test_box {
@@ -145,7 +145,6 @@
 }
 </style>
 <style scoped>
-
 </style>
 <template>
   <div>
@@ -219,10 +218,10 @@
               max-height="500"
               class="tabs"
               :header-row-style="{height:'40px'}"
-              :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
+              :header-cell-style="{height:'40px',background:'#f7f7f7'}"
             >
               <el-table-column prop="conceptLibName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
-              <el-table-column label="操作" fixed="right">
+              <el-table-column label="操作">
                 <template slot-scope="scope">
                   <el-button
                     type="text"
@@ -280,7 +279,7 @@
               class="tabs"
               @row-click="btn"
               :header-row-style="{height:'40px'}"
-              :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
+              :header-cell-style="{height:'40px',background:'#f7f7f7'}"
               @selection-change="handleSelectionChange"
             >
               <el-table-column type="selection"></el-table-column>
@@ -298,8 +297,8 @@
       :title="'请输入要添加到关联的标准术语(每行一个)'+'共'+len+'行'"
       :visible.sync="dialogVisible"
       width="30%"
-      @close="collectcancel"
       :close-on-click-modal="false"
+      :showClose="false"
     >
       <div
         class="test_box"
@@ -309,9 +308,8 @@
         @input="handleInput"
       ></div>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="cancel">取 消</el-button>
-        <el-button type="primary" @click="collectionMatch">确 定</el-button>
         <el-button @click="collectcancel">保存并关闭</el-button>
+        <el-button type="primary" @click="collectionMatch">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -398,11 +396,6 @@ export default {
       let text = event.target.innerText;
       this.innerText = text.replace(/(^\s*)|(\s*$)/g, '');
     },
-    cancel() {
-      this.$refs.msg.innerHTML = '';
-      this.innerText = '';
-      this.dialogVisible = false;
-    },
     collectcancel() {
       this.dialogVisible = false;
     },
@@ -551,10 +544,12 @@ export default {
     unique(arr) {
       let obj = {};
       arr = arr.reduce(function(item, next) {
-        obj[next.conceptId] ? '' : (obj[next.conceptId] = true && item.push(next));
+        obj[next.conceptId]
+          ? ''
+          : (obj[next.conceptId] = true && item.push(next));
         return item;
       }, []);
-      return arr
+      return arr;
     },
     //处理数据
     processing(arr) {
@@ -570,8 +565,8 @@ export default {
         this.excludedConceptIds.push(it.conceptId);
         this.form.concepts.push(concepts);
       });
-      this.form.concepts = this.unique(this.form.concepts)
-      this.leftList =  this.form.concepts;
+      this.form.concepts = this.unique(this.form.concepts);
+      this.leftList = this.form.concepts;
       this.conceptList = [];
       this.multipleSelection = [];
       this.$nextTick(() => {
@@ -592,12 +587,26 @@ export default {
     },
     // 移除术语
     showDelDialog(row) {
-      this.form.concepts.forEach((item, index) => {
-        if (item.conceptId == row.conceptId) {
-          this.form.concepts.splice(index, 1);
-          this.excludedConceptIds.splice(index, 1);
-        }
-      });
+      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.getTreeSearchList();
     },
     saveSet() {