|
@@ -16,17 +16,38 @@
|
|
|
@blur="onBlur(curQue, 'title')"
|
|
|
></el-input>
|
|
|
</div>
|
|
|
- <div class="adult-book-input-item">
|
|
|
- <span class="adult-book-lable">内容:</span>
|
|
|
- <el-input
|
|
|
- class="adult-book-input"
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2 }"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="curQue.con"
|
|
|
- @blur="onBlur(curQue, 'con')"
|
|
|
- ></el-input>
|
|
|
+ <div v-for="(item, Cindex) in curQue.con" :key="'con' + Cindex">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">内容标题:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入内容标题"
|
|
|
+ v-model="item.title"
|
|
|
+ @blur="onBlur(item, 'title')"
|
|
|
+ ></el-input>
|
|
|
+ <img
|
|
|
+ @click="deleteCon(Cindex)"
|
|
|
+ class="close"
|
|
|
+ src="../../../assets/adult/del-close.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">内容文本:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="item.con"
|
|
|
+ @blur="onBlur(item, 'con')"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div class="addoption" @click="addCon">添加一个内容</div>
|
|
|
+
|
|
|
<div v-for="(item, Oindex) in curQue.option" :key="'op' + Oindex">
|
|
|
<div class="adult-book-input-item">
|
|
|
<span class="adult-book-lable">选项:</span>
|
|
@@ -100,12 +121,17 @@ export default {
|
|
|
type: "选择填空控件",
|
|
|
name: "select_input_chs",
|
|
|
title: "",
|
|
|
- con: "",
|
|
|
option: [
|
|
|
{
|
|
|
con: "",
|
|
|
},
|
|
|
],
|
|
|
+ con: [
|
|
|
+ {
|
|
|
+ title: "",
|
|
|
+ con: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
answer: [
|
|
|
{
|
|
|
con: "",
|
|
@@ -121,6 +147,17 @@ export default {
|
|
|
onBlur(item, field) {
|
|
|
item[field] = item[field] ? item[field].trim() : "";
|
|
|
},
|
|
|
+ deleteCon(index) {
|
|
|
+ if (this.curQue.con.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留1个内容");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue.con.splice(index, 1);
|
|
|
+ },
|
|
|
+ addCon() {
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.data_structure.con[0]));
|
|
|
+ this.curQue.con.push(obj);
|
|
|
+ },
|
|
|
// 删除其中一个选项
|
|
|
deleteOptionOne(index) {
|
|
|
if (this.curQue.option.length <= 1) {
|