|
@@ -51,7 +51,7 @@
|
|
|
<span
|
|
|
class="editDialogue"
|
|
|
@click="editDialogue(index)"
|
|
|
- style="margin-right: 16px"
|
|
|
+ style="margin-right: 16px; cursor: pointer"
|
|
|
>编辑此对话</span
|
|
|
>
|
|
|
<!-- @click="addOption(index)" -->
|
|
@@ -78,10 +78,8 @@
|
|
|
>
|
|
|
<DialogueTem :curQue="curQue.list[listIndex]" :listIndex="listIndex" />
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = false"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button @click="cancleDialogue">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="cancleDialogue">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
@@ -94,11 +92,14 @@
|
|
|
top="10px"
|
|
|
:modal="true"
|
|
|
>
|
|
|
- <DialogueTem
|
|
|
- :curQue="curQue.option[listIndex]"
|
|
|
- :listIndex="'option' + listIndex"
|
|
|
- type="option"
|
|
|
- />
|
|
|
+ <template v-if="curQue && curQue.option">
|
|
|
+ <DialogueTem
|
|
|
+ :curQue="curQue.option[listIndex]"
|
|
|
+ :listIndex="'option' + listIndex"
|
|
|
+ type="option"
|
|
|
+ v-if="optionVisible"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="optionVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="optionVisible = false"
|
|
@@ -227,6 +228,9 @@ export default {
|
|
|
this.listIndex = index;
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
+ cancleDialogue() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
selectOption(index) {
|
|
|
this.listIndex = index;
|
|
|
this.selectVisible = true;
|
|
@@ -244,15 +248,14 @@ export default {
|
|
|
this.curQue.option.push(objOption);
|
|
|
},
|
|
|
delDialogue(index) {
|
|
|
- this.$confirm("确定要删除吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.curQue.list.splice(index, 1);
|
|
|
- this.curQue.option.splice(index, 1);
|
|
|
- })
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.curQue.list.splice(index, 1);
|
|
|
+ this.curQue.option.splice(index, 1);
|
|
|
+ });
|
|
|
},
|
|
|
initCurQueData() {
|
|
|
let res_data = JSON.parse(JSON.stringify(this.data_structure));
|
|
@@ -274,20 +277,24 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.curQue.list.forEach((item) => {
|
|
|
- item.checkList = ["input"];
|
|
|
- item.judge = [];
|
|
|
+ if (!item.hasOwnProperty("checkList")) {
|
|
|
+ item.checkList = ["input"];
|
|
|
+ item.judge = [];
|
|
|
+ }
|
|
|
});
|
|
|
- if(!this.curQue.hasOwnProperty("wordcard")){
|
|
|
- this.$set(this.curQue, "wordcard", JSON.parse(JSON.stringify(this.data_structure.wordcard)));
|
|
|
+ if (!this.curQue.hasOwnProperty("wordcard")) {
|
|
|
+ this.$set(
|
|
|
+ this.curQue,
|
|
|
+ "wordcard",
|
|
|
+ JSON.parse(JSON.stringify(this.data_structure.wordcard))
|
|
|
+ );
|
|
|
}
|
|
|
} else {
|
|
|
this.initCurQueData();
|
|
|
}
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {
|
|
|
-
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
beforeMount() {}, //生命周期 - 挂载之前
|
|
|
beforeUpdate() {}, //生命周期 - 更新之前
|