Przeglądaj źródła

fix: 修复执行记录分页查询

million 1 rok temu
rodzic
commit
4633aef038
1 zmienionych plików z 67 dodań i 12 usunięć
  1. 67 12
      front/admin-front/src/views/autoplay/index.vue

+ 67 - 12
front/admin-front/src/views/autoplay/index.vue

@@ -263,8 +263,13 @@
             <el-pagination
               small
               layout="prev, pager, next"
-              :page-size="10"
-              :total="3">
+              :hide-on-single-page="false"
+              :page-size="table.pageSize"
+              :total="table.total"
+              :current-page.sync="table.page"
+              @current-change="pageChange"
+            >
+
             </el-pagination>
           </div>
         </div>
@@ -398,8 +403,11 @@
             <el-pagination
               small
               layout="prev, pager, next"
-              :page-size="10"
-              :total="3">
+              :hide-on-single-page="false"
+              :page-size="viewRecordDetailsTable.pageSize"
+              :total="viewRecordDetailsTable.total"
+              :current-page.sync="viewRecordDetailsTable.page"
+              @current-change="viewRecordDetailsPageChange">
             </el-pagination>
           </div>
         </div>
@@ -524,8 +532,11 @@
             <el-pagination
               small
               layout="prev, pager, next"
-              :page-size="10"
-              :total="3">
+              :hide-on-single-page="false"
+              :page-size="viewRecordDetailsTable.pageSize"
+              :total="viewRecordDetailsTable.total"
+              :current-page.sync="viewRecordDetailsTable.page"
+              @current-change="viewRecordDetailsPageChange">
             </el-pagination>
           </div>
         </div>
@@ -674,8 +685,11 @@
             <el-pagination
               small
               layout="prev, pager, next"
-              :page-size="10"
-              :total="3">
+              :hide-on-single-page="false"
+              :page-size="viewRecordDetailsTable.pageSize"
+              :total="viewRecordDetailsTable.total"
+              :current-page.sync="viewRecordDetailsTable.page"
+              @current-change="viewRecordDetailsPageChange">
             </el-pagination>
           </div>
         </div>
@@ -995,7 +1009,17 @@ export default {
         taskCode: ''
       },
       addTaskProjectData: [],
-      confirmLoading:false
+      confirmLoading:false,
+      table:{
+        pageSize:10,
+        page:1,
+        total:0
+      },
+      viewRecordDetailsTable:{
+        pageSize:10,
+        page:1,
+        total:0
+      }
     }
   },
   mounted() {
@@ -1003,6 +1027,25 @@ export default {
     this.getWalletAddress()
   },
   methods: {
+    pageChange(page) {
+      this.table.page = page
+      let params = {
+        page: this.table.page,
+        pageSize: 10,
+        queryValue: this.currentTaskInfo.amsTaskId
+      }
+      getExecutionRecord(params).then((res) => {
+        this.drawerRecord = true
+        this.recordData = res.records
+        this.table.page = res.page
+        this.table.pageSize = res.pageSize
+        this.table.total = res.total
+      })
+    },
+    viewRecordDetailsPageChange(page){
+      this.viewRecordDetailsTable.page = page
+      this.refresh()
+    },
     progressBarDetails(item) {
       console.log(item);
       this.drawerRecord = true
@@ -1021,6 +1064,9 @@ export default {
       getInteractionRecord(params).then(res => {
         this.ongoingData = res.records
         this.ongoingDataTotal = res.total
+        this.viewRecordDetailsTable.page = res.page
+        this.viewRecordDetailsTable.pageSize = res.pageSize
+        this.viewRecordDetailsTable.total = res.total
       })
     },
     getTaskList() {
@@ -1171,30 +1217,39 @@ export default {
       getExecutionRecord(params).then((res) => {
         this.drawerRecord = true
         this.recordData = res.records
+        this.table.page = res.page
+        this.table.pageSize = res.pageSize
+        this.table.total = res.total
       })
     },
     viewRecordDetails(item, page) {
       this.drawerRecordStatus = page
       this.currentRecordData = item
-      console.log(item);
+      // console.log(item);
       let params = {
-        page: 1,
+        page: this.viewRecordDetailsTable.page,
         pageSize: 10,
         queryValue: item.executeId
       }
       getInteractionRecord(params).then(res => {
         this.ongoingData = res.records
         this.ongoingDataTotal = res.total
+        this.viewRecordDetailsTable.page = res.page
+        this.viewRecordDetailsTable.pageSize = res.pageSize
+        this.viewRecordDetailsTable.total = res.total
       })
     },
     refresh() {
       let params = {
-        page: 1,
+        page: this.viewRecordDetailsTable.page,
         pageSize: 10,
         queryValue: this.currentRecordData.executeId
       }
       getInteractionRecord(params).then(res => {
         this.ongoingData = res.records
+        this.viewRecordDetailsTable.page = res.page
+        this.viewRecordDetailsTable.pageSize = res.pageSize
+        this.viewRecordDetailsTable.total = res.total
       })
     },
     getParameterSearch(taskCode) {