@@ -59,13 +59,12 @@
v-model="clause.itemContent"
v-if="clause.type === TypeOfClauseItem.TEXT.value" />
-
-
+
-
+
{{ $t('newlyAdded') }}
@@ -145,6 +144,7 @@ export default {
itemVal: {},
contentTrees: '',
isTableEdit: false,
+ isTopList: false
}
},
props: {
@@ -214,16 +214,28 @@ export default {
*/
handleAddClauseContent (index) {
if (index === -1) {
+ this.isTopList = false
+ this.addIndex = this.contentList.length - 1
+ } else if (!index) {
+ this.isTopList = true
this.addIndex = this.contentList.length - 1
} else {
this.addIndex = index
+ this.isTopList = false
}
this.$refs.splitDetailAddTypeCheck.open()
},
// 增加条款内容成功
handleAddOk (type, content) {
- const headerArr = this.contentList.splice(0, this.addIndex + 1)
- const footerArr = this.contentList.splice(-this.addIndex)
+ let headerArr = []
+ let footerArr = []
+ if (this.isTopList) {
+ headerArr = this.contentList
+ footerArr = []
+ } else {
+ headerArr = this.contentList.splice(0, this.addIndex + 1)
+ footerArr = this.contentList.splice(-this.addIndex)
+ }
const insertArr = []
switch (type) {
case TypeOfClauseItem.TEXT.value:
@@ -251,6 +263,7 @@ export default {
}
}
this.contentList = [...headerArr, ...insertArr, ...footerArr]
+ console.log(this.contentList)
},
/**
* 表格编辑