fix 初始化延时;正文后面加一个分页,保证老文件不会重叠显示

This commit is contained in:
赵霄
2024-04-23 15:57:30 +08:00
parent 073c5a9101
commit dd4e68ed04
+16 -12
View File
@@ -967,8 +967,10 @@ export default {
oDocument.InsertContent([oParagraph20])
oDocument.CreateSection(oParagraph20)
let oSectionNext = oDocument.GetSections()[2]
oSectionNext.SetTitlePage(false)
oSectionNext.SetPageMargins(1415, 1415, 849, 1132)
// oSectionNext.SetHeaderDistance(1315)
oSectionNext.SetHeaderDistance(1315)
oSectionNext.SetFooterDistance(1315)
let oHeaderText = oSectionNext.GetHeader('even', true)
const oParagraphText = oHeaderText.GetElement(0)
oParagraphText.AddText(Asc.scope.standCode)
@@ -1131,18 +1133,25 @@ export default {
oParagraph9.SetSpacingAfter(0)
oParagraph9.SetSpacingBefore(17)
oParagraph9.SetColor(0, 0, 0)
oParagraph9.AddPageBreak()
oDocument.InsertContent([oParagraph9])
Api.GoToFooter(1)
Api.asc_SetSectionStartPage(1)
let timerNew = setTimeout(() => {
Api.GoToFooter(1)
Api.asc_SetSectionStartPage(1)
console.log('页码操作start')
Api.GoToFooter(4)
Api.asc_SetSectionStartPage(1)
// Api.GoToFooter(1)
Api.ExitHeader_Footer(4)
clearTimeout(timerNew)
timerNew = null
}, 800)
console.log('页码操作end')
}, 900)
let timerTwo = setTimeout(() => {
Api.asc_UpdateTableOfContents()
}, 1100)
console.log('初始化正文,end')
} catch (e) {
console.log(e)
@@ -1154,7 +1163,7 @@ export default {
this.initReferences()
clearTimeout(timer)
timer = null
}, 1200)
}, 1600)
},
replaceData () {
Asc.scope.standCode = this.form.standCode || 'X/XX xxxx-xxxx'
@@ -1868,11 +1877,6 @@ export default {
}
}
if (ContentsPr) {
// 文档中没有标题
const tempList = ContentsPr.GetAllParagraphs()
if (tempList.some(tt => tt.GetText().indexOf('文档中没有标题') !== -1)) {
Api.asc_UpdateTableOfContents()
}
const list = ContentsPr.GetAllParagraphs()
if (list && list.length > 0) {
for (let i = 0; i < list.length; i++) {
@@ -2479,7 +2483,7 @@ export default {
this.form = Object.assign(query, businessInfo)
console.log(this.form)
this.handleCreateCover()
}, 6000)
}, 12000)
}
}
</script>