1.章条代号之后为两个空格

2.章编号、条编号、无标题条编号、目次内条编号、标准编号,编号与文字间自动空1个汉字格
This commit is contained in:
范强强
2023-09-06 13:38:14 +08:00
parent 275064da8b
commit dffe84dd79
3 changed files with 49 additions and 26 deletions
+15 -3
View File
@@ -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, '')