wangting
2024-03-20 04af966bddb7dfb8e850bf0e314defc83cbe3f4e
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -1,5 +1,5 @@
<template>
  <div>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid" style="overflow: hidden">
    <avue-crud v-model="form"
               :data="tableList"
               :option="option"
@@ -49,6 +49,8 @@
  },
  data() {
    return {
      clientHeight:0,
      parentHeight:'100%',//当前组件根节点元素高度
      form: {},
      formName: '',
      loading: false,
@@ -616,17 +618,15 @@
      ],
    }
  },
  mounted() {
    console.log('componentVO',this.componentVO)
  },
  computed: {
      option() {
    option() {
      return {
        index: true,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        height: 'auto',
        height: this.parentHeight,
        calcHeight: 15,
        indexFixed: false,
        menuFixed: false,
        column: this.updatedColumns,
@@ -648,6 +648,20 @@
      });
    },
  },
  watch:{
    clientHeight: {
      handler(newval) {
        if(newval>50){
          //父元素高度-按钮高度-分页高度
          this.parentHeight=this.$el.clientHeight-this.$children[0].$children[1].$children[0].$el.clientHeight-this.$children[0].$children[2].$el.clientHeight;
          console.log(this.parentHeight)
        }
      }
    },
  },
  mounted() {
    this.clientHeight=this.$el.clientHeight;
  },
  methods: {
    buttonClick(scope, item) {
      this.formName = item.name;