소스 검색

部分页面复选框交互后重新查询的分页问题的优化

刘洋 1 년 전
부모
커밋
6740458666
2개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      src/modules/basic/view/data_previllege.vue
  2. 6 0
      src/modules/questions/views/GenPaperDetail.vue

+ 7 - 0
src/modules/basic/view/data_previllege.vue

@@ -454,6 +454,13 @@ export default {
           type: "success",
           message: "删除成功",
         });
+        if (
+          this["tableData" + type].length == refIds.length &&
+          (this["currentPage" + type] + 1) * this["pageSize" + type] >
+            this["total" + type]
+        ) {
+          this["currentPage" + type] = 1;
+        }
         await this.init();
       } catch (error) {
         console.log(error);

+ 6 - 0
src/modules/questions/views/GenPaperDetail.vue

@@ -867,6 +867,12 @@ export default {
         this.tempPapers.push(Object.assign({}, element));
         this.tempPaperIds.push(element.id);
       });
+      if (
+        val.length == this.selectPapers.length &&
+        (this.curSelect + 1) * this.pageSize > this.totalSelect
+      ) {
+        this.curSelect = 1;
+      }
       this.searchPaper();
     },
     searchPaper() {