Explorar o código

基础术语维护

luolei %!s(int64=4) %!d(string=hai) anos
pai
achega
e48d4db26a

+ 8 - 2
src/api/config.js

@@ -519,11 +519,17 @@ export default {
     'getRunningStatusByHospitalId': '/api/cdssman/test/running/getStatusByHospitalId',   //查拉面所有测试用例运行状态
     'updateRunningStatus': '/api/cdssman/test/running/updateStatus',   //更新测试用例运行状态
     //知识库树形图
-    // 'searchTree':'https://www.fastmock.site/mock/84092c4be71b4d1a59434dca70c42a7c/api/search',
-    // 'listTree':'https://www.fastmock.site/mock/84092c4be71b4d1a59434dca70c42a7c/api/tree',
     'getTree':'/api/cdssman/multContact/getTree',//获取当前type数据
     'searchTreeItem':'/api/cdssman/multContact/getAllForRelation',//检索树元素
     'addTreeRelation':'/api/cdssman/multContact/addRelation',//保存树元素
+    //知识库基础维护
+    'getBaseConceptInfoPage':'/api/cdssman/graph/klConcept/getConceptInfoPage',
+    'startConcept':'/api/cdssman/graph/klConcept/startConcept',
+    'disableConcept':'/api/cdssman/graph/klConcept/disableConcept',
+    'baseTypeGetPage':'/api/cdssman/kl/lexicon/getPage',
+    'clearStandRuleDrug':'/api/cdssman/cache/clearStandRuleDrug',
+    'saveBaseConceptInfo':'/api/cdssman/graph/klConcept/saveConceptInfo',
+    'getBaseConceptAll':'/api/cdssman/graph/klConcept/getConceptAll',
   },
   menuIconList: { //菜单对应图标
     'YH-KZT': 'el-icon-menu',

+ 22 - 1
src/api/knowledgeTree.js

@@ -21,5 +21,26 @@ export default {
   },
   getlistTree(param) {
     return axios.post(urls.getTree, param);
-  }
+  },
+  getBaseConceptInfoPage(param) {
+    return axios.post(urls.getBaseConceptInfoPage, param);
+  },
+  disableConcept(param) {
+    return axios.post(urls.disableConcept, param);
+  },
+  startConcept(param) {
+    return axios.post(urls.startConcept, param);
+  },
+  baseTypeGetPage(param) {
+    return axios.post(urls.baseTypeGetPage, param);
+  },
+  clearStandRuleDrug(param) {
+    return axios.post(urls.clearStandRuleDrug, param);
+  },
+  saveBaseConceptInfo(param) {
+    return axios.post(urls.saveBaseConceptInfo, param);
+  },
+  getBaseConceptAll(param) {
+    return axios.post(urls.getBaseConceptAll, param);
+  },
 };

+ 95 - 84
src/components/basicKnow/AddTerm.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <crumbs :title="minTitle" :param="$route.params" linkTo="MedicalName"></crumbs>
+    <crumbs :title="minTitle" :param="$route.params" linkTo="BasicTermsMaintenance"></crumbs>
     <div class="contents">
       <div class="content">
         <h3>添加术语:</h3>
@@ -72,7 +72,7 @@
                       v-for="item in group.options"
                       :key="item.id"
                       :label="item.name"
-                      :value="item.name"
+                      :value="item.code"
                     ></el-option>
                   </el-option-group>
                 </el-select>
@@ -95,7 +95,7 @@
               <td class="descs">术语性质</td>
               <td v-if="id">操作</td>
             </tr>
-            <tr v-for="(item,index) in allwords">
+            <tr v-for="(item,index) in allwords" :key="index">
               <td class="ind">{{index+1}}</td>
               <td :title="item.name&&item.name.length>9?item.name:''">
                 <!-- 使用原生input,输入限制 -->
@@ -175,6 +175,7 @@
                 <el-radio
                   v-for="(item,index) in allwords"
                   :label="index"
+                  :key="index"
                   :disabled="index == 0"
                 >选为标准词</el-radio>
               </el-radio-group>
@@ -191,7 +192,7 @@
             <td class="desc">说明</td>
             <td v-if="id">操作</td>
           </tr>
-          <tr v-for="(item,index) in synonymous">
+          <tr v-for="(item,index) in synonymous" :key="index">
             <td class="ind">{{index+1}}</td>
             <td :title="item.name&&item.name.length>9?item.name:''">
               <!-- 使用原生input,输入限制 -->
@@ -236,7 +237,7 @@
           <el-form label-width="150px">
             <el-form-item label="性别:">
               <el-select v-model="sexType">
-                <el-option v-for="(it,i) in sex" :label="it.name" :value="it.name"></el-option>
+                <el-option v-for="(it,i) in sex" :key="i" :label="it.name" :value="it.name"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="年龄:" class="ages">
@@ -259,7 +260,7 @@
             </el-form-item>
             <el-form-item label="归属类型:" v-if="dioType" class="marT">
               <el-select v-model="dioType">
-                <el-option v-for="(it,i) in dioTypeList" :label="it.name" :value="it.val"></el-option>
+                <el-option v-for="(it,i) in dioTypeList" :key="i" :label="it.name" :value="it.val"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item
@@ -290,7 +291,7 @@
   </div>
 </template>
 <script type="text/javascript">
-import api from '@api/icss.js';
+import api from '@api/knowledgeTree.js';
 import pinyin from '../../js/Convert_Pinyin.js';
 import utils from '@api/utils.js';
 import SimilarListDrag from './SimilarListDrag';
@@ -354,7 +355,7 @@ export default {
   },
   created() {
     this.getTypeList();
-    const id = this.$route.params.id || '';
+    const id = this.$route.params.id;
     const copy = this.$route.params.copy || '';
     this.copy = copy;
     if (id) {
@@ -402,7 +403,6 @@ export default {
         if (data.code == 0) {
           this.deptList = data.data;
           if (!conptId) {
-            console.log('this.deptListArr');
             this.dept = '全科'; //默认展示全科
           } else {
             // 科室id转成name显示
@@ -456,30 +456,55 @@ export default {
         this.radioVal = '';
       }
     },
+    reViewData(data) {
+      let tmpObj = [{
+        isConcept: data.isConcept,
+        name: data.libName,
+        remark: data.remark,
+        spell: data.spell,
+        type: data.typeName,
+        conceptId: data.conceptId,
+        libId: data.libId,
+        isHasCommon: data.isHasCommon,
+        synonymName: data.synonymName,
+        status: data.status,
+        typeId: data.libType
+      }]
+      for(let i = 0;i < data.klConceptSub.length;i++){
+        let tmp = data.klConceptSub[i]
+        tmp.name = tmp.libName
+        tmp.type = tmp.typeName
+        tmp.typeId = tmp.libType
+      }
+      data.libName = tmpObj
+      data.otherNames = data.klConceptSub
+      return data
+    },
     getDetail(ids) {
       if (ids) {
-        api.getMedicalDetail({ conceptId: ids }).then(res => {
+        api.getBaseConceptAll({ conceptId: ids }).then(res => {
           const result = res.data;
+          let redata = this.reViewData(result.data)
           if (result.code == 0) {
-            this.data = result.data.libName[0];
-            this.singleword = result.data.libName;
-            this.synonymous = result.data.otherNames;
-            this.allwords = result.data.libName.concat(result.data.otherNames);
-            this.showMore = result.data.isHasCommon;
-            this.maxAge = result.data.maxAge;
-            this.minAge = result.data.minAge;
-            this.description = result.data.description;
-            this.explains = result.data.explains;
-            const type = result.data.type;
+            this.data = redata.libName[0];
+            this.singleword = redata.libName;
+            this.synonymous = redata.otherNames;
+            this.allwords = redata.libName.concat(result.data.otherNames);
+            this.showMore = redata.isHasCommon;
+            this.maxAge = redata.maxAge;
+            this.minAge = redata.minAge;
+            this.description = redata.description;
+            this.explains = redata.explains;
+            const type = redata.type;
 
             if (type == '诊断') {
-              this.dioType = result.data.classify || 'Ⅰ'; //类型,默认展示Ⅰ类
-              const deptConptId = result.data.deptId;
+              this.dioType = redata.classify || 'Ⅰ'; //类型,默认展示Ⅰ类
+              const deptConptId = redata.deptId;
               this.getDioType(true);
               this.getDdeptList(deptConptId);
             }
             // this.sexType = result.data.sexType;
-            let sexType = result.data.sexType;
+            let sexType = redata.sexType;
             this.sex.map((v, i) => {
               if (v.value == sexType) {
                 this.sexType = v.name;
@@ -495,27 +520,27 @@ export default {
       }
     },
     getTypeList() {
-      api
-        .allKnowledgeType({ name: '' })
+      api.baseTypeGetPage({ name: '',size: 1000 })
         .then(res => {
           const data = res.data;
           if (data.code == 0) {
-            // this.typeList = data.data.records;
-            this.typeList = data.data;
+            let types = data.data.records
+            this.typeList = types;
+            // this.typeList = data.data;
             // 类型改成平铺
-            if (data.data.length > 0) {
-              const total = data.data.length;
+            if (types.length > 0) {
+              const total = types.length;
               const average = parseInt(total / 3);
               const mod = total % 3; //余数
-              const firstGroup = data.data.slice(0, average);
+              const firstGroup = types.slice(0, average);
               let secGroup = [];
               let thirdGroup = [];
               if (mod == 2) {
-                secGroup = data.data.slice(average, average * 2 + 1);
-                thirdGroup = data.data.slice(average * 2 + 1, total);
+                secGroup = types.slice(average, average * 2 + 1);
+                thirdGroup = types.slice(average * 2 + 1, total);
               } else {
-                secGroup = data.data.slice(average, average * 2);
-                thirdGroup = data.data.slice(average * 2, total);
+                secGroup = types.slice(average, average * 2);
+                thirdGroup = types.slice(average * 2, total);
               }
               this.options.push(
                 { label: 1, options: firstGroup },
@@ -628,6 +653,8 @@ export default {
       // e.target.value = e.target.value.replace(/[^a-zA-Z]/g,'');
     },
     getSimilarList(name) {
+      //不知道还有没有用
+      return
       if (!name) {
         this.closeTable();
         return;
@@ -735,9 +762,7 @@ export default {
           return item.name;
         });
       }
-
       let detailList = [];
-      detailList[0] = this.data;
       for (let i = 0; i < realData.length; i++) {
         realData[i].type = this.data.type;
         detailList.push(realData[i]);
@@ -764,69 +789,54 @@ export default {
         this.warning('请输入填写单患者界面展示通俗内容');
         return;
       }
-
-      let params;
-      if (this.showMore == 1) {
-        // 下拉文字转code
-        let sexCode;
+      console.log(this.data)
+      let params,sexCode=null;
+      if (this.showMore == 1) {// 下拉文字转code
         this.sex.map((v, i) => {
           if (v.name == this.sexType) {
             sexCode = v.value;
           }
         });
-
-        if (this.dioType) {
-          const deptList = this.deptList;
-          let conptId = null;
-          for (let i in deptList) {
-            if (deptList[i].name == this.dept) {
-              conptId = deptList[i].conceptId;
-            }
-          }
-          params = {
-            addCptDiseaseExtVO: {
-              classify: this.dioType,
-              deptId: conptId
-            },
-            name: this.data.name,
-            type: this.data.type,
-            detailList: detailList,
-            conceptId: this.copy ? '' : this.id, //复制当新增,把id置空
-            sexType: sexCode,
-            maxAge: this.maxAge,
-            minAge: this.minAge
-          };
-        } else {
-          params = {
-            name: this.data.name,
-            type: this.data.type,
-            detailList: detailList,
-            conceptId: this.copy ? '' : this.id, //复制当新增,把id置空
-            sexType: sexCode,
-            maxAge: this.maxAge,
-            minAge: this.minAge,
-            symptomExtVO: {
-              description: this.description,
-              explains: this.explains
-            }
-          };
+        params = {
+          conceptId: this.copy ? '' : this.id,
+          isConcept: this.data.isConcept,
+          libName: this.data.name,
+          remark: this.data.remark,
+          spell: this.data.spell,
+          status: this.data.status,
+          libType: this.data.typeId,
+          synonymName: this.data.synonymName,
+          isHasCommon: this.data.isHasCommon,
+          libId: this.data.libId,
+          klConceptSub:detailList,
+          sexType:sexCode,
+          maxAge:this.maxAge,
+          minAge:this.minAge
         }
-      } else {
+      }else{
         params = {
-          name: this.data.name,
-          type: this.data.type,
-          detailList: detailList,
-          conceptId: this.copy ? '' : this.id
+          conceptId: this.copy ? '' : this.id,
+          isConcept: this.data.isConcept,
+          libName: this.data.name,
+          remark: this.data.remark,
+          spell: this.data.spell,
+          libType: this.data.typeId||this.data.type,
+          libId: this.data.libId||0,
+          status: this.data.status,
+          isHasCommon: this.data.isHasCommon,
+          synonymName: this.data.synonymName,
+          klConceptSub: [],
         };
       }
+      // return
       this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-      api.addMedicalName(params).then(res => {
+      api.saveBaseConceptInfo(params).then(res => {
         const result = res.data;
         if (result.code == 0) {
           this.warning(res.data.msg || '操作成功', 'success');
           //返回带搜索条件的首页
           this.$router.push({
-            name: 'MedicalName',
+            name: 'BasicTermsMaintenance',
             params: Object.assign({}, this.$route.params, { currentPage: 1 })
           });
           /*if(flg == 14){
@@ -872,6 +882,7 @@ tr,
 td {
   list-style: none;
 }
+
 /deep/ .radioWrap .el-radio {
   display: block;
   height: 41px;

+ 56 - 23
src/components/basicKnow/BasicTermsMaintenance.vue

@@ -11,13 +11,23 @@
               v-for="item in typeList"
               :key="item.id"
               :label="item.name"
-              :value="item.name"
+              :value="item.code"
             ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="同义词:">
           <el-input size="mini" v-model="filter.libName" placeholder="输入同义词"></el-input>
         </el-form-item>
+                <el-form-item label="状态:">
+                    <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
+                        <el-option
+                                v-for="item in stateSelect"
+                                :key="item.id"
+                                :label="item.name"
+                                :value="item.id">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
         <el-form-item>
           <el-button size="mini" @click="filterDatas">搜索</el-button>
         </el-form-item>
@@ -38,10 +48,15 @@
       <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="libName" label="医学标准术语" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="libType" label="术语类型"></el-table-column>
-        <el-table-column prop="otherNames" label="同义词" show-overflow-tooltip></el-table-column>
-        <el-table-column prop="operName" label="操作人"></el-table-column>
-        <el-table-column prop="operTime" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column prop="typeName" label="术语类型"></el-table-column>
+        <el-table-column prop="synonymName" label="同义词" show-overflow-tooltip></el-table-column>
+        <el-table-column label="状态" width="100">
+          <template slot-scope="scope">
+            <span :class="scope.row.isDeleted == 'Y'?'deletes':'reviews'">{{scope.row.isDeleted == 'N'?'启用中':'禁用中'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifierName" label="操作人"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
         <el-table-column label="操作" width="160">
           <template slot-scope="scope">
             <el-button
@@ -63,7 +78,7 @@
               size="small"
               :class="scope.row.isDeleted == 'N'?'delete':'review'"
               @click="showDelDialog(scope.row)"
-            >{{scope.row.isDeleted == 'N'?'删除':'恢复'}}</el-button>
+            >{{scope.row.isDeleted == 'Y'?'启用':'禁用'}}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -82,7 +97,7 @@
 </template>
 
 <script>
-import api from '@api/icss.js';
+import api from '@api/knowledgeTree.js';
 import config from '@api/config.js';
 import utils from '@api/utils.js';
 
@@ -91,6 +106,10 @@ export default {
   data: function() {
     return {
       list: [],
+      stateSelect:[
+          {id:'N',name:'启用'},
+          {id:'Y',name:'禁用'},
+      ],
       // isState:'',
       cacheData: {}, //因为删除和恢复要及时更新,所以不做缓存
       currentPage: 1,
@@ -110,12 +129,14 @@ export default {
   },
   created() {
     // this.getDataList();
-    // this.getTypeList();
+    this.getTypeList();
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
-      // that.getDataList();
     });
+    this.$nextTick(()=>{
+      that.getDataList();
+    })
   },
   watch: {
     filter: {
@@ -145,7 +166,7 @@ export default {
     reloadLib() {
       if (this.reloadFlag) {
         this.reloadFlag = false;
-        api.reloadLib().then(res => {
+        api.clearStandRuleDrug().then(res => {
           if (res.data.code == 0) {
             this.reloadFlag = true;
           }
@@ -189,13 +210,16 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       });
-      api
-        .knowledgeName(param)
+      api.getBaseConceptInfoPage(param)
         .then(res => {
           loading.close();
           if (res.data.code == '0') {
             const data = res.data.data;
-            this.list = data.records;
+            const templis = data.records;
+            for(let i = 0;i < templis.length;i++){
+              templis[i].isDeleted = templis[i].status=='1'?'N':'Y'
+            }
+            this.list = templis;
             // this.cacheData[param.current] = data.records;
             this.total = data.total;
             if (this.inCurrentPage !== undefined) {
@@ -210,11 +234,11 @@ export default {
     },
     getTypeList() {
       api
-        .allKnowledgeType({ name: '' })
+        .baseTypeGetPage({ name: '',size: 1000 })
         .then(res => {
           const data = res.data;
           if (data.code == 0) {
-            this.typeList = data.data;
+            this.typeList = data.data.records||[];
           } else {
             console.log(res.msg);
           }
@@ -232,11 +256,12 @@ export default {
         this.clearFilter();
       }
       const param = {
-        name: this.filter.term.trim(),
+        "libName": this.filter.term.trim(),
+        "libType": this.filter.type,
+        "status": this.filter.isState=='N'?'1':this.filter.isState=='Y'?'0':'',
+        "synonymName": this.filter.libName.trim(),
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        type: this.filter.type,
-        libName: this.filter.libName.trim(),
         isDeleted: this.filter.isState
       };
       return param;
@@ -276,16 +301,15 @@ export default {
           id:item.id
         }*/
       const param = {
-        conceptId: item.conceptId,
-        isDeleted: item.isDeleted === 'N' ? 'Y' : 'N'
+        conceptId: item.conceptId
       };
+      let url = item.isDeleted === 'N'?'disableConcept':'startConcept'
       let waringTxt =
         item.isDeleted === 'N'
-          ? '是否删除该标准术语?'
+          ? '是否禁用该标准术语?'
           : '是否重新启用该条数据?';
       this.showConfirmDialog(waringTxt, () => {
-        api
-          .deletMedicalName(param)
+        api[url](param)
           .then(res => {
             if (res.data.code == '0') {
               if (!this.searched) {
@@ -345,6 +369,15 @@ export default {
 .review {
   color: #22ccc8;
 }
+.deletes {
+  cursor: default;
+  color: red;
+}
+.reviews {
+  color: #606266;
+  cursor: default;
+
+}
 .el-table .cell {
   overflow: hidden;
   white-space: nowrap;

+ 1 - 1
src/less/admin.less

@@ -192,7 +192,7 @@ body {
       }
     }
     ul {
-      max-width: 300px;
+      // max-width: 300px;   //影响其他页面控件
     }
 
     /deep/ .el-scrollbar {