|
|
@@ -27,7 +27,7 @@
|
|
|
<el-tab-pane label="新建审核" name="checking">
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange(createCurrentPage, createQuestionList, 'CHECKING')"
|
|
|
+ @current-change="handleCurrentChange(createCurrentPage, 'create', 'CHECKING')"
|
|
|
: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, updateQuestionList, 'UPDATING')"
|
|
|
+ @current-change="handleCurrentChange(updateCurrentPage, 'update', 'UPDATING')"
|
|
|
:current-page="updateCurrentPage"
|
|
|
:page-sizes="[5, 10, 15, 20]"
|
|
|
:page-size="pageSize"
|
|
|
@@ -67,14 +67,10 @@
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
-<!-- <el-tab-pane label="审核失败" name="refused">-->
|
|
|
-<!-- <!–todo: 设计RefuseQuestionCard并且在这里应用–>-->
|
|
|
-<!-- </el-tab-pane>-->
|
|
|
-
|
|
|
<el-tab-pane label="删除审核" name="deleting">
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange(executeCurrentPage, executeQuestionList, 'EXECUTED')"
|
|
|
+ @current-change="handleCurrentChange(executeCurrentPage, 'execute', 'EXECUTED')"
|
|
|
:current-page="executeCurrentPage"
|
|
|
:page-sizes="[5, 10, 15, 20]"
|
|
|
:page-size="pageSize"
|
|
|
@@ -186,14 +182,20 @@ export default {
|
|
|
console.log(error);
|
|
|
})
|
|
|
},
|
|
|
- handleCurrentChange(val, currentPage, questionList, states) { // 当点击新的页面时才请求新的数据
|
|
|
+ handleCurrentChange(val, currentPage, operate_type, states) { // 当点击新的页面时才请求新的数据
|
|
|
console.log(`Check-handleCurrentChange 当前页: ${val}`);
|
|
|
currentPage = val;
|
|
|
this.$api.getStateQuestion(states, val - 1, this.pageSize)
|
|
|
.then(res => {
|
|
|
console.log("handleCurrentChange-check");
|
|
|
console.log(res);
|
|
|
- questionList = res.data.result.content;
|
|
|
+ if(operate_type === "create"){
|
|
|
+ this.createQuestionList = res.data.result.content;
|
|
|
+ }else if(operate_type === "update"){
|
|
|
+ this.updateQuestionList = res.data.result.content;
|
|
|
+ }else if(operate_type === "delete"){
|
|
|
+ this.executeQuestionList = res.data.result.content;
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
console.log(error);
|
|
|
})
|
|
|
@@ -259,11 +261,6 @@ export default {
|
|
|
console.log(err);
|
|
|
})
|
|
|
break;
|
|
|
- // mockApi.mockGetUpdateQuestion().then().catch(err => {
|
|
|
- // _this.updateTotalNum = err.data.length;
|
|
|
- // _this.updateQuestionList = err.data
|
|
|
- // })
|
|
|
- // break;
|
|
|
// 审核失败
|
|
|
// case "refused":
|
|
|
// this.$api.getStateQuestion(tab.props.name.toUpperCase(), 0, this.pageSize)
|
|
|
@@ -282,19 +279,9 @@ export default {
|
|
|
_this.$api.getStateQuestion(tab.props.name.toUpperCase(), 0, this.pageSize)
|
|
|
.then(async res => {
|
|
|
console.log("getStateQuestion-deleting");
|
|
|
- const execute_list = res.data.result.content;
|
|
|
- let execute_num = 0;
|
|
|
-
|
|
|
- for (const executeListElement of execute_list) {
|
|
|
-
|
|
|
- execute_num += 1;
|
|
|
- console.log(executeListElement);
|
|
|
- let item = executeListElement;
|
|
|
-
|
|
|
- this.executeQuestionList.push(item);
|
|
|
-
|
|
|
- }
|
|
|
- this.executeTotalNum = execute_num;
|
|
|
+ console.log(res);
|
|
|
+ this.executeQuestionList = res.data.result.content;
|
|
|
+ this.executeTotalNum = res.data.result.totalElements;
|
|
|
}).catch(err => {
|
|
|
console.log(err);
|
|
|
})
|