瀏覽代碼

feat: ZhuRui 修改新建、删除审核界面

Leonezhurui 4 年之前
父節點
當前提交
1f37d66ee5
共有 1 個文件被更改,包括 43 次插入 和 4 次删除
  1. 43 4
      src/views/Bok/Main/Check.vue

+ 43 - 4
src/views/Bok/Main/Check.vue

@@ -27,7 +27,7 @@
       <el-tab-pane label="新建审核" name="checking">
         <el-pagination
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(createCurrentPage, 'create', 'CHECKING')"
+          @current-change="handleCurrentChange_CREATE"
           :current-page="createCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
@@ -49,7 +49,7 @@
         <!--todo: 设计UpdateQuestionCard并且在这里应用-->
         <el-pagination
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(updateCurrentPage, 'update', 'UPDATING')"
+          @current-change="handleCurrentChange_UPDATE"
           :current-page="updateCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
@@ -70,7 +70,7 @@
       <el-tab-pane label="删除审核" name="deleting">
         <el-pagination
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(executeCurrentPage, 'execute', 'EXECUTED')"
+          @current-change="handleCurrentChange_EXECUTED"
           :current-page="executeCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
@@ -182,10 +182,49 @@ export default {
         console.log(error);
       })
     },
+    handleCurrentChange_CREATE(val){
+      console.log(`当前页: ${val}`);
+      this.checkQuestionPage = val;
+      this.$api.getStateQuestion('CREATING',val - 1, this.pageSize)
+          .then(res => {
+            console.log("handleCurrentChange-create");
+            console.log(res);
+            this.createQuestionList = res.data.result.content;
+            this.createTotalNum = res.data.result.totalElements;
+          }).catch(error => {
+        console.log(error);
+      })
+    },
+    handleCurrentChange_UPDATE(val){
+      console.log(`当前页: ${val}`);
+      this.checkQuestionPage = val;
+      this.$api.getStateQuestion('UPDATING',val - 1, this.pageSize)
+          .then(res => {
+            console.log("handleCurrentChange-update");
+            console.log(res);
+            this.updateQuestionList = res.data.result.content;
+            this.updateTotalNum = res.data.result.totalElements;
+          }).catch(error => {
+        console.log(error);
+      })
+    },
+    handleCurrentChange_EXECUTED(val){
+      console.log(`当前页: ${val}`);
+      this.checkQuestionPage = val;
+      this.$api.getStateQuestion('EXECUTED',val - 1, this.pageSize)
+          .then(res => {
+            console.log("handleCurrentChange-execute");
+            console.log(res);
+            this.executeQuestionList = res.data.result.content;
+            this.executeTotalNum = res.data.result.totalElements;
+          }).catch(error => {
+        console.log(error);
+      })
+    },
     handleCurrentChange(val, currentPage, operate_type, states) { // 当点击新的页面时才请求新的数据
       console.log(`Check-handleCurrentChange 当前页: ${val}`);
       currentPage = val;
-      this.$api.getStateQuestion(states, val, this.pageSize)
+      this.$api.getStateQuestion(states, val - 1, this.pageSize)
         .then(res => {
           console.log("handleCurrentChange-check");
           console.log(res);