|
@@ -98,6 +98,25 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="adult-book-input-item">
|
|
|
+ 请输入每一列的宽度占比,最多为100,最少为0
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="adult-book-input-item"
|
|
|
+ v-for="(item, i) in curQue.colWidthList"
|
|
|
+ :key="'Colwid' + i"
|
|
|
+ >
|
|
|
+ <span class="adult-book-lable">第{{ i + 1 }}列</span>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入列的宽度"
|
|
|
+ v-model="item.con"
|
|
|
+ class="adult-book-input"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ @blur="item.con = item.con.trim()"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="adult-book-input-item">
|
|
|
<span class="adult-book-lable">提示标题:</span>
|
|
|
<el-input
|
|
|
type="textarea"
|
|
@@ -292,6 +311,11 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
],
|
|
|
+ colWidthList: [
|
|
|
+ {
|
|
|
+ width: "",
|
|
|
+ },
|
|
|
+ ],
|
|
|
img_list: [],
|
|
|
hintTitle: "",
|
|
|
hintOtion: [
|
|
@@ -429,7 +453,7 @@ export default {
|
|
|
// 删除列
|
|
|
removeCol(index) {
|
|
|
if (this.curQue.option[0].length <= 1) {
|
|
|
- this.$message.warning("至少要保留一格");
|
|
|
+ this.$message.warning("至少要保留一列");
|
|
|
return;
|
|
|
}
|
|
|
this.curQue.option.forEach((item) => {
|
|
@@ -444,6 +468,7 @@ export default {
|
|
|
this.curQue.headerList.splice(i, 1);
|
|
|
}
|
|
|
});
|
|
|
+ this.curQue.colWidthList.splice(index, 1);
|
|
|
},
|
|
|
// 删除td
|
|
|
removeTd(rowi, coli) {
|
|
@@ -481,11 +506,15 @@ export default {
|
|
|
// 增加列
|
|
|
addCol() {
|
|
|
let obj = JSON.parse(JSON.stringify(this.data_structure.option[0][0]));
|
|
|
+ let widthObj = JSON.parse(
|
|
|
+ JSON.stringify(this.data_structure.colWidthList[0])
|
|
|
+ );
|
|
|
+ this.curQue.colWidthList.push(widthObj);
|
|
|
this.curQue.option.forEach((item, i) => {
|
|
|
item.push(obj);
|
|
|
});
|
|
|
},
|
|
|
- // 删除其中一个选项
|
|
|
+ // 删除其中一个表头
|
|
|
deleteHeader(index) {
|
|
|
if (this.curQue.headerList.length <= 1) {
|
|
|
this.$message.warning("至少要保留一个表头");
|
|
@@ -495,6 +524,7 @@ export default {
|
|
|
this.curQue.option.forEach((item) => {
|
|
|
item.splice(index, 1);
|
|
|
});
|
|
|
+ this.curQue.colWidthList.splice(index, 1);
|
|
|
},
|
|
|
//添加一个表头
|
|
|
addHeader() {
|
|
@@ -506,6 +536,10 @@ export default {
|
|
|
this.curQue.option.forEach((item) => {
|
|
|
item.push(obj);
|
|
|
});
|
|
|
+ let widthObj = JSON.parse(
|
|
|
+ JSON.stringify(this.data_structure.colWidthList[0])
|
|
|
+ );
|
|
|
+ this.curQue.colWidthList.push(widthObj);
|
|
|
},
|
|
|
// 关闭弹窗并清空数据
|
|
|
handleClose() {
|