fix: executeSetControlProperties api invalid in table #653
This commit is contained in:
@@ -793,17 +793,21 @@ export class Control {
|
||||
if (isReadonly) return
|
||||
const { conceptId, properties } = payload
|
||||
let isExistUpdate = false
|
||||
const pageComponentData: IEditorData = {
|
||||
header: this.draw.getHeaderElementList(),
|
||||
main: this.draw.getOriginalMainElementList(),
|
||||
footer: this.draw.getFooterElementList()
|
||||
}
|
||||
for (const key in pageComponentData) {
|
||||
const elementList = pageComponentData[<keyof IEditorData>key]!
|
||||
function setProperties(elementList: IElement[]) {
|
||||
let i = 0
|
||||
while (i < elementList.length) {
|
||||
const element = elementList[i]
|
||||
i++
|
||||
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]
|
||||
setProperties(td.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (element?.control?.conceptId !== conceptId) continue
|
||||
isExistUpdate = true
|
||||
element.control = {
|
||||
@@ -821,6 +825,16 @@ export class Control {
|
||||
i = newEndIndex
|
||||
}
|
||||
}
|
||||
// 页眉页脚正文启动搜索
|
||||
const pageComponentData: IEditorData = {
|
||||
header: this.draw.getHeaderElementList(),
|
||||
main: this.draw.getOriginalMainElementList(),
|
||||
footer: this.draw.getFooterElementList()
|
||||
}
|
||||
for (const key in pageComponentData) {
|
||||
const elementList = pageComponentData[<keyof IEditorData>key]!
|
||||
setProperties(elementList)
|
||||
}
|
||||
if (!isExistUpdate) return
|
||||
// 强制更新
|
||||
for (const key in pageComponentData) {
|
||||
|
||||
Reference in New Issue
Block a user