|
@@ -617,8 +617,24 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div class="addoption" @click="removeRow(rowIndex, toindex)">
|
|
|
- 删除当前行
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="addoption" @click="removeRow(rowIndex, toindex)">
|
|
|
+ 删除当前行
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="addRow('front', rowIndex, toindex)"
|
|
|
+ class="addoption"
|
|
|
+ >
|
|
|
+ 在当前行前增加行
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="addRow('behind', rowIndex, toindex)"
|
|
|
+ class="addoption"
|
|
|
+ >
|
|
|
+ 在当前行后增加行
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -940,6 +956,50 @@ export default {
|
|
|
activated() {},
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
+ // 增加列
|
|
|
+ addCol(tyoe,rowindex,colindex,toindex){
|
|
|
+
|
|
|
+ },
|
|
|
+ // 添加行
|
|
|
+ addRow(type, rowindex, toindex) {
|
|
|
+ let arr = [
|
|
|
+ {
|
|
|
+ text: ``,
|
|
|
+ is_add_module: true,
|
|
|
+ is_edit: true,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ if (type == "front") {
|
|
|
+ // 加到当前行前面
|
|
|
+ if (rowindex == 0) {
|
|
|
+ this.question_list.cur_fn_data[toindex].table_list.splice(0, 0, arr);
|
|
|
+ } else {
|
|
|
+ this.question_list.cur_fn_data[toindex].table_list.splice(
|
|
|
+ rowindex - 1,
|
|
|
+ 0,
|
|
|
+ arr
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 加到当前行后面
|
|
|
+ this.question_list.cur_fn_data[toindex].table_list.splice(
|
|
|
+ rowindex + 1,
|
|
|
+ 0,
|
|
|
+ arr
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.question_list.cur_fn_data[toindex].table_list.forEach(
|
|
|
+ (item, rowIndex) => {
|
|
|
+ item.forEach((it, colIndex) => {
|
|
|
+ it.text = `第${rowIndex + 1}行,第${colIndex + 1}列`;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.TopicIndex = null;
|
|
|
+ this.RowIndex = null;
|
|
|
+ this.LineIndex = null;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
// 删除行
|
|
|
removeRow(index, toindex) {
|
|
|
// 里面是不是剩下最后一行了
|