|
|
|
|
@ -340,11 +340,6 @@ export class Draw {
|
|
|
|
|
|
|
|
|
|
public insertElementList(payload: IElement[]) {
|
|
|
|
|
if (!payload.length) return
|
|
|
|
|
const activeControl = this.control.getActiveControl()
|
|
|
|
|
if (activeControl) {
|
|
|
|
|
const element = activeControl.getElement()
|
|
|
|
|
if (element.controlComponent !== ControlComponent.POSTFIX) return
|
|
|
|
|
}
|
|
|
|
|
const isPartRangeInControlOutside = this.control.isPartRangeInControlOutside()
|
|
|
|
|
if (isPartRangeInControlOutside) return
|
|
|
|
|
const { startIndex, endIndex } = this.range.getRange()
|
|
|
|
|
@ -353,6 +348,12 @@ export class Draw {
|
|
|
|
|
isHandleFirstElement: false,
|
|
|
|
|
editorOptions: this.options
|
|
|
|
|
})
|
|
|
|
|
let curIndex = -1
|
|
|
|
|
// 判断是否在控件内
|
|
|
|
|
const activeControl = this.control.getActiveControl()
|
|
|
|
|
if (activeControl && !this.control.isRangInPostfix()) {
|
|
|
|
|
curIndex = activeControl.setValue(payload)
|
|
|
|
|
} else {
|
|
|
|
|
const elementList = this.getElementList()
|
|
|
|
|
const isCollapsed = startIndex === endIndex
|
|
|
|
|
const start = startIndex + 1
|
|
|
|
|
@ -369,12 +370,15 @@ export class Draw {
|
|
|
|
|
}
|
|
|
|
|
elementList.splice(start + i, 0, element)
|
|
|
|
|
}
|
|
|
|
|
const curIndex = startIndex + payload.length
|
|
|
|
|
curIndex = startIndex + payload.length
|
|
|
|
|
}
|
|
|
|
|
if (~curIndex) {
|
|
|
|
|
this.range.setRange(curIndex, curIndex)
|
|
|
|
|
this.render({
|
|
|
|
|
curIndex
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getOriginalElementList() {
|
|
|
|
|
return this.elementList
|
|
|
|
|
|