update 延时修改

This commit is contained in:
赵霄
2024-04-21 22:38:00 +08:00
parent 7b23033595
commit d769f3396a
+19 -8
View File
@@ -228,6 +228,7 @@ export default {
Asc.scope.standardNumberPrefix = this.form.standardNumberPrefix || 'X/XX' Asc.scope.standardNumberPrefix = this.form.standardNumberPrefix || 'X/XX'
window.Asc.plugin.callCommand(() => { window.Asc.plugin.callCommand(() => {
try { try {
console.log('创建封面,start')
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
// 封面只创建一次 // 封面只创建一次
const AllContentControls = oDocument.GetAllContentControls() const AllContentControls = oDocument.GetAllContentControls()
@@ -549,16 +550,18 @@ export default {
// 目录层级只留两级 // 目录层级只留两级
oDocument.AddTableOfContents({ 'BuildFrom': { 'OutlineLvls': 2 } }) oDocument.AddTableOfContents({ 'BuildFrom': { 'OutlineLvls': 2 } })
// Api.asc_AddTableOfContents() // Api.asc_AddTableOfContents()
console.log('创建封面,end')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
}) })
let timer = setTimeout(() => { let timer = setTimeout(() => {
console.log('创建封面,setTimeout')
// 初始化前言,只有前言标题的版本 // 初始化前言,只有前言标题的版本
this.initForeword() this.initForeword()
clearTimeout(timer) clearTimeout(timer)
timer = null timer = null
}, 1000) }, 500)
}, },
equationClick () { equationClick () {
@@ -835,6 +838,7 @@ export default {
window.Asc.scope.BORDER_DISABLE = BORDER_DISABLE window.Asc.scope.BORDER_DISABLE = BORDER_DISABLE
this.ctx.callCommand(() => { this.ctx.callCommand(() => {
try { try {
console.log('初始化前言start')
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
const AllContentControls = oDocument.GetAllContentControls() const AllContentControls = oDocument.GetAllContentControls()
let flag = false let flag = false
@@ -863,6 +867,7 @@ export default {
oParagraph2.SetJc('center') oParagraph2.SetJc('center')
oParagraph2.SetBold(false) oParagraph2.SetBold(false)
oDocument.InsertContent([oParagraph2]) oDocument.InsertContent([oParagraph2])
console.log('初始化前言end')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@@ -871,7 +876,7 @@ export default {
clearTimeout(timer) clearTimeout(timer)
timer = null timer = null
this.initIntroduction() this.initIntroduction()
}, 1000) }, 500)
}, },
/** /**
* 初始化引言 * 初始化引言
@@ -880,6 +885,7 @@ export default {
window.Asc.scope.BORDER_DISABLE = BORDER_DISABLE window.Asc.scope.BORDER_DISABLE = BORDER_DISABLE
this.ctx.callCommand(() => { this.ctx.callCommand(() => {
try { try {
console.log('初始化引言,start')
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
const AllContentControls = oDocument.GetAllContentControls() const AllContentControls = oDocument.GetAllContentControls()
let flag = false let flag = false
@@ -917,6 +923,7 @@ export default {
oParagraph3.SetSpacingAfter(0) oParagraph3.SetSpacingAfter(0)
oParagraph3.SetBold(false) oParagraph3.SetBold(false)
oDocument.InsertContent([oParagraph3]) oDocument.InsertContent([oParagraph3])
console.log('初始化引言,end')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@@ -925,7 +932,7 @@ export default {
clearTimeout(timer) clearTimeout(timer)
timer = null timer = null
this.handleInit() this.handleInit()
}, 1000) }, 500)
}, },
// 初始化正文 // 初始化正文
handleInit () { handleInit () {
@@ -934,6 +941,7 @@ export default {
Asc.scope.standCode = this.form.standCode || 'X/XX xxxx-xxxx' Asc.scope.standCode = this.form.standCode || 'X/XX xxxx-xxxx'
this.ctx.callCommand(() => { this.ctx.callCommand(() => {
try { try {
console.log('初始化正文,start')
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
const AllContentControls = oDocument.GetAllContentControls() const AllContentControls = oDocument.GetAllContentControls()
let flag = false let flag = false
@@ -1140,6 +1148,7 @@ export default {
// } // }
// } // }
// }, 700) // }, 700)
console.log('初始化正文,end')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@@ -1148,28 +1157,28 @@ export default {
clearTimeout(timer) clearTimeout(timer)
timer = null timer = null
this.reorderSort() this.reorderSort()
}, 1000) }, 500)
}, },
reorderSort () { reorderSort () {
this.ctx.callCommand(() => { this.ctx.callCommand(() => {
try { try {
console.log('页码操作') console.log('页码操作,start')
Api.GoToFooter(1) Api.GoToFooter(1)
Api.asc_SetSectionStartPage(1) Api.asc_SetSectionStartPage(1)
Api.GoToFooter(4) Api.GoToFooter(4)
Api.asc_SetSectionStartPage(1) Api.asc_SetSectionStartPage(1)
Api.ExitHeader_Footer(4) Api.ExitHeader_Footer(4)
console.log('页码操作,end')
} catch (e) { } catch (e) {
} }
}) })
let timer = setTimeout(() => { let timer = setTimeout(() => {
console.log('顺序测试')
this.equationOne() this.equationOne()
this.replaceData() this.replaceData()
this.initReferences() this.initReferences()
clearTimeout(timer) clearTimeout(timer)
timer = null timer = null
}, 3000) }, 500)
}, },
replaceData () { replaceData () {
Asc.scope.standCode = this.form.standCode || 'X/XX xxxx-xxxx' Asc.scope.standCode = this.form.standCode || 'X/XX xxxx-xxxx'
@@ -1656,6 +1665,7 @@ export default {
let that = this let that = this
that.ctx.callCommand(() => { that.ctx.callCommand(() => {
try { try {
console.log('目录更新,start')
const oDocument = Api.GetDocument() const oDocument = Api.GetDocument()
const tables = oDocument.GetAllTables() const tables = oDocument.GetAllTables()
if (tables && tables.length > 0) { if (tables && tables.length > 0) {
@@ -1788,6 +1798,7 @@ export default {
} }
} }
} }
console.log('目录更新,end')
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@@ -2331,7 +2342,7 @@ export default {
this.form = Object.assign(query, businessInfo) this.form = Object.assign(query, businessInfo)
console.log(this.form) console.log(this.form)
this.handleCreateCover() this.handleCreateCover()
}, 3000) }, 1000)
} }
} }
</script> </script>