田源
2024-03-22 95110fc987846d9ccfd330bed0b0aefefd395f0f
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -1,22 +1,23 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
    <avue-crud v-model="form"
               ref="dataTable"
               :data="tableList"
               :option="option"
               :page.sync="page"
               :table-loading="loading">
      <!--top区域按钮-->
      <template slot="menuLeft" slot-scope="scope">
        <dynamic-button LocationType="top" type="table":butttonList="componentVO.buttons" ></dynamic-button>
      </template>
    <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
      <avue-crud v-model="form"
                 ref="dataTable"
                 :data="tableList"
                 :option="option"
                 :page.sync="pageType"
                 :table-loading="loading"
                 @selection-change="selectChange">
        <!--top区域按钮-->
        <template slot="menuLeft" slot-scope="scope">
          <dynamic-button LocationType="top" type="table":butttonList="componentVO.buttons" :selectList="selectList"></dynamic-button>
        </template>
      <!--menu区域按钮-->
      <template slot="menu" slot-scope="scope">
        <dynamic-button :scope="scope" LocationType="menu" type="table":butttonList="componentVO.buttons" ></dynamic-button>
      </template>
    </avue-crud>
  </div>
        <!--menu区域按钮-->
        <template slot="menu" slot-scope="scope">
          <dynamic-button :scope="scope" LocationType="menu" type="table":butttonList="componentVO.buttons" :selectList="selectList"></dynamic-button>
        </template>
      </avue-crud>
    </div>
</template>
<script>
@@ -49,18 +50,30 @@
      type: Boolean,
      default: true
    },
    dataStore:{
      //弹窗时按钮所属区域选中数据
      type:Array,
      default: []
    },
    tableType:{
      type:String
    }
  },
  data() {
    return {
      parentHeight:'100%',//当前组件根节点元素高度
      form: {},
      formName: '',
      loading: false,
      visible: false,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 5,
        total: 50,
      },
      simplePage:{
        currentPage: 1,
        total: 100,
        pagerCount:4,
        layout:"prev, pager, next"
      },
      //表格数据
      tableList: [
@@ -462,12 +475,15 @@
        addBtn: false,
        editBtn: false,
        delBtn: false,
        selection: true,
        tip:false,
        height: '100%',
        calcHeight: 15,
        indexFixed: false,
        menuFixed: false,
        column: [],
      },
      selectList:[],
    }
  },
  computed: {
@@ -486,6 +502,9 @@
        };
      });
    },
    pageType() {
      return this.areasName === 'westArea' ? this.simplePage : this.page;
    }
  },
  watch:{
    parentHeight:{
@@ -520,6 +539,12 @@
    }
  },
  methods: {
    selectChange(row){
      this.selectList = row;
    },
    TreeSelectChange(row){
      this.TreeSelectList = row;
    }
  }
}
</script>