Browse Source

fix: 定时任务分页问题修复

johnsen 10 months ago
parent
commit
f961a3e663
1 changed files with 15 additions and 4 deletions
  1. 15 4
      src/views/platform/job/list.vue

+ 15 - 4
src/views/platform/job/list.vue

@@ -116,7 +116,10 @@ export default {
             height: document.clientHeight,
             height: document.clientHeight,
             logHeight: 600,
             logHeight: 600,
             listData: [],
             listData: [],
-            pagination: {},
+            pagination: {
+                limit: 20,
+                page: 1
+            },
             sorts: {},
             sorts: {},
             listConfig: {
             listConfig: {
                 toolbars: [
                 toolbars: [
@@ -163,7 +166,7 @@ export default {
                 rowHandle: {
                 rowHandle: {
                     actions: [{
                     actions: [{
                         key: 'remove'
                         key: 'remove'
-                    },{
+                    }, {
                         key: 'addTrigger',
                         key: 'addTrigger',
                         icon: 'ibps-icon-add',
                         icon: 'ibps-icon-add',
                         label: '添加计划'
                         label: '添加计划'
@@ -213,14 +216,22 @@ export default {
             const page = {
             const page = {
                 requestPage: {
                 requestPage: {
                     limit: this.pagination.limit || 20,
                     limit: this.pagination.limit || 20,
-                    pageNo: this.pagination.pageNo || 1
+                    pageNo: this.pagination.page || 1
                 }
                 }
             }
             }
             queryPageList({
             queryPageList({
                 jobName,
                 jobName,
                 group
                 group
             }, page).then(response => {
             }, page).then(response => {
-                ActionUtils.handleListData(this, response.data)
+                const data = response.data
+                data.pageResult = {
+                    'limit': this.pagination.limit || 20,
+                    'page': this.pagination.page || 1,
+                    'totalCount': data.dataResult.length || 0,
+                    'totalPages': Math.ceil(data.dataResult.length / (this.pagination.limit || 20))
+                }
+                data.dataResult = data.dataResult.slice((this.pagination.page - 1) * this.pagination.limit, this.pagination.page * this.pagination.limit)
+                ActionUtils.handleListData(this, data)
                 this.loading = false
                 this.loading = false
             }).catch(() => {
             }).catch(() => {
                 this.loading = false
                 this.loading = false