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