avue 折叠搜索条件

搜索条件过多会导致展示的table内容行少

        <template slot="searchMenu" slot-scope="scope">
          <el-button @click="searchToggle">{{ searchShow ? '折叠搜索' : '展开搜索' }}</el-button>
        </template>

  

    searchToggle() {
      this.searchShow = !this.searchShow;
      let needSearchArr = ['orderDateRange','yzBatchNo','invoiceNo','dataSource','redChong','invoiceType','ylzInvoiceNo','sourceSystem']
      let columnOption = this.$refs.crud.columnOption;
      for(let i=0; i<columnOption.length; i++) {
        for(let j=0; j<needSearchArr.length; j++) {
          if(needSearchArr[j] == columnOption[i].prop) {
            if(this.searchShow) {
              columnOption[i].search = true;
            } else {
              columnOption[i].search = false;
            }
          }
        }
      }
      this.$refs.crud.getTableHeight()
    },

 

posted @ 2024-12-25 14:40  LaLaLa_heng  阅读(104)  评论(0)    收藏  举报