wangting
2024-05-09 4e778d7f61e2508455e3a69815f7a17c455d81da
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -13,7 +13,7 @@
               @size-change="sizeChange"
               @row-click="rowClickChange"
               @search-change='searchChange'
               @filter-change="filterChange"
               @filter="filterChange"
               @selection-change="selectChange">
      <!--top区域按钮-->
      <template slot="menuLeft" slot-scope="scope">
@@ -29,6 +29,7 @@
        <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="selectList" :sourceData="sourceData"
                        LocationType="menu"
                        @afterMethod="handleRefresh"
                        @rowView="rowView"
                        type="table"></dynamic-button>
      </template>
      <template  slot="menuRight" slot-scope="scope">
@@ -144,6 +145,7 @@
        filterBtn:false,
        selection: true,
        tip: false,
        menuWidth:260,
        height: '100%',
        calcHeight: 15,
        indexFixed: false,
@@ -313,7 +315,7 @@
    onLoad(page, params = {}) {
      if (Object.keys(this.sourceData).length>0 && this.isShow) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params,this.params,this.query)).then(res => {
        getList(page.currentPage, page.pageSize, Object.assign({},this.params,this.query,params)).then(res => {
          let data = [];
          if (res.data && res.data.data) {
            data = res.data.data;
@@ -334,6 +336,9 @@
        });
      }
    },
    rowView(row,index){
      this.$refs.dataTable.rowView(row,index)
    },
    rowClickChange(row){
      this.$refs.dataTable.toggleRowSelection(row);
    },
@@ -353,14 +358,33 @@
      this.page.pageSize = pageSize;
    },
    searchChange(params,done){
      this.query = params;
      this.query = {};
      for (let i in params) {
        this.query['conditionMap["' + i + '"]'] = "*" + params[i] + "*";
      }
      this.page.currentPage = 1;
      this.onLoad(this.page);
      done();
    },
    filterChange(result){
      debugger;
      let parms={}
      for (let i in result) {
        if(!validatenull(result[i][2])) {
          const fieldVal = result[i][2]
          if (result[i][1] == "=") {
            parms['conditionMap["' + result[i][0] + '"]'] = fieldVal;
          } else if (result[i][1] == "≠") {
            parms['conditionMap["' + result[i][0] + '"]'] = '!=' + fieldVal;
          } else if (result[i][1] == "like") {
            parms['conditionMap["' + result[i][0] + '"]'] = "*" + fieldVal + "*";
          } else if (result[i][1] == "∈") {
            parms['conditionMap["' + result[i][0] + '"]'] = "*" + fieldVal + "*";
          } else {
            parms['conditionMap["' + result[i][0] + '"]'] = result[i][1] + fieldVal;
          }
        }
      }
      this.onLoad(this.page,parms);
    },
    searchReset() {
      this.query = {};
@@ -375,7 +399,7 @@
      }
    },
    handleRefresh(type) {
      this.onLoad(this.page, this.query);
      this.onLoad(this.page);
    },
    rowExcel() {
      //导出