田源
2024-04-15 52e123212f37e214ee4599649adbd743e0d86c2b
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -6,16 +6,18 @@
               :option="option"
               :page.sync="pageType"
               :table-loading="loading"
               @row-click="rowClickChange"
               @search-change='searchChange'
               @selection-change="selectChange">
      <!--top区域按钮-->
      <template slot="menuLeft" slot-scope="scope">
        <dynamic-button :butttonList="componentVO.buttons" :selectList="selectList" LocationType="top"
        <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="selectList" LocationType="top" :sourceData="sourceData"
                        type="table"></dynamic-button>
      </template>
      <!--menu区域按钮-->
      <template slot="menu" slot-scope="scope">
        <dynamic-button :butttonList="componentVO.buttons" :scope="scope" :selectList="selectList" LocationType="menu"
        <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="selectList" :sourceData="sourceData" LocationType="menu"
                        type="table"></dynamic-button>
      </template>
    </avue-crud>
@@ -23,7 +25,6 @@
</template>
<script>
import {treeMenu} from '@/api/treeMyMenu'
import {validatenull} from '@/util/validate'
export default {
  name: "dynamic-table",
@@ -513,7 +514,7 @@
      });
    },
    pageType() {
      return this.areasName.indexOf('westArea') == 0  ? this.simplePage : this.page;
      return this.areasName === 'westArea' ? this.simplePage : this.page;
    }
  },
  watch: {
@@ -537,12 +538,6 @@
          this.parentHeight = this.$el.clientHeight - this.$children[0].$children[1].$children[0].$el.clientHeight - this.$children[0].$children[2].$el.clientHeight - 5;
        }
      }
    },
    sourceData:{
      handler(newval) {
        console.log(this.areasName);
        console.log(newval);
      }
    }
  },
  created() {
@@ -555,12 +550,22 @@
    }
  },
  methods: {
    rowClickChange(row){
      this.$refs.dataTable.toggleRowSelection(row);
    },
    selectChange(row) {
      this.selectList = row;
      this.$emit("setDataStore", {
        area: this.areasName,
        type:this.componentVO.uiComponentType,
        dataStore:row
      });
    },
    searchChange(form,done){
      done();
    },
    handleRefresh(){
      this.$refs.dataTable.refreshTable();
    }
  }
}