|
@@ -127,6 +127,7 @@
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
|
+ ref="table"
|
|
element-loading-text="加载中"
|
|
element-loading-text="加载中"
|
|
:data="questionList"
|
|
:data="questionList"
|
|
@selection-change="tableSelectChange"
|
|
@selection-change="tableSelectChange"
|
|
@@ -180,7 +181,7 @@
|
|
:page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
:page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="total"
|
|
:total="total"
|
|
- @current-change="toPage"
|
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
@@ -304,13 +305,13 @@ export default {
|
|
if (res.data.status === "FAILED") {
|
|
if (res.data.status === "FAILED") {
|
|
this.hasTaskRunning = false;
|
|
this.hasTaskRunning = false;
|
|
if (!isReview) this.$message.error("出题失败,请重新尝试!");
|
|
if (!isReview) this.$message.error("出题失败,请重新尝试!");
|
|
- this.toPage(1);
|
|
|
|
|
|
+ this.handleCurrentChange(1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (res.data.status === "FINISH") {
|
|
if (res.data.status === "FINISH") {
|
|
this.hasTaskRunning = false;
|
|
this.hasTaskRunning = false;
|
|
if (!isReview) this.$message.success("出题成功!");
|
|
if (!isReview) this.$message.success("出题成功!");
|
|
- this.toPage(1);
|
|
|
|
|
|
+ this.handleCurrentChange(1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.hasTaskRunning = ["RUNNING", "INIT"].includes(res.data.status);
|
|
this.hasTaskRunning = ["RUNNING", "INIT"].includes(res.data.status);
|
|
@@ -335,7 +336,7 @@ export default {
|
|
this.checkTaskStatus();
|
|
this.checkTaskStatus();
|
|
}, 3 * 1000);
|
|
}, 3 * 1000);
|
|
},
|
|
},
|
|
- toPage(page) {
|
|
|
|
|
|
+ handleCurrentChange(page) {
|
|
this.currentPage = page;
|
|
this.currentPage = page;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
@@ -354,7 +355,7 @@ export default {
|
|
},
|
|
},
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|
|
- this.toPage(1);
|
|
|
|
|
|
+ this.handleCurrentChange(1);
|
|
},
|
|
},
|
|
tableSelectChange(selections) {
|
|
tableSelectChange(selections) {
|
|
this.selectedQuestionIds = selections.map((item) => item.id);
|
|
this.selectedQuestionIds = selections.map((item) => item.id);
|
|
@@ -415,7 +416,7 @@ export default {
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
type: "success",
|
|
type: "success",
|
|
});
|
|
});
|
|
- this.getList();
|
|
|
|
|
|
+ this.deletePageLastItem(ids.length);
|
|
},
|
|
},
|
|
async toSaveQuestion() {
|
|
async toSaveQuestion() {
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
@@ -440,7 +441,7 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
if (!res) return;
|
|
if (!res) return;
|
|
this.$message.success("保存成功!");
|
|
this.$message.success("保存成功!");
|
|
- this.getList();
|
|
|
|
|
|
+ this.deletePageLastItem(this.selectedQuestionIds.length);
|
|
this.$emit("modified");
|
|
this.$emit("modified");
|
|
},
|
|
},
|
|
},
|
|
},
|