|
@@ -62,6 +62,13 @@
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ plain
|
|
|
|
+ icon="el-icon-circle-close"
|
|
|
|
+ @click="toBatchDelete"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
@@ -92,7 +99,13 @@
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
element-loading-text="加载中"
|
|
element-loading-text="加载中"
|
|
:data="questionList"
|
|
:data="questionList"
|
|
|
|
+ @selection-change="tableSelectChange"
|
|
>
|
|
>
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="selection"
|
|
|
|
+ width="50"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column label="题干" min-width="200">
|
|
<el-table-column label="题干" min-width="200">
|
|
<div slot-scope="scope" @click="toViewQuestion(scope.row)">
|
|
<div slot-scope="scope" @click="toViewQuestion(scope.row)">
|
|
<rich-text
|
|
<rich-text
|
|
@@ -265,6 +278,7 @@ export default {
|
|
curFolderAction: "",
|
|
curFolderAction: "",
|
|
folderList: [],
|
|
folderList: [],
|
|
questionList: [],
|
|
questionList: [],
|
|
|
|
+ selectedQuestionIds: [],
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
total: 0,
|
|
total: 0,
|
|
@@ -286,6 +300,7 @@ export default {
|
|
},
|
|
},
|
|
async getList() {
|
|
async getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
+ this.selectedQuestionIds = [];
|
|
let data = {
|
|
let data = {
|
|
...this.filter,
|
|
...this.filter,
|
|
pageNumber: this.currentPage,
|
|
pageNumber: this.currentPage,
|
|
@@ -302,6 +317,9 @@ export default {
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|
|
this.toPage(1);
|
|
this.toPage(1);
|
|
},
|
|
},
|
|
|
|
+ tableSelectChange(selections) {
|
|
|
|
+ this.selectedQuestionIds = selections.map((item) => item.id);
|
|
|
|
+ },
|
|
courseChange(val) {
|
|
courseChange(val) {
|
|
this.curCourse = val || {};
|
|
this.curCourse = val || {};
|
|
},
|
|
},
|
|
@@ -384,16 +402,10 @@ export default {
|
|
this.$message.success("操作成功!");
|
|
this.$message.success("操作成功!");
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
- async toDeleteQuestion(row) {
|
|
|
|
- const confirm = await this.$confirm("确认删除试题吗?", "提示", {
|
|
|
|
- type: "warning",
|
|
|
|
- }).catch(() => {});
|
|
|
|
- if (confirm !== "confirm") return;
|
|
|
|
-
|
|
|
|
|
|
+ async deleteQuestion(ids) {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- const res = await deleteQuestionApi(row.id).catch(() => {});
|
|
|
|
|
|
+ const res = await deleteQuestionApi(ids.join()).catch(() => {});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
-
|
|
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
|
|
|
this.$notify({
|
|
this.$notify({
|
|
@@ -402,6 +414,27 @@ export default {
|
|
});
|
|
});
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ async toDeleteQuestion(row) {
|
|
|
|
+ const confirm = await this.$confirm("确认删除试题吗?", "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ this.deleteQuestion([row.id]);
|
|
|
|
+ },
|
|
|
|
+ async toBatchDelete() {
|
|
|
|
+ if (!this.selectedQuestionIds.length) {
|
|
|
|
+ this.$message.error("请选择试题!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const confirm = await this.$confirm("确认删除选中试题吗?", "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ this.deleteQuestion(this.selectedQuestionIds);
|
|
|
|
+ },
|
|
toRecycle() {
|
|
toRecycle() {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
name: "QuestionRecycle",
|
|
name: "QuestionRecycle",
|
|
@@ -411,7 +444,7 @@ export default {
|
|
this.$refs.FolderQuestionManageDialog.open();
|
|
this.$refs.FolderQuestionManageDialog.open();
|
|
},
|
|
},
|
|
questionImported(data) {
|
|
questionImported(data) {
|
|
- if (data.importType === "zip") {
|
|
|
|
|
|
+ if (data.importType !== "word") {
|
|
this.getList();
|
|
this.getList();
|
|
return;
|
|
return;
|
|
}
|
|
}
|