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