From 3be1fe78c0906e36d6235df6db85da34a86a0e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Tue, 5 Sep 2023 11:20:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=BC=95=E8=A8=80=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/page1/saicComponents/Init.vue | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/pages/page1/saicComponents/Init.vue b/src/pages/page1/saicComponents/Init.vue index e8d3548..70662a1 100644 --- a/src/pages/page1/saicComponents/Init.vue +++ b/src/pages/page1/saicComponents/Init.vue @@ -1007,6 +1007,58 @@ export default { 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(() => { this.handleInit() }, 500)