ludc
2024-04-09 fecc7305a48f8ce6e283434718da33e143885c75
Source/ProjectWeb/src/components/dynamic-components/dynamic-tree.vue
@@ -1,5 +1,6 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
    <dynamic-button v-if="componentVO.buttons && componentVO.buttons.length>0" :butttonList="componentVO.buttons" :selectList="checkDatas" type="tree" style="margin-bottom: 10px;"></dynamic-button>
    <el-input
      placeholder="输入关键字进行过滤"
      v-model="filterText">
@@ -7,6 +8,7 @@
    <el-tree
      class="filter-tree"
      :show-checkbox="isMuti"
      :check-on-click-node="true"
      :lazy="lazy"
      :data="data"
      :load="loadNode"
@@ -80,8 +82,8 @@
    },
    sourceData:{
      handler(newval) {
        console.log(this.areasName);
        console.log(newval);
        //源数据有变化时变更当前区域数据
        this.initData();
      }
    }
  },
@@ -93,7 +95,7 @@
        label: 'text'
      },
      lazy:this.componentVO.treeDefineVO.loadType == 'node',
      isMuti:true,
      isMuti:false,
      data:[],
      checkDatas:[]
    }
@@ -102,7 +104,9 @@
    this.initData();
  },
  mounted() {
    console.log(this.$el.clientHeight)
    if(this.componentVO.buttons && this.componentVO.buttons.length>0){
      this.$children[2].$el.style.height = 'calc(100% - 50px - '+this.$children[0].$el.clientHeight+'px - 10px)';
    }
  },
  methods: {
    filterNode(value, data) {
@@ -1998,12 +2002,7 @@
      //逐级加载
      const parentOid = (node.level === 0) ? 0 : node.data.oid;
      setTimeout(() => {
        const data = [{
          name: 'leaf',
          leaf: true
        }, {
          name: 'zone'
        }];
        const data = this.data;
        resolve(data);
      }, 500);