1.章条代号之后为两个空格
2.章编号、条编号、无标题条编号、目次内条编号、标准编号,编号与文字间自动空1个汉字格
This commit is contained in:
+29
-23
@@ -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')
|
||||
|
||||
@@ -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, '')
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user