|
@@ -3,13 +3,19 @@
|
|
|
<div>
|
|
|
<table-list
|
|
|
:tableSets="tableSet"
|
|
|
- :tableData="tableData"
|
|
|
+ :tableData="computedData(tableData)"
|
|
|
:navText="navText"
|
|
|
@addClick="openActiveBox"
|
|
|
:loading="loading"
|
|
|
@emitData="emitData"
|
|
|
+ ref="tableList"
|
|
|
>
|
|
|
<template slot="customize">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入题目内容"
|
|
|
+ v-model="keyValue"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ ></el-input>
|
|
|
<el-button
|
|
|
size="medium"
|
|
|
@click="$refs.wordpop.dialogDRword = true"
|
|
@@ -17,6 +23,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">
|
|
@@ -684,6 +692,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ keyValue: "",
|
|
|
dialogDRword: false,
|
|
|
disabledBtn: false,
|
|
|
dialogDRexcel: false,
|
|
@@ -742,7 +751,7 @@ export default {
|
|
|
prop: "type",
|
|
|
hidden: true,
|
|
|
scope: "topic",
|
|
|
- width:"140px"
|
|
|
+ width: "140px",
|
|
|
},
|
|
|
{
|
|
|
label: "标题前缀",
|
|
@@ -770,7 +779,7 @@ export default {
|
|
|
prop: "publishStatus",
|
|
|
hidden: true,
|
|
|
scope: "fabStatus",
|
|
|
- width:"140px"
|
|
|
+ width: "140px",
|
|
|
},
|
|
|
],
|
|
|
tableData: [],
|
|
@@ -781,7 +790,7 @@ export default {
|
|
|
ch: "条",
|
|
|
num: false,
|
|
|
border: true,
|
|
|
- choice: false,
|
|
|
+ choice: true,
|
|
|
addHide: false,
|
|
|
dontNum: true,
|
|
|
backFatherBtn: {
|
|
@@ -963,6 +972,19 @@ export default {
|
|
|
});
|
|
|
return num;
|
|
|
},
|
|
|
+ computedData: function () {
|
|
|
+ return function (data) {
|
|
|
+ var arr = [];
|
|
|
+ if (this.keyValue) {
|
|
|
+ arr = data.filter((item) => {
|
|
|
+ return item.content.search(this.keyValue) !== -1;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ arr = data;
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
djTime: {
|
|
@@ -1113,6 +1135,42 @@ 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
|
|
@@ -1147,6 +1205,12 @@ 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({
|
|
@@ -1674,7 +1738,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]);
|
|
|
}
|