From 79570c4ded54faa4847f3f6693a4d3cc010d343f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Fri, 8 Sep 2023 10:29:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=9B=AE=E5=BD=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=9C=89=E9=94=99=E8=AF=AF=EF=BC=9A=E9=99=84=E5=BD=95=E3=80=81?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA=E7=9A=84=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=A4=AA=E5=A4=9A=E3=80=82=E5=B1=82=E7=BA=A7=E5=A4=AA=E5=A4=9A?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E8=A6=81=E4=B8=A4=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/page1/saicComponents/Init.vue | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pages/page1/saicComponents/Init.vue b/src/pages/page1/saicComponents/Init.vue index 7e1648e..47ad960 100644 --- a/src/pages/page1/saicComponents/Init.vue +++ b/src/pages/page1/saicComponents/Init.vue @@ -527,7 +527,8 @@ export default { oParagraphTwo.SetJc('center') oParagraphTwo.SetBold(false) oDocument.InsertContent([oParagraphTwo]) - Api.asc_AddTableOfContents() + // 目录层级只留两级 + oDocument.AddTableOfContents({ 'BuildFrom': { 'OutlineLvls': 2 } }) } catch (e) { console.log(e) } @@ -1204,7 +1205,6 @@ export default { oParagraph5.SetColor(0, 0, 0) oDocument.InsertContent([oParagraph5]) - // oParagraph6.Search("GB/T 321")[0].SetFontFamily('Times New Roman'); // @@ -1791,31 +1791,32 @@ export default { if (list && list.length > 0) { for (let i = 0; i < list.length; i++) { list[i].SetFontFamily('宋体') - if (list[i].GetText().indexOf('前 言') != -1 || list[i].GetText().indexOf('前言') != -1){ + if (list[i].GetText().indexOf('前 言') !== -1 || list[i].GetText().indexOf('前言') !== -1) { let text = list[i].GetText() text = text.replace(/\s*/g, '') text = text.substring(0, 2) - var aSearch = list[i].Search("前 言"); + var aSearch = list[i].Search('前 言') aSearch[0].AddText('前言') - var aSearch1 = list[i].Search("前 言"); + var aSearch1 = list[i].Search('前 言') aSearch1[0].Delete() } - if (list[i].GetText().indexOf('引 言') != -1 || list[i].GetText().indexOf('引言') != -1){ + if (list[i].GetText().indexOf('引 言') !== -1 || list[i].GetText().indexOf('引言') !== -1) { let text = list[i].GetText() text = text.replace(/\s*/g, '') text = text.substring(0, 2) - var aSearch = list[i].Search("引 言"); + var aSearch = list[i].Search('引 言') aSearch[0].AddText('引言') - var aSearch1 = list[i].Search("引 言"); + var aSearch1 = list[i].Search('引 言') aSearch1[0].Delete() } - if (list[i].GetText().indexOf('附 录') != -1 || list[i].GetText().indexOf('附录') != -1) { + if (list[i].GetText().indexOf('附 录') !== -1 || 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 }) list[i].SetPosition(0) } + // 3.1 if (list[i].GetIndLeft() == 283) { list[i].SetIndLeft(320) let textOne = list[i].GetText() @@ -1825,7 +1826,7 @@ export default { oDocument.SearchAndReplace({ 'searchString': name + ' ', 'replaceString': name }) - } else if (list[i].GetIndLeft() == 567) { + } else if (list[i].GetIndLeft() == 567) { // 3.1.1 list[i].SetIndLeft(420) } else if (list[i].GetIndLeft() == 850) { list[i].SetIndLeft(520)