浏览代码

修改表格高度控制

caojunjie 3 年之前
父节点
当前提交
1ece21f49d
共有 3 个文件被更改,包括 16 次插入10 次删除
  1. 1 1
      public/cdn/avue/2.8.18/avue.min.js
  2. 1 0
      src/views/base/credentials.vue
  3. 14 9
      src/views/exportTrade/customerInquiry/index.vue

文件差异内容过多而无法显示
+ 1 - 1
public/cdn/avue/2.8.18/avue.min.js


+ 1 - 0
src/views/base/credentials.vue

@@ -96,6 +96,7 @@ export default {
       option: {
         searchMenuPosition: "right",
         searchMenuSpan: 18,
+        height:500,
         index: true,
         align: 'center',
         menuAlign: 'center',

+ 14 - 9
src/views/exportTrade/customerInquiry/index.vue

@@ -20,6 +20,7 @@
         :summary-method="summaryMethod"
         @selection-change="selectionChange"
         @expand-change="expandChange"
+        @search-criteria-switch="searchCriteriaSwitch"
       >
         <template slot-scope="{ row }" slot="expand">
           <avue-crud
@@ -249,16 +250,22 @@ export default {
     }
   },
   methods: {
+    searchCriteriaSwitch(type){
+      if (type){
+        this.option.height = this.option.height-190
+      }else {
+        this.option.height = this.option.height+190
+      }
+      this.$refs.crud.getTableHeight()
+    },
     cellStyle() {
       return "padding:0;height:40px;";
     },
     expandChange(row) {
       if (!row.itemData) {
-        getGoodsInfo({ id: row.id, tradeType: "CK" })
-          .then(res => {
+        getGoodsInfo({ id: row.id, tradeType: "CK" }).then(res => {
             this.dataList[row.$index].itemData = res.data.data;
-          })
-          .finally(() => {
+          }).finally(() => {
             this.dataList[row.$index].itemLoading = false;
           });
       }
@@ -359,8 +366,7 @@ export default {
       this.dataList.forEach(item => {
         this.$refs.crud.toggleRowExpansion(item, false);
       });
-      getList(page.currentPage, page.pageSize, params)
-        .then(res => {
+      getList(page.currentPage, page.pageSize, params).then(res => {
           if (res.data.data.records) {
             res.data.data.records.forEach(e => {
               e.itemLoading = true;
@@ -369,10 +375,9 @@ export default {
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {
-            this.option.height = window.innerHeight - 350;
+            this.option.height = window.innerHeight - 210;
           }
-        })
-        .finally(() => {
+        }).finally(() => {
           this.loading = false;
         });
     },

部分文件因为文件数量过多而无法显示