Ver Fonte

修改逆变器数据查询分页问题

xusl há 11 meses atrás
pai
commit
0a1a826bc0

+ 20 - 6
ipp-ap/src/views/idp/data/inverterstatusdata/index.vue

@@ -71,10 +71,7 @@
                  :data="tableData"
                  :table-loading="tableLoading"
                  :option="tableOption"
-                 @search-change="searchChange"
-                 @refresh-change="refreshChange"
-                 @size-change="sizeChange"
-                 @current-change="currentChange">
+                 @on-load="getGridOnloadData">
       </avue-crud>
     </basic-container>
   </div>
@@ -131,6 +128,23 @@ export default {
     this.getAllInverterInfo()
   },
   methods: {
+    getGridOnloadData() {
+      const param = new URLSearchParams()
+      param.append('currentPage', this.page.currentPage)
+      param.append('pageSize', this.page.pageSize)
+      param.append('stationCode', this.stationCode)
+      param.append("equipmentId", this.equipmentId)
+      param.append('startTime', this.startTime)
+      param.append('endTime', this.endTime)
+      getByStationCodeAndEquipmentIdAndTimeBetween(param).then(response => {
+        this.tableData = response.data.data.records
+        this.page.total = response.data.data.total
+        this.page.pageSize = response.data.data.size
+        this.tableLoading = false
+      }).catch(() => {
+        this.tableLoading = false
+      })
+    },
     dateQuery() {
       if (this.equipmentId === '' || this.equipmentId == null) {
         return alert("请选择所属设备")
@@ -185,11 +199,11 @@ export default {
     searchChange(form, done) {
       this.searchForm = form
       this.page.currentPage = 1
-      this.dateQuery(this.page, form)
+      this.getList(this.page, form)
       done()
     },
     refreshChange() {
-      this.dateQuery()
+      this.getList(this.page)
     }
   }
 }

+ 0 - 1
ipp-ap/src/views/idp/data/windturbinestatusdata/index.vue

@@ -124,7 +124,6 @@ export default {
   },
   methods: {
     getGridOnloadData() {
-      console.log(this.page)
       const param = new URLSearchParams()
       param.append('currentPage', this.page.currentPage)
       param.append('pageSize', this.page.pageSize)

+ 2 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/controller/InverterStatusDataController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipp.idp.controller;
 
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jiayue.ipp.common.data.entity.InverterStatusData;
@@ -59,6 +60,7 @@ public class InverterStatusDataController {
     @PostMapping("/getByStationCodeAndEquipmentIdAndTimeBetween")
     public R getByStationCodeAndEquipmentIdAndTimeBetween(Long currentPage, Long pageSize, String stationCode, String equipmentId, Long startTime, Long endTime) {
         Page page = new Page(currentPage, pageSize);
+        page.addOrder(OrderItem.asc("time"));
         page.setMaxLimit((long) -1);
         return R.ok(inverterStatusDataService.page(page, inverterStatusDataService.getByStationCodeAndEquipmentIdAndTimeBetween(stationCode, equipmentId, new Date(startTime), new Date(endTime))));
     }