feat:format control output data
This commit is contained in:
@@ -45,7 +45,8 @@ export const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement> = [
|
||||
'height',
|
||||
'url',
|
||||
'colgroup',
|
||||
'valueList'
|
||||
'valueList',
|
||||
'control'
|
||||
]
|
||||
|
||||
export const TEXTLIKE_ELEMENT_TYPE: ElementType[] = [
|
||||
|
||||
@@ -222,6 +222,31 @@ export function zipElementList(payload: IElement[]): IElement[] {
|
||||
}
|
||||
hyperlinkElement.valueList = zipElementList(valueList)
|
||||
element = hyperlinkElement
|
||||
} else if (element.type === ElementType.CONTROL) {
|
||||
// 控件处理
|
||||
const controlId = element.controlId
|
||||
const control = element.control!
|
||||
const controlElement: IElement = {
|
||||
type: ElementType.CONTROL,
|
||||
value: '',
|
||||
control
|
||||
}
|
||||
const valueList: IElement[] = []
|
||||
while (e < elementList.length) {
|
||||
const controlE = elementList[e]
|
||||
if (controlId !== controlE.controlId) {
|
||||
e--
|
||||
break
|
||||
}
|
||||
if (controlE.controlComponent === ControlComponent.VALUE) {
|
||||
delete controlE.type
|
||||
delete controlE.control
|
||||
valueList.push(controlE)
|
||||
}
|
||||
e++
|
||||
}
|
||||
controlElement.control!.value = zipElementList(valueList)
|
||||
element = controlElement
|
||||
}
|
||||
// 组合元素
|
||||
const pickElement = pickElementAttr(element)
|
||||
|
||||
Reference in New Issue
Block a user