wyq il y a 3 ans
Parent
commit
a2e31aa056

+ 3 - 1
src/api/config.js

@@ -628,7 +628,9 @@ export default {
     'jhSearchConcept': '/api/cdssman/klDisease/addConceptClass',
     'deleteById': '/api/cdssman/kl/conceptCollection/deleteById',
     'saveOrUpdateRecord': '/api/cdssman/kl/conceptCollection/saveOrUpdateRecord',
-
+    'searchCollectionConceptVO': '/api/cdssman/klDisease/searchCollectionConceptVO',
+    'collectionMatch': '/api/cdssman/kl/conceptCollection/collectionMatch',
+    
   },
   menuIconList: { //菜单对应图标
     'YH-KZT': 'el-icon-menu',

+ 6 - 0
src/api/knowledgeLib.js

@@ -54,5 +54,11 @@ export default {
     saveOrUpdateRecord(param) {
         return axios.post(urls.saveOrUpdateRecord, param);
     },
+    searchCollectionConceptVO(param) {
+        return axios.post(urls.searchCollectionConceptVO, param);
+    },
+    collectionMatch(param) {
+        return axios.post(urls.collectionMatch, param);
+    },
     
 }

+ 235 - 140
src/components/knowledgeExtra/AddTermSet.vue

@@ -20,21 +20,23 @@
   }
 
   .left_header {
+    height: 40px;
     display: flex;
     justify-content: space-between;
     .tips {
       margin-top: 15px;
     }
     .inp {
-      width: 280px;
-
+      width: 150px;
       /deep/.el-input__inner {
         height: 30px;
         margin-top: 10px;
       }
     }
   }
-
+  .right_header {
+    display: flex;
+  }
   .table_form {
     width: 100%;
     box-sizing: border-box;
@@ -63,9 +65,8 @@
         height: calc(100vh - 410px);
       }
       .tabs {
-        float: left;
-        max-width: 49%;
-        min-width: 49%;
+        max-width: 100%;
+        min-width: 100%;
       }
       .form_btn {
         display: flex;
@@ -73,8 +74,33 @@
       }
     }
     .table_right {
-      width: 300px;
+      flex: 1;
       background: #ffffff;
+      padding: 0 50px;
+      .right_box {
+        margin: 30px 0;
+        overflow: hidden;
+        overflow-y: auto;
+        height: calc(100vh - 410px);
+      }
+      .tabs {
+        max-width: 100%;
+        min-width: 100%;
+      }
+      .inp {
+        width: 100px;
+        /deep/.el-input__inner {
+          height: 30px;
+          margin-top: 10px;
+        }
+      }
+      .inps {
+        margin-right: 10px;
+      }
+      .form_btn {
+        display: flex;
+        justify-content: space-between;
+      }
     }
   }
   /deep/.el-select-dropdown__item.hover,
@@ -100,55 +126,20 @@
   /deep/ .el-form-item.is-success .el-textarea__inner {
     border-color: #c9c9c9 !important;
   }
-  .conceptSearch {
-    width: 100%;
-    text-align: center;
-    z-index: 2;
-    padding: 30px;
-    box-sizing: border-box;
-    .conceptTitle {
-      width: 100%;
-      text-align: center;
-      padding: 20px 0;
-    }
-    .searchText {
-      padding: 0 35px 0 15px;
-      width: 100%;
-      height: 34px;
-      border: 1px solid #c9c9c9;
-      box-sizing: border-box;
-    }
-    .conceptList {
-      min-height: 200px;
-      max-height: 300px;
-      margin: -2px auto 0;
-      border: 1px solid #e1dfdf;
-      overflow: hidden;
-      overflow-y: auto;
-    }
-    .conceptItem {
-      height: 34px;
-      line-height: 34px;
-      text-align: left;
-      padding: 0 15px;
-      cursor: pointer;
-    }
-    .conceptItem:hover {
-      background: #f5f7fa;
-    }
-    .searchWrap {
-      position: relative;
-      .search {
-        position: absolute;
-        right: 7px;
-        top: 8px;
-      }
-    }
-  }
-  .noresult {
-    padding: 20px 0;
-    color: #ccc;
-  }
+}
+.test_box {
+  min-height: 300px;
+  max-height: 300px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 1.5;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  padding: 10px 15px;
 }
 </style>
 <template>
@@ -208,13 +199,17 @@
         <div class="table_left">
           <div class="left_header">
             <h4 class="tips">关联的术语({{form.concepts.length}})</h4>
-            <el-input v-model="searchtext" @input="searchList" placeholder="请搜索" class="inp"></el-input>
+            <div style="display:flex">
+              <el-input v-model="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>
+            </div>
           </div>
 
           <div class="left_box">
             <el-table
-              v-if="firstList.length>0"
-              :data="firstList"
+              v-if="leftList.length>0"
+              :data="leftList"
               border
               class="tabs"
               :header-row-style="{height:'40px'}"
@@ -232,60 +227,84 @@
                 </template>
               </el-table-column>
             </el-table>
+          </div>
+
+          <div class="form_btn">
+            <el-button type="primary" size="medium " @click="saveSet">确定</el-button>
+          </div>
+        </div>
+        <div class="table_right">
+          <div class="right_header">
+            <el-select
+              v-model="formInline.logicalOperator"
+              class="inp inps"
+              @change="searchConcept"
+            >
+              <el-option label="and" value="0"></el-option>
+              <el-option label="or" value="1"></el-option>
+            </el-select>
+            <el-input
+              v-model="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"
+              @input="searchConcept"
+              placeholder="标准术语关键字"
+              class="inp"
+            ></el-input>
+            <span style="display:flex;align-items: center;margin:0 5px">-</span>
+            <el-input
+              v-model="formInline.name3"
+              @input="searchConcept"
+              placeholder="标准术语关键字"
+              class="inp"
+            ></el-input>
+          </div>
+
+          <div class="right_box">
             <el-table
-              v-if="lastList.length>0"
-              :data="lastList"
+              v-if="conceptList.length>0"
+              :data="conceptList"
               border
               class="tabs"
+              @row-click="btn"
               :header-row-style="{height:'40px'}"
               :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
+              @selection-change="handleSelectionChange"
             >
-              <el-table-column prop="conceptLibName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
-              <el-table-column label="操作" fixed="right">
-                <template slot-scope="scope">
-                  <el-button
-                    type="text"
-                    size="small"
-                    class="delete"
-                    @click="showDelDialog(scope.row)"
-                  >移除</el-button>
-                </template>
-              </el-table-column>
+              <el-table-column type="selection"></el-table-column>
+              <el-table-column prop="conceptName" :show-overflow-tooltip="true" label="术语名称"></el-table-column>
             </el-table>
           </div>
-
           <div class="form_btn">
-            <el-button type="primary" size="medium " @click="saveSet">确定</el-button>
-          </div>
-        </div>
-        <div class="table_right">
-          <div class="conceptSearch" ref="conceptSearch">
-            <h4 class="conceptTitle">添加关联术语</h4>
-            <p class="searchWrap">
-              <img class="search" src="../../images/search.png" alt="搜索" />
-              <input
-                v-model.trim="conceptText"
-                @input="searchConcept"
-                type="text"
-                ref="conceptInput"
-                class="searchText"
-                placeholder="请输入关键词搜索"
-              />
-            </p>
-            <ul class="conceptList" ref="conceptList">
-              <li
-                v-for="item in conceptList"
-                class="conceptItem ellipsis"
-                :title="item.conceptName"
-                @click="selectConcept(item)"
-                :key="item.conceptId"
-              >{{item.conceptName}}</li>
-              <li class="noresult" v-if="conceptList.length==0">暂无结果~</li>
-            </ul>
+            <el-button type="primary" size="medium " @click="add">添加</el-button>
+            <el-button type="primary" size="medium " @click="dialogVisible = true">文本批量添加</el-button>
           </div>
         </div>
       </div>
     </div>
+    <el-dialog
+      title="请输入要添加到关联的标准术语(每行一个)"
+      :visible.sync="dialogVisible"
+      width="30%"
+      @close="cancel"
+    >
+      <div
+        class="test_box"
+        contenteditable="true"
+        ref="msg"
+        style="white-space: pre-wrap"
+        @input="handleInput"
+      ></div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancel">取 消</el-button>
+        <el-button type="primary" @click="collectionMatch">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script type="text/javascript">
@@ -297,17 +316,26 @@ export default {
   data() {
     return {
       title: '术语集合内容维护-添加',
+      formInline: {
+        logicalOperator: '0',
+        name1: '',
+        name2: '',
+        name3: ''
+      },
+      innerText: '',
       ruleTypeList: [],
       ruleTermTypeList: [],
       conceptList: [],
       conceptText: '',
       excludedConceptIds: [],
       type: [],
-      firstList: [],
-      lastList: [],
+      leftList: [],
+      multipleSelection: [],
       sign: 1,
+      len: 0,
       searchtext: '',
-      len: null,
+      searchtext2: '',
+      dialogVisible: false,
       form: {
         collectionLibType: '',
         collectionLibName: '',
@@ -343,9 +371,9 @@ export default {
       this.form.conceptLibType = info.concepts[0].conceptLibType;
       this.form.collectionId = info.collectionId;
       this.form.collectionRemark = info.collectionRemark;
+      this.leftList = info.concepts;
       this.sign = 2;
       this.$nextTick(() => {
-        this.getList(this.form.concepts);
         this.getIds(this.form.concepts);
         this.getTreeSearchList();
       });
@@ -355,6 +383,15 @@ export default {
     }, 500);
   },
   methods: {
+    handleInput(event) {
+      let text = event.target.innerText;
+      this.innerText = text;
+    },
+    cancel() {
+      this.$refs.msg.innerHTML = '';
+      this.innerText = '';
+      this.dialogVisible = false;
+    },
     cancelRequest() {
       if (typeof this.source === 'function') {
         this.source('终止请求');
@@ -398,8 +435,21 @@ export default {
           console.log(error);
         });
     },
-    searchList(val) {
-      let concepts = JSON.parse(JSON.stringify(this.form.concepts));
+    searchList() {
+      let concepts, val;
+      if (
+        (this.searchtext != '' && this.searchtext2 == '') ||
+        (this.searchtext == '' && this.searchtext2 != '')
+      ) {
+        concepts = JSON.parse(JSON.stringify(this.form.concepts));
+        val = this.searchtext != '' ? this.searchtext : this.searchtext2;
+      } else if (this.searchtext != '' && this.searchtext2 != '') {
+        concepts = JSON.parse(JSON.stringify(this.leftList));
+        val = this.searchtext2;
+      } else if (this.searchtext == '' && this.searchtext2 == '') {
+        this.leftList = JSON.parse(JSON.stringify(this.form.concepts));
+        return;
+      }
       let str = '.*' + val + '.*';
       let reg = new RegExp(str);
       let arr = [];
@@ -409,7 +459,7 @@ export default {
           arr.push(concepts[i]);
         }
       }
-      this.getList(arr);
+      this.leftList = arr;
     },
     getCollectionLib(newValue) {
       this.ruleTermTypeList.forEach(item => {
@@ -422,41 +472,66 @@ export default {
     },
     // 基础术语
     searchConcept(e) {
-      this.conceptText = e.target.value
       if (this.timeout) {
         clearTimeout(this.timeout);
       }
       this.timeout = setTimeout(() => {
-        this.getTreeSearchList()
+        this.getTreeSearchList();
       }, 800);
     },
-    async getTreeSearchList(){
+    async getTreeSearchList() {
       this.whether = true;
       const params = {
-        typeId: this.form.conceptLibType,
-        name: this.conceptText,
-        excludedConceptIds: this.excludedConceptIds
+        libType: this.form.conceptLibType,
+        names: [
+          this.formInline.name1,
+          this.formInline.name2,
+          this.formInline.name3
+        ],
+        excludedConceptIds: this.excludedConceptIds,
+        logicalOperator: this.formInline.logicalOperator
       };
-      const data = await api.getTreeSearchList(params)
+      const data = await api.searchCollectionConceptVO(params);
       if (data.data.code == '0') {
         this.conceptList = data.data.data;
         this.whether = false;
       }
     },
-    // 选择基础术语
-    selectConcept(item) {
+    btn(row) {
       if (this.whether) {
         return;
       }
       let concepts = {
-        conceptId: item.conceptId,
-        conceptLibType: item.conceptNameType,
-        conceptLibName: item.conceptName
+        conceptId: row.conceptId,
+        conceptLibType: row.libType,
+        conceptLibName: row.conceptName
       };
-      this.excludedConceptIds.push(item.conceptId);
-      this.form.concepts.push(concepts);
-      this.getList(this.form.concepts);
-      this.conceptList = []
+      this.excludedConceptIds.push(row.conceptId);
+      this.leftList.push(concepts);
+      this.conceptList = [];
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.getTreeSearchList();
+        }, 150);
+      });
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    add() {
+      if (this.whether) {
+        return;
+      }
+      this.multipleSelection.forEach(it => {
+        let concepts = {
+          conceptId: it.conceptId,
+          conceptLibType: it.libType,
+          conceptLibName: it.conceptName
+        };
+        this.excludedConceptIds.push(it.conceptId);
+        this.leftList.push(concepts);
+      });
+      this.conceptList = [];
       this.$nextTick(() => {
         setTimeout(() => {
           this.getTreeSearchList();
@@ -479,29 +554,14 @@ export default {
         if (item.conceptId == row.conceptId) {
           this.form.concepts.splice(index, 1);
           this.excludedConceptIds.splice(index, 1);
+          this.leftList.splice(index, 1);
         }
       });
       this.getTreeSearchList();
-      if (this.searchtext != '') {
-        this.searchList(this.searchtext);
-      } else {
-        this.getList(this.form.concepts);
-      }
     },
     getchk(num) {
       return num % 2 == 0 ? '偶数' : '奇数'; //判断是否能整除2
     },
-    getList(arr) {
-      this.firstList = [];
-      this.lastList = [];
-      arr.forEach((item, index) => {
-        if (this.getchk(index) == '偶数') {
-          this.firstList.push(item);
-        } else {
-          this.lastList.push(item);
-        }
-      });
-    },
     saveSet() {
       let params = {
         ...this.form,
@@ -526,15 +586,50 @@ export default {
         }
       });
     },
+    collectionMatch() {
+      let params = {
+        conceptLibNames: this.innerText,
+        conceptLibType: this.form.conceptLibType
+      };
+      api
+        .collectionMatch(params)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            let text = '';
+            if (data.unMatchList.length > 0) {
+              data.unMatchList.forEach(it => {
+                text += it.conceptLibName + '\n';
+              });
+            }
+            this.$refs.msg.innerHTML = text;
+            this.innerText = text;
+          } else {
+            this.dialogVisible = true;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
     clearData() {
       this.form.collectionLibName = '';
       this.conceptText = '';
       this.ruleTermTypeList = [];
       this.form.concepts = [];
-      this.getList(this.form.concepts);
       this.getTreeSearchList();
     }
   },
+  computed: {
+    conceptCollectionVO() {
+      let conceptCollectionVO = [];
+      this.innerText.forEach(it => {
+        console.log(123);
+        conceptCollectionVO.push(it);
+      });
+      return conceptCollectionVO;
+    }
+  },
   watch: {
     form: {
       handler(newName, oldName) {

+ 1 - 15
src/components/knowledgeExtra/RuleManager.vue

@@ -42,21 +42,7 @@
     <div class="contents knowledgeContents">
       <el-table :data="list" border style="width: 100%">
         <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-        <el-table-column prop="parDescription" label="规则名称" width="160">
-          <template slot-scope="scope">
-              <span>{{scope.row.parDescription}}</span>
-            <!-- <el-tooltip
-              v-if="scope.row.parDescription.length>8"
-              class="item"
-              effect="dark"
-              :content="scope.row.parDescription"
-              placement="top"
-            >
-              <span>{{scope.row.parDescription.slice(0,8)+'...'}}</span>
-            </el-tooltip> -->
-            <span v-if="scope.row.parDescription.length<9">{{scope.row.parDescription}}</span>
-          </template>
-        </el-table-column>
+        <el-table-column prop="parDescription" label="规则名称" width="160"></el-table-column>
         <el-table-column prop="parRuleType" label="规则类型" width="150">
           <template slot-scope="scope">{{statusTrans(scope.row.parRuleType)}}</template>
         </el-table-column>