|
|
@@ -2,6 +2,28 @@
|
|
|
<div>
|
|
|
<h1>题目审查</h1>
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="全部审核" name="checkingAll">
|
|
|
+ <el-pagination
|
|
|
+ id="checking_all"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange_ALL"
|
|
|
+ :current-page="checkQuestionPage"
|
|
|
+ :page-sizes="[5, 10, 15, 20]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total=this.checkTotalNum
|
|
|
+ v-if="this.checkQuestionList.length !== 0"
|
|
|
+ />
|
|
|
+ <checkQuestionCard
|
|
|
+ v-for="(item, index) in checkQuestionList"
|
|
|
+ :questionvo="item"
|
|
|
+ :key="item.id"
|
|
|
+ :cur-num="index+(checkQuestionPage-1)*pageSize"
|
|
|
+ :total-num="checkTotalNum"
|
|
|
+ @approve="handleApproved(item, checkQuestionList)"
|
|
|
+ />
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
<el-tab-pane label="新建审核" name="creating">
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@@ -114,7 +136,12 @@ export default {
|
|
|
pageSize: 20,
|
|
|
|
|
|
// 分页所需数据
|
|
|
- activeName: "creating",
|
|
|
+ activeName: "checkingAll",
|
|
|
+
|
|
|
+ // 所有(线上)题目列表
|
|
|
+ checkQuestionList: [],
|
|
|
+ checkQuestionPage: 1,
|
|
|
+ checkTotalNum: 0,
|
|
|
|
|
|
// 新建审核题目列表
|
|
|
createQuestionList: [],
|
|
|
@@ -144,10 +171,22 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
- handleSizeChange(val) {
|
|
|
+ handleSizeChange(val) { //修改页面大小
|
|
|
console.log(`QuestionRepository/index-handleSizeChange 每页 ${val} 条`);
|
|
|
this.pageSize = val;
|
|
|
},
|
|
|
+ handleCurrentChange_ALL(val){
|
|
|
+ console.log(`当前页: ${val}`);
|
|
|
+ this.checkQuestionPage = val;
|
|
|
+ this.$api.getTargetQuestionList(val - 1, this.pageSize)
|
|
|
+ .then(res => {
|
|
|
+ console.log("handleCurrentChange-checkingAll");
|
|
|
+ console.log(res);
|
|
|
+ this.checkQuestionList = res.data.result.content;
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
handleCurrentChange(val, currentPage, questionList, states) { // 当点击新的页面时才请求新的数据
|
|
|
console.log(`Check-handleCurrentChange 当前页: ${val}`);
|
|
|
currentPage = val;
|
|
|
@@ -165,9 +204,22 @@ export default {
|
|
|
handleClick(tab, event) {
|
|
|
const _this = this
|
|
|
switch (tab.props.name) {
|
|
|
+ case "checkingAll":
|
|
|
+ this.$api.getTargetQuestionList(0, this.pageSize)
|
|
|
+ .then(res => {
|
|
|
+ // mjh change
|
|
|
+ console.log("getTargetQuestion-checkingAll");
|
|
|
+ console.log(res);
|
|
|
+ this.checkQuestionList = res.data.result.content;
|
|
|
+ this.checkTotalNum = res.data.result.totalElements;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ })
|
|
|
+ break;
|
|
|
// 新建审核
|
|
|
case "creating":
|
|
|
- // todo: 用真实代码替换mockjs
|
|
|
+ // todo: 用真代码替换mockjs
|
|
|
// this.$api.getStateQuestion(tab.props.name.toUpperCase(), 0, this.pageSize)
|
|
|
// .then(res => {
|
|
|
// // mjh change
|
|
|
@@ -235,7 +287,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.handleClick({props: {name: "creating"}}, null);
|
|
|
+ this.handleClick({props: {name: "checkingAll"}}, null);
|
|
|
}
|
|
|
}
|
|
|
</script>
|