|
@@ -7,7 +7,6 @@
|
|
|
:navText="navText"
|
|
|
@addClick="openActiveBox"
|
|
|
:loading="loading"
|
|
|
- @editInfo="editInfo"
|
|
|
@emitData="emitData"
|
|
|
>
|
|
|
<template slot="customize">
|
|
@@ -18,14 +17,10 @@
|
|
|
<template slot="btn" slot-scope="props">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- @click="addClick(props.scope.row, 0, props.scope.$index)"
|
|
|
+ @click="addClick(props.scope.row, 0, props.scope.row.index)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- @click="del(props.scope.row, props.scope.$index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="text" @click="del(props.scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</table-list>
|
|
|
<div class="centerStys">
|
|
@@ -782,6 +777,7 @@ export default {
|
|
|
prop: "content",
|
|
|
hidden: true,
|
|
|
scope: "editInfoHTMLs",
|
|
|
+ showTooltip: true,
|
|
|
width: "320px",
|
|
|
},
|
|
|
|
|
@@ -970,6 +966,7 @@ export default {
|
|
|
copytableData: [],
|
|
|
localStart: false, //定时器是否已经开始
|
|
|
pageId: "", //试卷ID
|
|
|
+ uploadStatus: false, //是否同步预览
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -1141,17 +1138,16 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// --------------------------分割线---------------------------
|
|
|
- editInfo(v) {
|
|
|
- this.addClick(v, 0);
|
|
|
- },
|
|
|
search(v) {
|
|
|
this.loading = true;
|
|
|
this.$api
|
|
|
.inquirebankexamquestionList({ examId: this.$route.query.id })
|
|
|
.then((res) => {
|
|
|
- res.data.map((item) => {
|
|
|
+ res.data.forEach((item, index) => {
|
|
|
item.optionsList = JSON.parse(item.jsonStr);
|
|
|
+ item.index = index;
|
|
|
});
|
|
|
+ console.log(res.data);
|
|
|
this.copytableData = JSON.parse(JSON.stringify(res.data));
|
|
|
this.boxtableDataPags = JSON.parse(JSON.stringify(res.data));
|
|
|
this.tableData = res.data;
|
|
@@ -1164,7 +1160,7 @@ export default {
|
|
|
// init() {
|
|
|
// this.search();
|
|
|
// },
|
|
|
- del(v, index) {
|
|
|
+ del(v) {
|
|
|
this.$alert(
|
|
|
"确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
|
|
|
"提示",
|
|
@@ -1173,6 +1169,9 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
+ let index = this.tableData.findIndex((item) => {
|
|
|
+ return item.index === v.index;
|
|
|
+ });
|
|
|
this.tableData.splice(index, 1);
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -1300,7 +1299,7 @@ export default {
|
|
|
getRowKeys(row) {
|
|
|
return row.questionId;
|
|
|
},
|
|
|
- addClick(v, int, indexZB) {
|
|
|
+ addClick(v, int, indexZB, uploadStatus) {
|
|
|
var self = this;
|
|
|
if (v === undefined) {
|
|
|
self.statusPop = 1;
|
|
@@ -1334,12 +1333,20 @@ export default {
|
|
|
self.activeExam = [];
|
|
|
});
|
|
|
} else {
|
|
|
- self.tableData[indexZB].diff = true;
|
|
|
+ if (uploadStatus) {
|
|
|
+ this.uploadStatus = true;
|
|
|
+ } else {
|
|
|
+ this.uploadStatus = false;
|
|
|
+ }
|
|
|
+ let newIndex = self.tableData.findIndex((item) => {
|
|
|
+ return item.index === indexZB;
|
|
|
+ });
|
|
|
+ self.tableData[newIndex].diff = true;
|
|
|
self.innerVisiblePaperTopic = true;
|
|
|
self.showHide = true;
|
|
|
self.statusPop = int;
|
|
|
var vres = JSON.parse(JSON.stringify(v));
|
|
|
- self.indexZB = indexZB;
|
|
|
+ self.indexZB = newIndex;
|
|
|
if (vres.knowledgeIds) {
|
|
|
var a = [];
|
|
|
vres.knowledgeIds
|
|
@@ -1615,14 +1622,20 @@ export default {
|
|
|
|
|
|
if (this.tableData.length) {
|
|
|
let maxIndex = 0;
|
|
|
+ let childrenIndex = 0;
|
|
|
this.tableData.forEach((item) => {
|
|
|
if (item.sort > maxIndex) {
|
|
|
maxIndex = item.sort;
|
|
|
}
|
|
|
+ if (item.index > childrenIndex) {
|
|
|
+ childrenIndex = item.index;
|
|
|
+ }
|
|
|
});
|
|
|
data.sort = maxIndex + 1;
|
|
|
+ data.index = childrenIndex + 1;
|
|
|
} else {
|
|
|
data.sort = 1;
|
|
|
+ data.index = 0;
|
|
|
}
|
|
|
this.tableData.push(data);
|
|
|
// this.$api.addbankquestion(data).then((res) => {
|
|
@@ -1633,7 +1646,13 @@ export default {
|
|
|
// });
|
|
|
}
|
|
|
if (this.statusPop === 0) {
|
|
|
- this.tableData.splice(this.indexZB, 1, data);
|
|
|
+ let indexy = this.tableData.findIndex((item) => {
|
|
|
+ return item.index === this.indexZB;
|
|
|
+ });
|
|
|
+ this.tableData.splice(indexy, 1, data);
|
|
|
+ if(this.uploadStatus){
|
|
|
+ this.$refs.testPaperPreview.changeUploadStatus(data)
|
|
|
+ }
|
|
|
// this.$api.editbankquestion(data).then((res) => {
|
|
|
self.$message.success("修改成功");
|
|
|
self.innerVisiblePaperTopic = false;
|