lilei 1 年之前
父节点
当前提交
67e367a213
共有 3 个文件被更改,包括 12 次插入4 次删除
  1. 1 1
      public/version.json
  2. 9 3
      src/components/Table/index.js
  3. 2 0
      src/views/reportData/receivedSendStorageReport/list.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1717378478497
+  "version": 1717384672649
 }

+ 9 - 3
src/components/Table/index.js

@@ -10,6 +10,8 @@ export default {
       localLoading: false,
       localDataSource: [],
       localPagination: Object.assign({}, this.pagination),
+      localSorter: null,
+      localFilter: null,
       isSucceed: true ,//  是否请求成功
       leftAlignId:"",
     }
@@ -133,6 +135,7 @@ export default {
       showSizeChanger: this.showSizeChanger
     }) || false
     this.needTotalList = this.initTotalList(this.columns)
+    this.localSorter = null
     if (this.defaultLoadData) {
       this.loadData()
     }
@@ -147,7 +150,8 @@ export default {
       bool && (this.localPagination = Object.assign({}, {
         current: 1, pageSize: this.localPagination.pageSize
       }))
-      this.loadData()
+      console.log(this.localSorter)
+      this.loadData(null,null,this.localSorter)
     },
     // 重置表格为空
     clearTable () {
@@ -166,6 +170,7 @@ export default {
      * @param {Object} sorter 排序条件
      */
     loadData (pagination, filters, sorter) {
+      console.log(sorter)
       this.localLoading = true
       const parameter = Object.assign({
         pageNo: (pagination && pagination.current) ||
@@ -177,13 +182,14 @@ export default {
       },
       (sorter && sorter.field && {
         sortField: sorter.field
-      }) || {},
+      }) || this.localSorter && {sortField: this.localSorter.field},
       (sorter && sorter.order && {
         sortOrder: sorter.order
-      }) || {}, {
+      }) || this.localSorter && {sortOrder: this.localSorter.order}, {
         ...filters
       }
       )
+      this.localSorter = sorter
       // console.log('parameter', parameter)
       const result = this.data(parameter)
       // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.count, r.data

+ 2 - 0
src/views/reportData/receivedSendStorageReport/list.vue

@@ -155,6 +155,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        console.log('loadData.parameter:', parameter)
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         if (this.queryParam.beginDate) {
@@ -243,6 +244,7 @@ export default {
       this.queryParam.productEntity.productTypeSn3 = ''
       this.productType = []
       this.totalData = null
+
       this.$refs.table.clearTable()
       this.$refs.ruleForm.resetFields()
     },