wangting
2024-03-28 11654cd865cb3c01817eeb765e341bb617a23458
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -6,6 +6,7 @@
               :option="option"
               :page.sync="pageType"
               :table-loading="loading"
               @row-click="rowClickChange"
               @selection-change="selectChange">
      <!--top区域按钮-->
      <template slot="menuLeft" slot-scope="scope">
@@ -23,6 +24,8 @@
</template>
<script>
import {treeMenu} from '@/api/treeMyMenu'
import {validatenull} from '@/util/validate'
export default {
  name: "dynamic-table",
  props: {
@@ -483,6 +486,8 @@
        calcHeight: 15,
        indexFixed: false,
        menuFixed: false,
        searchMenuSpan:12,
        searchShow:false,
        column: [],
      },
      selectList: [],
@@ -490,8 +495,11 @@
  },
  computed: {
    updatedColumns() {
      const queryFields = !validatenull(this.componentVO.tableDefineVO.queryColumns) ? this.componentVO.tableDefineVO.queryColumns.map(item => item.field) : [];
      return this.componentVO.tableDefineVO.cols[0].map(item => {
        const typeValue = item.fieldType === 'text' || item.fieldType === 'combox' ? 'input' : item.fieldType; // 表单Type类型
        const search = queryFields.includes(item.field); // 判断 field 是否在 queryColumns 里
        return {
          align: item.align,
@@ -501,11 +509,12 @@
          hidden: item.hidden,
          label: item.title,
          width: item.width,
          search: search
        };
      });
    },
    pageType() {
      return this.areasName === 'westArea' ? this.simplePage : this.page;
      return this.areasName.indexOf('westArea') == 0  ? this.simplePage : this.page;
    }
  },
  watch: {
@@ -529,6 +538,13 @@
          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() {
@@ -541,11 +557,15 @@
    }
  },
  methods: {
    rowClickChange(row){
      this.$refs.dataTable.toggleRowSelection(row);
    },
    selectChange(row) {
      this.selectList = row;
    },
    TreeSelectChange(row) {
      this.TreeSelectList = row;
      this.$emit("setDataStore", {
        area: this.areasName,
        dataStore:row
      });
    }
  }
}