浏览代码

Merge remote-tracking branch 'origin/master' into referMaster

zhouna 4 年之前
父节点
当前提交
1e72771423

+ 8 - 2
src/api/config.js

@@ -575,7 +575,7 @@ export default {
     'zskDelRule': '/api/cdssman/klRule/clearRuleInfo',//删除规则
     'zskRuleDetail': '/api/cdssman/klRule/getByIdRuleInfo',//规则详情
     'zskTypeList': '/api/cdssman/klRulePlan/getMenu',//类型列表
-    'zskSearchConcept': '/api/cdssman/klDisease/searchConcept',//知识库搜索术语
+    'zskSearchConcept': '/api/cdssman/klDisease/searchConceptRuleClass',//知识库搜索术语
     'zskUpdateAll': '/api/cdssman/cache/clearRuleAll',//更新数据
     'zskgetDict': '/api/cdssman/kl/dictionary/getDictionarys',//
     //知识库树形图
@@ -621,7 +621,13 @@ export default {
     'saveOrUpdate': '/api/cdssman/klDrugRegister/saveOrUpdate',
     'getByParam': '/api/cdssman/klDrugRegister/getByParam',
     'paramDelete': '/api/cdssman/klDrugRegister/delete',
-    'klRegulation': '/api/cdssman/klRegulation/index'
+    'klRegulation': '/api/cdssman/klRegulation/index',
+    //术语集合
+    'getConceptPage': '/api/cdssman/kl/conceptCollection/getPage',
+    'getRecordById': '/api/cdssman/kl/conceptCollection/getRecordById',
+    'jhSearchConcept': '/api/cdssman/klDisease/addConceptClass',
+    'deleteById': '/api/cdssman/kl/conceptCollection/deleteById',
+    'saveOrUpdateRecord': '/api/cdssman/kl/conceptCollection/saveOrUpdateRecord',
 
   },
   menuIconList: { //菜单对应图标

+ 40 - 18
src/api/knowledgeLib.js

@@ -3,34 +3,56 @@ import config from '@api/config.js';
 
 const urls = config.urls;
 export default {
-    getRulesList(param){
-        return axios.post(urls.zskRuleList,param);
+
+    getRulesList(param) {
+        return axios.post(urls.zskRuleList, param);
     },
-    getTypesList(param){
-        return axios.post(urls.zskTypeList,param);
+    getTypesList(param) {
+        return axios.post(urls.zskTypeList, param);
     },
-    deleteRule(param){
-        return axios.post(urls.zskDelRule,param);
+    deleteRule(param) {
+        return axios.post(urls.zskDelRule, param);
     },
-    deleteRuleApply(param){
-        return axios.post(urls.zskDisableRule,param);
+    deleteRuleApply(param) {
+        return axios.post(urls.zskDisableRule, param);
     },
-    ruleDetail(param){
-        return axios.post(urls.zskRuleDetail,param);
+    ruleDetail(param) {
+        return axios.post(urls.zskRuleDetail, param);
     },
-    searchConcept(param){
-        return axios.post(urls.zskSearchConcept,param);
+    searchConcept(param) {
+        return axios.post(urls.zskSearchConcept, param);
     },
-    saveRule(param){
-        return axios.post(urls.zskAddRule,param);
+    saveRule(param) {
+        return axios.post(urls.zskAddRule, param);
     },
-    saveRuleApply(param){
-        return axios.post(urls.zskActiveRule,param);
+    saveRuleApply(param) {
+        return axios.post(urls.zskActiveRule, param);
     },
     zskUpdateAll() {    //更新数据
         return axios.post(urls.zskUpdateAll)
     },
-    zskgetDict(){
+    zskgetDict() {
         return axios.post(urls.zskgetDict)
-    }
+    },
+    //术语集合
+    getConceptPage(param) {
+        return axios.post(urls.getConceptPage, param);
+    },
+    getRecordById(param) {
+        return axios.post(urls.getRecordById, param);
+    },
+    getTreeSearchList(param) {
+        return axios.post(urls.searchTreeItem, param);
+    },
+    getSearchConcept(param) {
+        return axios.post(urls.jhSearchConcept, param);
+    },
+    deleteById(param) {
+        return axios.post(urls.deleteById, param);
+    },
+    
+    saveOrUpdateRecord(param) {
+        return axios.post(urls.saveOrUpdateRecord, param);
+    },
+    
 }

+ 1 - 1
src/api/zskDiagBase.js

@@ -8,7 +8,7 @@ const urls = {
     'zskDiagBaseDetail':'/api/cdssman/klDiagnose/getByIdDiagnoseAll',
     'zskTypeList':'/api/cdssman/klRulePlan/getMenu',//类型列表
     'searchDiag':'/api/cdssman/klDiagnose/findDiaName',
-    'zskSearchConcept':'/api/cdssman/klDisease/searchConcept',//知识库搜索术语
+    'zskSearchConcept': '/api/cdssman/ klDisease/searchConceptRuleClass',//知识库搜索术语
     'zskgetDict':'/api/cdssman/kl/dictionary/getDictionarys',//获取枚举
     'updateDiagBase':'/api/cdssman/cache/reloadDiagnose'
 };

+ 2 - 1
src/components/cdssManage/AddMedicinePrompt.vue

@@ -322,7 +322,8 @@ export default {
     // } else {
     //   next();
     // }
-
+    console.log(this.startCount)
+    console.log(this.editCount)
     if (this.startCount !== this.editCount && !this.isSaveSuccess) {
       this.$alert('还有未保存的内容,确定要退出当前页面吗?', '提示', {
         confirmButtonText: '确定',

+ 1 - 1
src/components/cdssManage/hospital/Hospital.vue

@@ -22,7 +22,7 @@
     <div class="contents">
       <el-table :data="list" border style="width: 100%">
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-        <!-- <el-table-column :resizable="false" prop="code" label="医院编码" width="180"></el-table-column> -->
+         <el-table-column :resizable="false" prop="id" label="医院ID"></el-table-column>
         <el-table-column :resizable="false" prop="name" label="医院名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="spell" label="医院名称拼音" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="address" label="医院地址" show-overflow-tooltip></el-table-column>

+ 1 - 0
src/components/cdssManage/plan/Plan.vue

@@ -24,6 +24,7 @@
     <div class="contents">
       <el-table :data="list" border style="width: 100%">
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column :resizable="false" prop="hospitalId" label="医院ID" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="hospitalName" label="医院名称" show-overflow-tooltip></el-table-column>
         <!-- <el-table-column :resizable="false" prop="hospitalId" label="医院编码"></el-table-column> -->
         <el-table-column :resizable="false" prop="planName" label="方案名称" show-overflow-tooltip></el-table-column>

+ 3 - 1
src/components/knowledgeExtra/AddNewRule.vue

@@ -175,6 +175,7 @@
                   :key="item.conceptId"
                   :label="item.conceptName"
                   :value="item.conceptId"
+                  :title="item.conceptName"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -636,7 +637,7 @@ export default {
       const param = {
         excludedConceptIds: [this.form.parRuleType],
         libType: this.form.parLenCode,
-        name: val
+        name: val,
       };
       api
         .searchConcept(param)
@@ -776,6 +777,7 @@ export default {
       );
     },
     showHasSub() {
+      console.log(this.subDict.indexOf(this.ruleTermCodeStrs))
       if (this.ruleTermCodeStrs.length > 2) {
         return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;
       }

+ 3 - 2
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -299,6 +299,7 @@
                 :key="item.conceptId"
                 :label="item.conceptName"
                 :value="item.conceptId"
+                :title="item.conceptName"
               ></el-option>
             </el-select>
           </el-form-item>
@@ -744,7 +745,7 @@ export default {
           this.klRuleByIdSub[this.subConceptIdIndex].subType
         ],
         libType: this.klRuleByIdSub[this.subConceptIdIndex].subLenCode,
-        name: val
+        name: val,
       };
       api
         .searchConcept(param)
@@ -887,7 +888,7 @@ export default {
     },
     ruleTermCodeStr: {
       default: null
-    }
+    },
   }
 };
 </script>

+ 576 - 0
src/components/knowledgeExtra/AddTermSet.vue

@@ -0,0 +1,576 @@
+<style lang="less" scoped>
+// @import "../../less/admin.less";
+#AddRuleContent {
+  width: 100%;
+  min-width: 1000px;
+  padding: 20px;
+  padding-top: 50px;
+  padding-bottom: 0;
+  box-sizing: border-box;
+  .form {
+    width: 100%;
+  }
+  .remark {
+    font-size: 14px;
+    color: #606266;
+    position: relative;
+    left: 34px;
+    top: -10px;
+    padding-right: 30px;
+  }
+
+  .left_header {
+    display: flex;
+    justify-content: space-between;
+    .tips {
+      margin-top: 15px;
+    }
+    .inp {
+      width: 280px;
+
+      /deep/.el-input__inner {
+        height: 30px;
+        margin-top: 10px;
+      }
+    }
+  }
+
+  .table_form {
+    width: 100%;
+    box-sizing: border-box;
+    background: #fff;
+    padding: 20px;
+    padding-bottom: 0;
+    display: flex;
+    flex-wrap: wrap;
+  }
+  .table_content {
+    min-height: 200px;
+    height: calc(100vh - 264px);
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    .table_left {
+      flex: 1;
+      margin-right: 10px;
+      background: #ffffff;
+      padding: 0 50px;
+
+      .left_box {
+        margin: 30px 0;
+        overflow: hidden;
+        overflow-y: auto;
+        height: calc(100vh - 410px);
+      }
+      .tabs {
+        float: left;
+        max-width: 49%;
+        min-width: 49%;
+      }
+      .form_btn {
+        display: flex;
+        justify-content: flex-end;
+      }
+    }
+    .table_right {
+      width: 300px;
+      background: #ffffff;
+    }
+  }
+  /deep/.el-select-dropdown__item.hover,
+  .el-select-dropdown__item:hover {
+    color: #48c5d7;
+  }
+  /deep/ .el-form--inline .el-form-item__label {
+    font-size: 14px;
+    color: #606266;
+  }
+  /deep/ .el-input--mini .el-input__inner,
+  .el-select {
+    width: 100%;
+    font-size: 14px;
+  }
+  /deep/ .el-form-item.is-success .el-input__inner,
+  .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  /deep/ .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  /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;
+  }
+}
+</style>
+<template>
+  <div>
+    <crumbs :title="title" :param="$route.params" linkTo="TermSet"></crumbs>
+    <div id="AddRuleContent">
+      <div class="table_form">
+        <el-form
+          size="mini"
+          :inline="true"
+          class="demo-form-inline form"
+          :model="form"
+          :rules="rules"
+        >
+          <el-form-item label-width="130px" label="术语集合类型:" prop="collectionLibType">
+            <el-select
+              v-model="form.collectionLibType"
+              placeholder="请选择"
+              @change="getConceptLibType"
+              :disabled="sign==2?true:false"
+              :title="form.collectionLibName"
+            >
+              <el-option
+                v-for="item in ruleTypeList"
+                :key="item.val"
+                :label="item.name"
+                :value="item.val"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- 规则术语类型: -->
+          <el-form-item label-width="130px" label="术语集合名称:" prop="collectionLibName">
+            <el-select
+              clearable
+              remote
+              filterable
+              v-model.trim="form.collectionLibName"
+              placeholder="请输入"
+              :remote-method="searchLibName"
+              @change="getCollectionLib"
+              :disabled="sign==2?true:false"
+              value-key="conceptId"
+              :title="form.collectionLibName"
+            >
+              <el-option
+                v-for="item in ruleTermTypeList"
+                :key="item.conceptId"
+                :label="item.conceptName"
+                :value="item.conceptName"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div class="remark">说明:{{form.collectionRemark}}</div>
+      </div>
+      <div class="table_content" v-if="onshow">
+        <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>
+
+          <div class="left_box">
+            <el-table
+              v-if="firstList.length>0"
+              :data="firstList"
+              border
+              class="tabs"
+              :header-row-style="{height:'40px'}"
+              :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
+            >
+              <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>
+            <el-table
+              v-if="lastList.length>0"
+              :data="lastList"
+              border
+              class="tabs"
+              :header-row-style="{height:'40px'}"
+              :header-cell-style="{height:'40px',padding:'0',background:'#f7f7f7'}"
+            >
+              <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>
+          </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>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from '@api/knowledgeLib.js';
+import AddNewRuleTable from './AddNewRuleTable';
+import axios from 'axios';
+export default {
+  name: 'AddRule',
+  data() {
+    return {
+      title: '术语集合内容维护-添加',
+      ruleTypeList: [],
+      ruleTermTypeList: [],
+      conceptList: [],
+      conceptText: '',
+      excludedConceptIds: [],
+      type: [],
+      firstList: [],
+      lastList: [],
+      sign: 1,
+      searchtext: '',
+      len: null,
+      form: {
+        collectionLibType: '',
+        collectionLibName: '',
+        concepts: [],
+        conceptLibType: '',
+        collectionRemark: '',
+        collectionId: ''
+      },
+      whether: false,
+      editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
+      startCount: -1,
+      isSaveSuccess: false, // 是否保存成功
+      timeout: null,
+      rules: {
+        collectionLibType: [
+          { required: true, message: '请选择术语集合类型', trigger: 'change' }
+        ],
+        collectionLibName: [
+          { required: true, message: '请选择术语集合名称', trigger: 'change' }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getDict();
+    const param = this.$route.params;
+    let info = param.data;
+    if (info) {
+      this.title = '术语集合内容维护-' + '修改';
+      this.form.collectionLibType = JSON.stringify(info.collectionLibType);
+      this.form.collectionLibName = info.collectionLibName;
+      this.form.concepts = info.concepts;
+      this.form.conceptLibType = info.concepts[0].conceptLibType;
+      this.form.collectionId = info.collectionId;
+      this.form.collectionRemark = info.collectionRemark;
+      this.sign = 2;
+      this.$nextTick(() => {
+        this.getList(this.form.concepts);
+        this.getIds(this.form.concepts);
+        this.getTreeSearchList();
+      });
+    }
+    setTimeout(() => {
+      this.startCount = this.editCount;
+    }, 500);
+  },
+  methods: {
+    cancelRequest() {
+      if (typeof this.source === 'function') {
+        this.source('终止请求');
+      }
+    },
+    getDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.ruleTypeList = data[63];
+            this.type = data[61];
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    //过滤集合id
+    getIds(arr) {
+      arr.forEach((item, index) => {
+        this.excludedConceptIds.push(item.conceptId);
+      });
+    },
+    //获取术语集合名称
+    searchLibName(val) {
+      api
+        .getSearchConcept({
+          excludedConceptIds: [0],
+          libType: this.form.collectionLibType,
+          name: val
+        })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.ruleTermTypeList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    searchList(val) {
+      let concepts = JSON.parse(JSON.stringify(this.form.concepts));
+      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]);
+        }
+      }
+      this.getList(arr);
+    },
+    getCollectionLib(newValue) {
+      this.ruleTermTypeList.forEach(item => {
+        if (newValue == item.conceptName) {
+          // this.form.collectionLibName = item.conceptName;
+          this.form.collectionId = item.conceptId;
+          this.form.collectionRemark = item.remark;
+        }
+      });
+    },
+    // 基础术语
+    searchConcept(e) {
+      this.conceptText = e.target.value
+      if (this.timeout) {
+        clearTimeout(this.timeout);
+      }
+      this.timeout = setTimeout(() => {
+        this.getTreeSearchList()
+      }, 800);
+    },
+    async getTreeSearchList(){
+      this.whether = true;
+      const params = {
+        typeId: this.form.conceptLibType,
+        name: this.conceptText,
+        excludedConceptIds: this.excludedConceptIds
+      };
+      const data = await api.getTreeSearchList(params)
+      if (data.data.code == '0') {
+        this.conceptList = data.data.data;
+        this.whether = false;
+      }
+    },
+    // 选择基础术语
+    selectConcept(item) {
+      if (this.whether) {
+        return;
+      }
+      let concepts = {
+        conceptId: item.conceptId,
+        conceptLibType: item.conceptNameType,
+        conceptLibName: item.conceptName
+      };
+      this.excludedConceptIds.push(item.conceptId);
+      this.form.concepts.push(concepts);
+      this.getList(this.form.concepts);
+      this.conceptList = []
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.getTreeSearchList();
+        }, 150);
+      });
+    },
+    // 切换术语类型
+    getConceptLibType() {
+      this.type.forEach(it => {
+        let id = it.val.split('-');
+        if (this.form.collectionLibType == id[0]) {
+          this.form.conceptLibType = id[2];
+        }
+      });
+      this.clearData();
+    },
+    // 移除术语
+    showDelDialog(row) {
+      this.form.concepts.forEach((item, index) => {
+        if (item.conceptId == row.conceptId) {
+          this.form.concepts.splice(index, 1);
+          this.excludedConceptIds.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,
+        relationId: 0
+      };
+      api.saveOrUpdateRecord(params).then(res => {
+        if (res.data.code == 0) {
+          this.$message({
+            message: '操作成功',
+            type: 'success'
+          });
+          this.isSaveSuccess = true;
+          this.$router.push({
+            name: 'TermSet',
+            params: Object.assign({}, this.$route.params, { currentPage: 1 })
+          });
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: 'warning'
+          });
+        }
+      });
+    },
+    clearData() {
+      this.form.collectionLibName = '';
+      this.conceptText = '';
+      this.ruleTermTypeList = [];
+      this.form.concepts = [];
+      this.getList(this.form.concepts);
+      this.getTreeSearchList();
+    }
+  },
+  watch: {
+    form: {
+      handler(newName, oldName) {
+        this.editCount++;
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  beforeRouteLeave(to, from, next) {
+    if (
+      this.startCount !== this.editCount &&
+      this.form.concepts.length > 0 &&
+      !this.isSaveSuccess
+    ) {
+      this.$alert('还有未保存的内容,确定要退出当前页面吗?', '提示', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leaveBtn',
+        // customClass: 'leaveBox',
+        type: 'warning'
+      })
+        .then(() => {
+          next();
+        })
+        .catch(() => {});
+    } else {
+      next();
+    }
+  },
+  computed: {
+    onshow() {
+      return (
+        this.form.collectionLibType != '' && this.form.collectionLibName != ''
+      );
+    }
+  }
+};
+</script>

+ 2 - 0
src/components/knowledgeExtra/DiagBase.vue

@@ -137,6 +137,8 @@ export default {
     const param = this.$route.params;
     if (param.currentPage) {
       this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
       this.filter = param.filter;
     }
     this.getTypeList();

+ 7 - 7
src/components/knowledgeExtra/RuleManager.vue

@@ -158,6 +158,7 @@ export default {
         parConceptName: '',
         parRuleType: ''
       },
+      sign:'1',
       cacheData: {},
       currentPage: 1,
       pageSize: config.pageSize,
@@ -171,6 +172,8 @@ export default {
     const param = this.$route.params;
     if (param.currentPage) {
       this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
       this.filter = param.filter;
     }
     this.getTypeList();
@@ -212,7 +215,7 @@ export default {
               (data['21'].map(it => it.val) || []).join(',')
             );
             localStorage.setItem('zskNumDict', data['22'][0].val);
-            localStorage.setItem('zskSubDict', data['23'][0].val);
+            localStorage.setItem('zskSubDict', (data['23'].map(it => it.val) || []).join(','));
           }
         })
         .catch(error => {
@@ -224,13 +227,8 @@ export default {
       return obj && obj.name;
     },
     getTypeList() {
-      const typeListData = JSON.parse(localStorage.getItem('zskTypesList'));
-      if (typeListData) {
-        this.ruleTypeList = typeListData;
-        return;
-      }
       api
-        .getTypesList({ planCode: 'rule' })
+        .getTypesList({ planCode: 'rule'})
         .then(res => {
           if (res.data.code == '0') {
             const data = res.data.data;
@@ -349,6 +347,8 @@ export default {
         .catch(() => {});
     },
     editData(id, isCopy) {
+      this.sign = 2
+      this.getTypeList()
       const pam = this.searched
         ? {
             currentPage: this.currentPage,

+ 302 - 291
src/components/knowledgeExtra/StaticInfo.vue

@@ -1,334 +1,345 @@
 <template>
-    <div>
-        <crumbs title="静态信息维护">
-            <el-form :inline="true" class="demo-form-inline">
-                <el-form-item label="标准术语归类:">
-                    <el-select size="mini" v-model="filter.libType" placeholder="标准术语归类" clearable>
-                        <el-option v-for="item in typeList" :label="item.name" :value="item.val" :key="item.val"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="医学标准术语:">
-                    <el-input size="mini" v-model="filter.term" placeholder="请输入术语" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
-                        <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item>
-                    <el-button size="mini" @click="filterDatas">确认</el-button>
-                    <el-button size="mini" type="warning" style="margin:0 10px" @click="addMedicalPrompt">添加静态知识</el-button>
-                </el-form-item>
-            </el-form>
-        </crumbs>
-        <div class="contents">
-            <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="name"
-                        width="150"
-                        label="医学标准术语">
-                </el-table-column>
-                <el-table-column
-                        prop="typeName"
-                        label="标准术语归类"
-                        width="120">
-                </el-table-column>
-                <el-table-column
-                        prop="title"
-                        label="关联标题"
-                        width="240">
-                </el-table-column>
-                <el-table-column
-                        label="状态">
-                    <template slot-scope="scope">
-                        <span v-if="scope.row.isDeleted=='N'">启用</span>
-                        <span v-if="scope.row.isDeleted=='Y'" class="delete">禁用</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="modifier"
-                        label="操作人"
-                        width="80">
-                </el-table-column>
-                <el-table-column
-                        prop="gmtModified"
-                        label="操作时间"
-                        width="180"
-                        :show-overflow-tooltip="true">
-                </el-table-column>
-                <el-table-column
-                        label="操作" width="140">
-                    <template slot-scope="scope">
-                        <!-- <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" class="is-disabled">修改</el-button> -->
-                        <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <!-- <el-button v-if="scope.row.isDeleted=='Y' || scope.row.typeId === 82 || scope.row.typeId === 83" type="text" size="small" class="is-disabled">复制</el-button> -->
-                        <!-- <el-button v-if="scope.row.isDeleted=='N'&&scope.row.typeId !== 82 && scope.row.typeId !== 83" type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button> -->
-                        <el-button type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" @click="showReuseDialog(scope.row)">启用</el-button>
-                        <el-button v-if="scope.row.isDeleted=='N'" type="text" size="small" class="delete" @click="showDelDialog(scope.row)">禁用</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-            <el-pagination :current-page.sync="currentPage"
-                           @current-change="currentChange"
-                           background
-                           :page-size="pageSize"
-                           :page-sizes="pageSizeArr"
-                           @size-change="handleSizeChange"
-                           :layout="pageLayout"
-                           :total="total">
-            </el-pagination>
-        </div>
-
+  <div>
+    <crumbs title="静态信息维护">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="标准术语归类:">
+          <el-select size="mini" v-model="filter.libType" placeholder="标准术语归类" clearable>
+            <el-option
+              v-for="item in typeList"
+              :label="item.name"
+              :value="item.val"
+              :key="item.val"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="医学标准术语:">
+          <el-input size="mini" v-model="filter.term" placeholder="请输入术语" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+          <el-button
+            size="mini"
+            type="warning"
+            style="margin:0 10px"
+            @click="addMedicalPrompt"
+          >添加静态知识</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents">
+      <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="name" width="150" label="医学标准术语"></el-table-column>
+        <el-table-column prop="typeName" label="标准术语归类" width="120"></el-table-column>
+        <el-table-column prop="title" label="关联标题" width="240"></el-table-column>
+        <el-table-column label="状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.isDeleted=='N'">启用</span>
+            <span v-if="scope.row.isDeleted=='Y'" class="delete">禁用</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifier" label="操作人" width="80"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="操作" width="140">
+          <template slot-scope="scope">
+            <!-- <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" class="is-disabled">修改</el-button> -->
+            <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <!-- <el-button v-if="scope.row.isDeleted=='Y' || scope.row.typeId === 82 || scope.row.typeId === 83" type="text" size="small" class="is-disabled">复制</el-button> -->
+            <!-- <el-button v-if="scope.row.isDeleted=='N'&&scope.row.typeId !== 82 && scope.row.typeId !== 83" type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button> -->
+            <el-button type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              v-if="scope.row.isDeleted=='Y'"
+              type="text"
+              size="small"
+              @click="showReuseDialog(scope.row)"
+            >启用</el-button>
+            <el-button
+              v-if="scope.row.isDeleted=='N'"
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row)"
+            >禁用</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        :current-page.sync="currentPage"
+        @current-change="currentChange"
+        background
+        :page-size="pageSize"
+        :page-sizes="pageSizeArr"
+        @size-change="handleSizeChange"
+        :layout="pageLayout"
+        :total="total"
+      ></el-pagination>
     </div>
+  </div>
 </template>
 
 <script>
-  import api from '@api/knowledgeTree.js';
-  import config from '@api/config.js';
-  import utils from '@api/utils.js';
+import api from '@api/knowledgeTree.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
 
-  export default {
-    name: 'StaticInfo',
-    data: function () {
-      return {
-        list: [],
-        cacheData: {},
-        currentPage: 1,
-        pageSize: config.pageSize,
-        pageSizeArr:config.pageSizeArr,
-        pageLayout:config.pageLayout,
-        total: 0,
-        linkIn:[],
-        pays:[],
-        typeList:[],
-        stateList:[
-          {id:'N',name:'启用'},
-          {id:'Y',name:'禁用'},
-        ],
-        searched: false,
-        filter: {
-          term: '',
-          title:'',
-          status:'',
-          libType:'',
-        }
+export default {
+  name: 'StaticInfo',
+  data: function() {
+    return {
+      list: [],
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      linkIn: [],
+      pays: [],
+      typeList: [],
+      stateList: [
+        { id: 'N', name: '启用' },
+        { id: 'Y', name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        term: '',
+        title: '',
+        status: '',
+        libType: ''
       }
+    };
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    this.$nextTick(() => {
+      this.getDataList();
+      this.getListBack();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  // beforeRouteEnter(to, from, next){
+  //   next(vm => {
+  //     //const pm = to.param;
+  //     Object.assign(vm,to.params);
+  //     vm.inCurrentPage=to.params.currentPage;
+  //   })
+  // },
+  methods: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
     },
-    created() {
-      const param = this.$route.params;
-      if(param.currentPage){
-        this.inCurrentPage = param.currentPage
-        this.filter = param.filter
-      }
-      //返回时避免参数未赋值就获取列表
-      this.$nextTick(()=>{
-        this.getDataList();
-        this.getListBack();
-      });
+    addMedicalPrompt() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddDevKnow', params: pam });
     },
-    watch: {
-      'filter': {
-        handler: function () {
-          this.searched = false;
-        },
-        deep: true
-      }
+    toEditProduct(row) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddDevKnow',
+        params: Object.assign(pam, { data: row, isEdit: true })
+      });
     },
-    // beforeRouteEnter(to, from, next){
-    //   next(vm => {
-    //     //const pm = to.param;
-    //     Object.assign(vm,to.params);
-    //     vm.inCurrentPage=to.params.currentPage;
-    //   })
-    // },
-    methods: {
-      handleSizeChange(val){
-        this.pageSize = val;
-        this.currentPage = utils.getCurrentPage(this.currentPage, this.total, this.pageSize);
-        this.getDataList();
-      },
-      addMedicalPrompt(){
-        const pam = this.searched ? {
-          currentPage: this.currentPage,
-          pageSize:this.pageSize,
-          filter: this.filter
-        } : {currentPage: this.currentPage,
-          pageSize:this.pageSize};
-        this.$router.push({name:'AddDevKnow',
-          params:pam});
-      },
-      toEditProduct(row){
-        const pam = this.searched ? {
-          currentPage: this.currentPage,
-          pageSize:this.pageSize,
-          filter: this.filter
-        } : {currentPage: this.currentPage,
-          pageSize:this.pageSize};
-        this.$router.push({
-          name:'AddDevKnow',
-          params: Object.assign(pam, {data:row,isEdit:true})
-        })
-      },
-      toCopyProduct(row){
-        const pam = this.searched ? {
-          currentPage: this.currentPage,
-          pageSize:this.pageSize,
-          filter: this.filter
-        } : {currentPage: this.currentPage,
-          pageSize:this.pageSize};
-        this.$router.push({
-          name:'AddDevKnow',
-          params: Object.assign(pam, {data:row,isCopy:true})
-        })
-      },
-      filterDatas(){
-        this.currentPage = 1;
-        this.getDataList();
-      },
-      getListBack(){
-        api.getListBack({}).then((res) => {
-          const result = res.data
-          if (result.code == '0') {
-            this.typeList = result.data&&result.data[10]||[]
+    toCopyProduct(row) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
           }
-        })
-      },
-      getDataList(isTurnPage) {
-        const param = this.getFilterItems(isTurnPage);
-        this.searched = true;
-        const loading = this.$loading({
-            lock: true,
-            text: 'Loading',
-            spinner: 'el-icon-loading',
-            background: 'rgba(0, 0, 0, 0.7)'
-        });
-        api.staticBaseKnowledge(param).then((res) => {
-          loading.close()
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddDevKnow',
+        params: Object.assign(pam, { data: row, isCopy: true })
+      });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    getListBack() {
+      api.getListBack({}).then(res => {
+        const result = res.data;
+        if (result.code == '0') {
+          this.typeList = (result.data && result.data[10]) || [];
+        }
+      });
+    },
+    getDataList(isTurnPage) {
+      const param = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .staticBaseKnowledge(param)
+        .then(res => {
+          loading.close();
           if (res.data.code == '0') {
             const data = res.data.data;
             let templis = data.records;
             this.list = templis;
             this.cacheData[param.current] = data.records;
             this.total = data.total;
-            for(let i = 0;i < templis.length;i++){
-              templis[i].isDeleted = templis[i].status=='1'?'N':'Y'
+            for (let i = 0; i < templis.length; i++) {
+              templis[i].isDeleted = templis[i].status == '1' ? 'N' : 'Y';
             }
-            if(this.inCurrentPage!==undefined){
-              this.currentPage=this.inCurrentPage;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
               this.inCurrentPage = undefined;
             }
           }
-        }).catch((error) => {
+        })
+        .catch(error => {
           console.log(error);
         });
-      },
-      clearFilter(){
-        this.filter={
-          term: '',
-          title:'',
-          status:'',
-          libType:'',
-        };
-      },
-      getFilterItems(isTurnPage) {
-        //翻页时筛选条件没点确定则清空
-        if(isTurnPage&&!this.searched){
-          this.clearFilter();
-        };
-        const param = {
-          name:this.filter.term.trim(),
-          current: this.inCurrentPage||this.currentPage,
-          size: this.pageSize,
-          status:this.filter.status == 'Y'?0:this.filter.status == 'N'?1:'',
-          type:this.filter.libType||'',
-        };
-        return param;
-      },
-      indexMethod(index) {
-        return ((this.currentPage - 1) * this.pageSize) + index + 1;
-      },
-      currentChange(next) {
-        this.currentPage = next;
-        /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+    },
+    clearFilter() {
+      this.filter = {
+        term: '',
+        title: '',
+        status: '',
+        libType: ''
+      };
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        name: this.filter.term.trim(),
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        status:
+          this.filter.status == 'Y' ? 0 : this.filter.status == 'N' ? 1 : '',
+        type: this.filter.libType || ''
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
           this.list = this.cacheData[next];
         } else {*/
-          this.getDataList(true);
-        //}
-      },
-      warning(msg,type){
-        this.$message({
-          showClose: true,
-          message:msg,
-          type:type||'warning'
-        })
-      },
-      showConfirmDialog(msg,resolve){
-        this.$confirm(msg, '提示', {
-          confirmButtonText: '确定',
-          showCancelButton:false,
-          // cancelButtonText: '取消',
-          // cancelButtonClass:'cancel',
-          type: 'warning'
-        }).then(() => {
+      this.getDataList(true);
+      //}
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        confirmButtonText: '确定',
+        showCancelButton: false,
+        // cancelButtonText: '取消',
+        // cancelButtonClass:'cancel',
+        type: 'warning'
+      })
+        .then(() => {
           resolve();
-        }).catch(() => {});
-      },
-      showDelDialog(row){
-        this.showConfirmDialog('是否禁用该静态知识?',()=>{
-          api.changeBaseStatus({id:row.id,status:0}).then((res)=>{
-            if(res.data.code=='0'){
-              if(!this.searched){
+        })
+        .catch(() => {});
+    },
+    showDelDialog(row) {
+      this.showConfirmDialog('是否禁用该静态知识?', () => {
+        api
+          .changeBaseStatus({ id: row.id, status: 0 })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
                 //未点确认时清空搜索条件
                 this.clearFilter();
               }
-              this.warning(res.data.msg||'操作成功','success');
+              this.warning(res.data.msg || '操作成功', 'success');
               this.getDataList();
-            }else{
+            } else {
               this.warning(res.data.msg);
             }
-          }).catch((error)=>{
-            this.warning(error);
           })
-        });
-      },
-      showReuseDialog(row){
-        this.showConfirmDialog('是否重新启用该条数据?',()=>{
-          api.changeBaseStatus({id:row.id,status:1}).then((res)=>{
-            if(res.data.code=='0'){
-              this.currentPage = 1;         //恢复数据跳转到筛选条件下首页
-              this.warning(res.data.msg||'操作成功','success');
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    showReuseDialog(row) {
+      this.showConfirmDialog('是否重新启用该条数据?', () => {
+        api
+          .changeBaseStatus({ id: row.id, status: 1 })
+          .then(res => {
+            if (res.data.code == '0') {
+              this.currentPage = 1; //恢复数据跳转到筛选条件下首页
+              this.warning(res.data.msg || '操作成功', 'success');
               this.getDataList();
-            }else{
+            } else {
               this.warning(res.data.msg);
             }
-          }).catch((error)=>{
-            this.warning(error);
           })
-        });
-      }
+          .catch(error => {
+            this.warning(error);
+          });
+      });
     }
   }
+};
 </script>
 
 <style lang="less">
-    @import "../../less/admin.less";
-    .status-span{
-        font-size: 12px;
-        margin-right:10px;
-        color: unset;
-    }
-    .delete {
-      color: red;
-    }
+@import '../../less/admin.less';
+.status-span {
+  font-size: 12px;
+  margin-right: 10px;
+  color: unset;
+}
+.delete {
+  color: red;
+}
 </style>

+ 395 - 0
src/components/knowledgeExtra/TermSet.vue

@@ -0,0 +1,395 @@
+<template>
+  <div>
+    <crumbs title="术语集合内容维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="术语集合类型:">
+          <el-select v-model="filter.collectionLibType" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in ruleTypeList"
+              :key="item.val"
+              :label="item.name"
+              :value="item.val"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="术语集合名称:">
+          <el-input size="mini" v-model="filter.collectionLibName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="基础术语名称:">
+          <el-input size="mini" v-model="filter.conceptLibName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+      </el-form>
+      <el-form :inline="true" class="demo-form-inline secLine">
+        <el-form-item label="说明:">
+          <el-input size="mini" v-model="filter.collectionRemark" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 关联术语</el-button>
+          <el-button size="mini" @click="update">更新数据</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <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="collectionLibName" label="术语集合名称" ></el-table-column>
+        <el-table-column prop="conceptLibName" label="术语集合类型">
+          <template slot-scope="scope">
+            <span
+              v-for="item in ruleTypeList"
+            >{{item.val==scope.row.collectionLibType?item.name:''}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="collectionRemark" label="说明"  width="400">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.collectionRemark && scope.row.collectionRemark.length>80"
+              class="item"
+              effect="dark"
+              :content="scope.row.collectionRemark"
+              placement="top"
+            >
+              <span>{{scope.row.collectionRemark.slice(0,80)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.collectionRemark && scope.row.collectionRemark.length<81">{{scope.row.collectionRemark}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="concatConceptLibName" label="基础术语名称" >
+          <template slot-scope="scope">
+            <el-tooltip
+              class="item"
+              effect="dark"
+              :content="scope.row.concatConceptLibName"
+              placement="top"
+            >
+              <span
+                style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
+              >{{scope.row.concatConceptLibName}}</span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifier" label="操作人"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间"></el-table-column>
+        <el-table-column label="操作" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row.collectionId)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row,1)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        :current-page.sync="currentPage"
+        @current-change="currentChange"
+        background
+        :page-size="pageSize"
+        :page-sizes="pageSizeArr"
+        @size-change="handleSizeChange"
+        :layout="pageLayout"
+        :total="total"
+      ></el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/knowledgeLib.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'TermSet',
+  data: function() {
+    return {
+      list: [],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        collectionRemark: '',
+        collectionLibName: '',
+        conceptLibName: '',
+        collectionLibType: '0'
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '970px' //头部最小宽度
+    };
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage && param.filter) {
+      this.inCurrentPage = param.currentPage;
+      this.filter = param.filter;
+    }
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    this.getDict();
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  methods: {
+    getDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.ruleTypeList = data[62];
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddTermSet', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .getConceptPage(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
+            }
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
+            }
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
+            }
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        ...this.filter
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+                  this.list = this.cacheData[next];
+                } else {*/
+      this.getDataList(1, true);
+      //}
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(id) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      api
+        .getRecordById({ id })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$router.push({
+              name: 'AddTermSet',
+              params: { ...pam, data }
+            });
+          }
+        })
+        .catch(error => {
+          this.warning('获取详情失败,请重试');
+        });
+    },
+    showDelDialog(row) {
+      const param = {
+        id: row.collectionId
+      };
+      let waringTxt = '是否删除该集合内容,可能对现有系统造成影响';
+      this.showConfirmDialog(waringTxt, () => {
+        api
+          .deleteById(param)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        collectionRemark: '',
+        conceptLibName: '',
+        collectionLibName: '',
+        collectionLibType: ''
+      };
+    },
+    update() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .zskUpdateAll()
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            this.warning('更新成功', 'success');
+            this.getDataList();
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          this.warning('更新失败,请重试');
+        });
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 80px;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 104px 20px 0;
+}
+// /deep/ .el-form--inline .el-form-item{
+//   height: 40px;
+// }
+/deep/ .secLine {
+  float: right;
+  display: flex;
+  position: relative;
+  top: -10px;
+  .el-input__inner {
+    width: 380px;
+  }
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover {
+    color: #f19061;
+  }
+}
+</style>

+ 14 - 0
src/routes.js

@@ -223,6 +223,10 @@ import ZskDiagBase from '@components/knowledgeExtra/DiagBase.vue';      //知识
 import AddZskDiagBase from '@components/knowledgeExtra/AddDiagBase.vue';
 import ZskRegisteredDrug from '@components/knowledgeExtra/RegisteredDrug.vue';
 import AddZskRegisteredDrug from '@components/knowledgeExtra/AddZskRegisteredDrug.vue';
+import TermSet from '@components/knowledgeExtra/TermSet.vue';
+import AddTermSet from '@components/knowledgeExtra/AddTermSet.vue';
+
+
 export default [
     {
         path: '/',
@@ -678,6 +682,16 @@ export default [
                 component: AddZskRegisteredDrug,
                 name: 'AddZskRegisteredDrug',
             },
+            {
+                path: 'LT-ZSKKZWH-SYJHNRWH',
+                component: TermSet,
+                name: 'TermSet',
+            },
+            {
+                path: 'LT-ZSKKZWH-TJSYJHNRWH',
+                component: AddTermSet,
+                name: 'AddTermSet',
+            },
         ],
     },
 ];

+ 2 - 2
vue.config.js

@@ -1,6 +1,6 @@
 const path = require('path');
-const proxy_path = 'http://192.168.2.241:88';
-// const proxy_path = 'http://192.168.2.236:88';
+// const proxy_path = 'http://192.168.2.241:88';
+const proxy_path = 'http://192.168.2.236:88';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.113:5050'; //王峰