Browse Source

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

Leonezhurui 4 years ago
parent
commit
1f37d66ee5
1 changed files with 43 additions and 4 deletions
  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-tab-pane label="新建审核" name="checking">
         <el-pagination
         <el-pagination
           @size-change="handleSizeChange"
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(createCurrentPage, 'create', 'CHECKING')"
+          @current-change="handleCurrentChange_CREATE"
           :current-page="createCurrentPage"
           :current-page="createCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
           :page-size="pageSize"
@@ -49,7 +49,7 @@
         <!--todo: 设计UpdateQuestionCard并且在这里应用-->
         <!--todo: 设计UpdateQuestionCard并且在这里应用-->
         <el-pagination
         <el-pagination
           @size-change="handleSizeChange"
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(updateCurrentPage, 'update', 'UPDATING')"
+          @current-change="handleCurrentChange_UPDATE"
           :current-page="updateCurrentPage"
           :current-page="updateCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
           :page-size="pageSize"
@@ -70,7 +70,7 @@
       <el-tab-pane label="删除审核" name="deleting">
       <el-tab-pane label="删除审核" name="deleting">
         <el-pagination
         <el-pagination
           @size-change="handleSizeChange"
           @size-change="handleSizeChange"
-          @current-change="handleCurrentChange(executeCurrentPage, 'execute', 'EXECUTED')"
+          @current-change="handleCurrentChange_EXECUTED"
           :current-page="executeCurrentPage"
           :current-page="executeCurrentPage"
           :page-sizes="[5, 10, 15, 20]"
           :page-sizes="[5, 10, 15, 20]"
           :page-size="pageSize"
           :page-size="pageSize"
@@ -182,10 +182,49 @@ export default {
         console.log(error);
         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) { // 当点击新的页面时才请求新的数据
     handleCurrentChange(val, currentPage, operate_type, states) { // 当点击新的页面时才请求新的数据
       console.log(`Check-handleCurrentChange 当前页: ${val}`);
       console.log(`Check-handleCurrentChange 当前页: ${val}`);
       currentPage = val;
       currentPage = val;
-      this.$api.getStateQuestion(states, val, this.pageSize)
+      this.$api.getStateQuestion(states, val - 1, this.pageSize)
         .then(res => {
         .then(res => {
           console.log("handleCurrentChange-check");
           console.log("handleCurrentChange-check");
           console.log(res);
           console.log(res);