소스 검색

fix: 菜单权限一览表点击查询按钮后后页码未重置

johnsen 6 달 전
부모
커밋
c43388fabf
1개의 변경된 파일15개의 추가작업 그리고 4개의 파일을 삭제
  1. 15 4
      src/views/platform/auth/board/index.vue

+ 15 - 4
src/views/platform/auth/board/index.vue

@@ -218,7 +218,7 @@ export default {
      */
     pageInfo() {
       if (!this.showPagination) return ''
-      const total = this.pagination[this.totalKey]
+      const total = this.pagination.totalCount
       if (total && total > 0) {
         const start = (this.currentPage - 1) * this.pageSize + 1
         let end = this.currentPage * this.pageSize
@@ -244,6 +244,7 @@ export default {
   methods: {
     search() {
       this.loading = true
+      console.log('this.pagination==>', this.pagination)
       return new Promise((resolve, reject) => {
         try {
           searchPagePermission({
@@ -260,6 +261,7 @@ export default {
                 pageResult: {}
               }
               this.pagination = pageResult
+              this.pagination.pageNo = pageResult.page
               this.columns = data.roles
               console.log('permissions===>', data.permissions)
               this.ibpsData = data.permissions
@@ -341,19 +343,28 @@ export default {
      * @description 当前页码改变
      */
     handlePaginationCurrentChange(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
+      this.handlePaginationChange({
+        currentPage: currentPage,
+        pageSize: this.pageSize
+      })
     },
     /**
      * @description 上一页
      */
     handlePaginationPrevClick(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
+      this.handlePaginationChange({
+        currentPage: currentPage,
+        pageSize: this.pageSize
+      })
     },
     /**
      * @description 下一页
      */
     handlePaginationNextClick(currentPage) {
-      this.handlePaginationChange({ currentPage: currentPage })
+      this.handlePaginationChange({
+        currentPage: currentPage,
+        pageSize: this.pageSize
+      })
     },
     handlePaginationChange({ pageSize, currentPage }) {
       this.pagination.limit = pageSize || this.pageSize