fix 添加一个引言页面
This commit is contained in:
@@ -1007,6 +1007,58 @@ export default {
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.initIntroduction()
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 初始化引言
|
||||||
|
*/
|
||||||
|
initIntroduction () {
|
||||||
|
window.Asc.scope.BORDER_DISABLE = BORDER_DISABLE
|
||||||
|
this.ctx.callCommand(() => {
|
||||||
|
try {
|
||||||
|
const oDocument = Api.GetDocument()
|
||||||
|
const AllContentControls = oDocument.GetAllContentControls()
|
||||||
|
let flag = false
|
||||||
|
for (let i = 0; i < AllContentControls.length; i++) {
|
||||||
|
if (AllContentControls[i].GetAlias() === 'foton.standardName') {
|
||||||
|
flag = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
DE.controllers.Toolbar.api.put_AddPageBreak()
|
||||||
|
const oParagraph20 = Api.CreateParagraph()
|
||||||
|
oDocument.InsertContent([oParagraph20])
|
||||||
|
const oParagraph2 = Api.CreateParagraph()
|
||||||
|
let oNewDocumentStyle = oDocument.GetStyle('Heading 1')
|
||||||
|
oParagraph2.SetStyle(oNewDocumentStyle)
|
||||||
|
oParagraph2.AddText('引 言')
|
||||||
|
oParagraph2.SetFontSize(32)
|
||||||
|
oParagraph2.SetSpacing(1.8)
|
||||||
|
oParagraph2.SetSpacingBefore(549)
|
||||||
|
oParagraph2.SetSpacingAfter(597)
|
||||||
|
oParagraph2.SetFontFamily('黑体')
|
||||||
|
oParagraph2.SetColor(0, 0, 0)
|
||||||
|
oParagraph2.SetJc('center')
|
||||||
|
oParagraph2.SetBold(false)
|
||||||
|
oDocument.InsertContent([oParagraph2])
|
||||||
|
const text = ' 引言为可选要素。如果需要,则给出标准技术内容的特殊信息或说明,以及编制该标准的原因引言不应包含要求。'
|
||||||
|
const oParagraph3 = Api.CreateParagraph()
|
||||||
|
oParagraph3.AddText(text)
|
||||||
|
oParagraph3.SetFontSize(21)
|
||||||
|
oParagraph3.SetFontFamily('宋体')
|
||||||
|
oParagraph3.SetColor(0, 0, 0)
|
||||||
|
oParagraph3.SetSpacingAfter(0)
|
||||||
|
oParagraph3.SetBold(false)
|
||||||
|
oDocument.InsertContent([oParagraph3])
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.handleInit()
|
this.handleInit()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
Reference in New Issue
Block a user