Sfoglia il codice sorgente

多层关联维护修改限制只显示三层

zhangxc 6 anni fa
parent
commit
d66d93520e
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      src/components/icss/AddMedicalMultRelation.vue

+ 7 - 2
src/components/icss/AddMedicalMultRelation.vue

@@ -124,7 +124,8 @@ import api from '@api/icss.js';
         excludedConceptIds:[],
         operaList: [],
         isEdit: false,  //是否为修改
-        relationConceptId: '' //关联父类ID
+        relationConceptId: '', //关联父类ID
+        level: 0, //层级(修改时只能显示三级)
       }
     },
     created(){
@@ -180,6 +181,7 @@ import api from '@api/icss.js';
         })
       },
       IteraNodeList(nodeList,  nodeListResult, type, level = 1) {
+        this.level= this.level + 1
         for(let i = 0; i <nodeList.length; i++) {
           let newChild;
           if(type == '0') { //添加的时候保存所有的id列表
@@ -190,7 +192,10 @@ import api from '@api/icss.js';
           } else if(type == '2') { //移除节点的时候同时移除节点(搜索时排除的id列表)
             newChild = nodeList[i].conceptId
           }
-          if(nodeList[i].nodeList.length > 0) {
+          if(this.level === 3) {
+            return
+          }
+          if(nodeList[i].nodeList &&nodeList[i].nodeList.length > 0) {
             if(type == '0' || type =='1') {
               this.IteraNodeList(nodeList[i].nodeList,  newChild.nodeList, type, level+1)
             } else if(type == '2') {