From dffe84dd7951756b831288cdc3689ec795bd8473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Wed, 6 Sep 2023 13:38:14 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=AB=A0=E6=9D=A1=E4=BB=A3=E5=8F=B7=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E4=B8=BA=E4=B8=A4=E4=B8=AA=E7=A9=BA=E6=A0=BC=202.?= =?UTF-8?q?=E7=AB=A0=E7=BC=96=E5=8F=B7=E3=80=81=E6=9D=A1=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E3=80=81=E6=97=A0=E6=A0=87=E9=A2=98=E6=9D=A1=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E3=80=81=E7=9B=AE=E6=AC=A1=E5=86=85=E6=9D=A1=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E3=80=81=E6=A0=87=E5=87=86=E7=BC=96=E5=8F=B7=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E4=B8=8E=E6=96=87=E5=AD=97=E9=97=B4=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=A9=BA1=E4=B8=AA=E6=B1=89=E5=AD=97=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/page1/App.vue | 52 +++++++++++-------- src/pages/page1/saicComponents/Init.vue | 18 +++++-- .../page1/saicComponents/chapterData.vue | 5 ++ 3 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/pages/page1/App.vue b/src/pages/page1/App.vue index c026221..6e0d70e 100644 --- a/src/pages/page1/App.vue +++ b/src/pages/page1/App.vue @@ -148,39 +148,45 @@ const oTextPr9 = oHeading1Style6.GetParaPr() oTextPr9.SetSpacingAfter(10) - // var oHeading1Style = oDocument.CreateStyle("Heading 1"); - // const oTextPr = oHeading1Style.GetTextPr(); - // oTextPr.SetFontFamily("黑体"); - // oTextPr.SetColor(0, 0, 0); + var oHeading1Style = oDocument.CreateStyle("Heading 1"); + const oTextPr = oHeading1Style.GetTextPr(); + oTextPr.SetFontFamily("黑体"); + oTextPr.SetFontSize(21) + oTextPr.SetColor(0, 0, 0); // // - // var oHeading1Style1 = oDocument.CreateStyle("Heading 2"); - // const oTextPr1 = oHeading1Style1.GetTextPr(); - // oTextPr1.SetFontFamily("黑体"); - // oTextPr1.SetColor(0, 0, 0); + var oHeading1Style1 = oDocument.CreateStyle("Heading 2"); + const oTextPr1 = oHeading1Style1.GetTextPr(); + oTextPr1.SetFontFamily("黑体"); + oTextPr1.SetFontSize(21) + oTextPr1.SetColor(0, 0, 0); // // - // var oHeading1Style2 = oDocument.CreateStyle("Heading 3"); - // const oTextPr2 = oHeading1Style2.GetTextPr(); - // oTextPr2.SetFontFamily("黑体"); - // oTextPr2.SetColor(0, 0, 0); + var oHeading1Style2 = oDocument.CreateStyle("Heading 3"); + const oTextPr2 = oHeading1Style2.GetTextPr(); + oTextPr2.SetFontFamily("黑体"); + oTextPr2.SetFontSize(21) + oTextPr2.SetColor(0, 0, 0); // // - // var oHeading1Style3 = oDocument.CreateStyle("Heading 4"); - // const oTextPr3 = oHeading1Style3.GetTextPr(); - // oTextPr3.SetFontFamily("黑体"); + var oHeading1Style3 = oDocument.CreateStyle("Heading 4"); + const oTextPr3 = oHeading1Style3.GetTextPr(); + oTextPr3.SetFontFamily("黑体"); + oTextPr3.SetFontSize(21) // oTextPr3.SetColor(0, 0, 0); // // - // var oHeading1Style4 = oDocument.CreateStyle("Heading 5"); - // const oTextPr4 = oHeading1Style4.GetTextPr(); - // oTextPr4.SetFontFamily("黑体"); - // oTextPr4.SetColor(0, 0, 0); + var oHeading1Style4 = oDocument.CreateStyle("Heading 5"); + const oTextPr4 = oHeading1Style4.GetTextPr(); + oTextPr4.SetFontFamily("黑体"); + oTextPr4.SetFontSize(21) + oTextPr4.SetColor(0, 0, 0); // - // var oHeading1Style5 = oDocument.CreateStyle("Heading 6"); - // const oTextPr5 = oHeading1Style5.GetTextPr(); - // oTextPr5.SetFontFamily("黑体"); - // oTextPr5.SetColor(0, 0, 0); + var oHeading1Style5 = oDocument.CreateStyle("Heading 6"); + const oTextPr5 = oHeading1Style5.GetTextPr(); + oTextPr5.SetFontFamily("黑体"); + oTextPr5.SetFontSize(21) + oTextPr5.SetColor(0, 0, 0); var oNormalStyle = oDocument.GetDefaultStyle('numbering') diff --git a/src/pages/page1/saicComponents/Init.vue b/src/pages/page1/saicComponents/Init.vue index 08d75ed..015d82b 100644 --- a/src/pages/page1/saicComponents/Init.vue +++ b/src/pages/page1/saicComponents/Init.vue @@ -1150,7 +1150,7 @@ export default { const oParagraph = Api.CreateParagraph() var oNewDocumentStyle = oDocument.GetStyle('Heading 1') oParagraph.SetStyle(oNewDocumentStyle) - oParagraph.AddText('范围') + oParagraph.AddText(' 范围') oParagraph.SetNumbering(oNumLvl) oParagraph.SetFontFamily('黑体') oParagraph.SetFontSize(21) @@ -1182,7 +1182,7 @@ export default { oDocument.InsertContent([oParagraphA]) const oParagraph4 = Api.CreateParagraph() - oParagraph4.AddText('规范性引用文件') + oParagraph4.AddText(' 规范性引用文件') oParagraph4.SetNumbering(oNumLvl) oParagraph4.SetStyle(oNewDocumentStyle) oParagraph4.SetBold(false) @@ -1238,7 +1238,7 @@ export default { const oParagraph8 = Api.CreateParagraph() oParagraph8.SetStyle(oNewDocumentStyle) - oParagraph8.AddText('术语和定义') + oParagraph8.AddText(' 术语和定义') oParagraph8.SetBold(false) oParagraph8.SetNumbering(oNumLvl) oParagraph8.SetFontFamily('黑体') @@ -1793,6 +1793,18 @@ export default { if (list && list.length > 0) { for (let i = 0; i < list.length; i++) { list[i].SetFontFamily('宋体') + if (list[i].GetText().indexOf('前 言')!= -1){ + let text = list[i].GetText() + text = text.replace(/\s*/g, '') + text = text.substring(0, 2) + oDocument.SearchAndReplace({ 'searchString': '前 言 ', 'replaceString': text }) + } + if (list[i].GetText().indexOf('引 言')!= -1){ + let text = list[i].GetText() + text = text.replace(/\s*/g, '') + text = text.substring(0, 2) + oDocument.SearchAndReplace({ 'searchString': '引 言 ', 'replaceString': text }) + } if (list[i].GetText().indexOf('附 录') != -1 || list[i].GetText().indexOf('附录') != -1) { let text = list[i].GetText() text = text.replace(/\s*/g, '') diff --git a/src/pages/page1/saicComponents/chapterData.vue b/src/pages/page1/saicComponents/chapterData.vue index 31a284e..ec435b4 100644 --- a/src/pages/page1/saicComponents/chapterData.vue +++ b/src/pages/page1/saicComponents/chapterData.vue @@ -218,6 +218,7 @@ oParagraph.SetStyle(oNewDocumentStyle); oParagraph.SetFontSize(21); // oParagraph.SetJc("left"); + oParagraph.AddText(' ') oParagraph.SetColor(0, 0, 0); oParagraph.SetFontFamily("黑体"); oDocument.InsertContent([oParagraph]) @@ -488,6 +489,8 @@ oParagraph.RemoveAllElements() oParagraph.AddLineBreak(); oParagraph.AddText(' '+text) + }else{ + oParagraph.AddText(' ') } oParagraph.SetBold(false); oParagraph.SetFontFamily("黑体"); @@ -723,6 +726,8 @@ oParagraph.RemoveAllElements() oParagraph.AddLineBreak(); oParagraph.AddText(' '+text) + }else{ + oParagraph.AddText(' ') } oParagraph.SetBold(false); oParagraph.SetFontSize(21);