Browse Source

提交增加分页

wenmenghao 1 năm trước cách đây
mục cha
commit
b92138a148

+ 9 - 10
apps/mobile/src/views/reportAnalysis/reportdownloadDetails.vue

@@ -152,8 +152,8 @@ export default {
     },
     async getList() {
       const query = {
-        // num: this.list.pageNum,
-        // size: this.list.pageSize
+        pageNum: this.list.pageNum,
+        pageSize: this.list.pageSize,
         productCode: this.getproductCode
       }
       console.log('搜索参数:', query)
@@ -162,21 +162,20 @@ export default {
       this.list.loading = false
       this.list.loaded = true
       if (data && Array.isArray(data.list)) {
-        // this.list.pageNum += 1
-        // this.list.total = data.total
+        this.list.pageNum += 1
+        this.list.total = data.total
         // this.list.total = 10 //不支持分页可以写死
         this.list.value = this.list.value.concat(data.list)
-        this.list.finished = true
       } else {
         this.list.finished = true
       }
       // 数据请求完成(根据页码计算,当前页是否是最后一页)
       // 请求完成后,页码就变为了下一页的页面,所以这里要-1
-      // const isLastPage =
-      //   (this.list.pageNum - 1) * this.list.pageSize >= this.list.total
-      // if (isLastPage) {
-      //   this.list.finished = true
-      // }
+      const isLastPage =
+        (this.list.pageNum - 1) * this.list.pageSize >= this.list.total
+      if (isLastPage) {
+        this.list.finished = true
+      }
     },
     nameF(item) {
       if (item.userType === 0) {