|
|
|
|
@ -11,7 +11,6 @@ import {
|
|
|
|
|
ISetControlExtensionOption,
|
|
|
|
|
ISetControlValueOption
|
|
|
|
|
} from '../../../interface/Control'
|
|
|
|
|
import { IEditorData } from '../../../interface/Editor'
|
|
|
|
|
import { IElement, IElementPosition } from '../../../interface/Element'
|
|
|
|
|
import { EventBusMap } from '../../../interface/EventBus'
|
|
|
|
|
import { IRange } from '../../../interface/Range'
|
|
|
|
|
@ -57,23 +56,27 @@ export class Control {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 过滤控件辅助元素(前后缀、背景提示)
|
|
|
|
|
public filterAssistElement(
|
|
|
|
|
payload: Required<IEditorData>
|
|
|
|
|
): Required<IEditorData> {
|
|
|
|
|
const editorDataKeys: (keyof IEditorData)[] = ['header', 'main', 'footer']
|
|
|
|
|
editorDataKeys.forEach(key => {
|
|
|
|
|
payload[key] = payload[key].filter(element => {
|
|
|
|
|
if (element.type !== ElementType.CONTROL || element.control?.minWidth) {
|
|
|
|
|
return true
|
|
|
|
|
public filterAssistElement(elementList: IElement[]): IElement[] {
|
|
|
|
|
return elementList.filter(element => {
|
|
|
|
|
if (element.type === ElementType.TABLE) {
|
|
|
|
|
const trList = element.trList!
|
|
|
|
|
for (let r = 0; r < trList.length; r++) {
|
|
|
|
|
const tr = trList[r]
|
|
|
|
|
for (let d = 0; d < tr.tdList.length; d++) {
|
|
|
|
|
const td = tr.tdList[d]
|
|
|
|
|
td.value = this.filterAssistElement(td.value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
element.controlComponent !== ControlComponent.PREFIX &&
|
|
|
|
|
element.controlComponent !== ControlComponent.POSTFIX &&
|
|
|
|
|
element.controlComponent !== ControlComponent.PLACEHOLDER
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (element.type !== ElementType.CONTROL || element.control?.minWidth) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
element.controlComponent !== ControlComponent.PREFIX &&
|
|
|
|
|
element.controlComponent !== ControlComponent.POSTFIX &&
|
|
|
|
|
element.controlComponent !== ControlComponent.PLACEHOLDER
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
return payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断选区部分在控件边界外
|
|
|
|
|
|