|
@@ -9,6 +9,7 @@
|
|
|
:loading="loading"
|
|
|
@editInfo="editInfo"
|
|
|
@emitData="emitData"
|
|
|
+ ref="tableList"
|
|
|
>
|
|
|
<template slot="customize">
|
|
|
<el-button
|
|
@@ -18,6 +19,8 @@
|
|
|
>Word批量导入</el-button
|
|
|
><el-button size="medium" @click="openExcel" type="success"
|
|
|
>Excel批量导入</el-button
|
|
|
+ ><el-button size="medium" @click="delAll" type="danger"
|
|
|
+ >批量删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
<template slot="btn" slot-scope="props">
|
|
@@ -742,7 +745,7 @@ export default {
|
|
|
prop: "type",
|
|
|
hidden: true,
|
|
|
scope: "topic",
|
|
|
- width:"140px"
|
|
|
+ width: "140px",
|
|
|
},
|
|
|
{
|
|
|
label: "标题前缀",
|
|
@@ -770,7 +773,7 @@ export default {
|
|
|
prop: "publishStatus",
|
|
|
hidden: true,
|
|
|
scope: "fabStatus",
|
|
|
- width:"140px"
|
|
|
+ width: "140px",
|
|
|
},
|
|
|
],
|
|
|
tableData: [],
|
|
@@ -781,7 +784,7 @@ export default {
|
|
|
ch: "条",
|
|
|
num: false,
|
|
|
border: true,
|
|
|
- choice: false,
|
|
|
+ choice: true,
|
|
|
addHide: false,
|
|
|
dontNum: true,
|
|
|
backFatherBtn: {
|
|
@@ -1115,6 +1118,39 @@ export default {
|
|
|
editInfo(v) {
|
|
|
this.addClick(v, 0);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ */
|
|
|
+ delAll() {
|
|
|
+ if (this.$refs.tableList.allCheckData.length) {
|
|
|
+ this.$confirm(
|
|
|
+ `此操作将删除已选中的${this.$refs.tableList.allCheckData.length}条题目, 是否继续?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ const dataIndedx = this.$refs.tableList.allCheckData.map((item) => {
|
|
|
+ return item.index;
|
|
|
+ });
|
|
|
+ this.tableData = this.tableData.filter((item) => {
|
|
|
+ return !dataIndedx.includes(item.index);
|
|
|
+ });
|
|
|
+ this.$refs.tableList.clearMoreActive()
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ this.$message.warning("请勾选需要删除的题目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
search(v) {
|
|
|
this.loading = true;
|
|
|
this.$api
|
|
@@ -1149,6 +1185,11 @@ export default {
|
|
|
return item.index === v.index;
|
|
|
});
|
|
|
this.tableData.splice(index, 1);
|
|
|
+ if(this.$refs.tableList.allCheckData.length){
|
|
|
+ this.$refs.tableList.allCheckData = this.$refs.tableList.allCheckData.filter(item => {
|
|
|
+ return item.index !== v.index
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
@@ -1670,7 +1711,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
var arrs = [];
|
|
|
- for (let i = this.tableData.length-1; i >= 0; i--) {
|
|
|
+ for (let i = this.tableData.length - 1; i >= 0; i--) {
|
|
|
if (self.tableData[i].questionId && self.tableData[i].diff) {
|
|
|
await self.uploadApis(self.tableData[i]);
|
|
|
}
|