wangting
2024-04-16 0ae335556cd033125e06fff4463fe231eff160bc
树刷新
已修改1个文件
22 ■■■■ 文件已修改
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
@@ -20,6 +20,7 @@
      node-key="oid"
      @check="checkNode"
      @current-change="changeNode"
      @node-click="clickNode"
      ref="tree">
    </el-tree>
  </div>
@@ -119,6 +120,7 @@
      isMuti:false,
      data:[],
      checkDatas:[],
      currentClickNode:null,
      params:{},
      sourceDataMapParams:{}
    }
@@ -146,7 +148,8 @@
          if (this.sourceData.oid.indexOf('@vcitreesep@') > -1) {
            this.sourceData.oid = this.sourceData.oid.split('@vcitreesep@')[1];
          }
          sourceDataMap.sourceBtmName = this.sourceBtmType;;
          sourceDataMap.sourceBtmName = this.sourceBtmType;
          ;
          sourceDataMap.sourceOid = this.sourceData.oid;
        }
        for (let i in this.sourceData) {
@@ -198,7 +201,6 @@
          queryRoot: true
        }, this.params)).then(res => {
          this.data = res.data.treeData;
          this.checkDatas = [];
        }).catch(error => {
          this.$message.error(error);
        })
@@ -211,10 +213,6 @@
        parentOid= parentOid.split('@vcitreesep@')[1];
      }
      const parentBtmName = (node.level === 0) ? '' : node.data.attributes.btmname;
      let params=this.params;
      if(parentOid===0){
        //params.queryRoot=true;
      }
      getTree(parentOid,parentBtmName,this.params).then(res => {
        resolve(res.data.treeData)
      }).catch(error => {
@@ -231,8 +229,20 @@
        this.checkDatas=[data];
      }
    },
    clickNode(data, node) {
      this.currentClickNode = node;
    },
    handleRefresh(){
      if (!this.lazy) {
      this.initData();
      } else {
        if (this.currentClickNode) {
          let node = this.currentClickNode.parent;
          node.loaded = false;
          node.expand();
        }
      }
      this.checkDatas = [];
    }
  },
}