fix 无题的各条间距不对,应该是段前段后0;章节只空了1个字符,应该是两个
This commit is contained in:
+4
-2
@@ -13,8 +13,10 @@
|
||||
<% if (process.env.NODE_ENV === 'development' ) { %>
|
||||
<script>
|
||||
window._CONFIG = {
|
||||
'interfaceUrl': 'http://139.9.235.66:8184',
|
||||
'downloadUrl': 'http://139.9.235.66:8184'
|
||||
// 'interfaceUrl': 'http://139.9.235.66:8184',
|
||||
'interfaceUrl': 'http://10.0.1.28:8184',
|
||||
// 'downloadUrl': 'http://139.9.235.66:8184'
|
||||
'downloadUrl': 'http://10.0.1.28:8184'
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "chapterData",
|
||||
data() {
|
||||
export default {
|
||||
name: 'chapterData',
|
||||
data () {
|
||||
return {
|
||||
num: 0,
|
||||
numData: {
|
||||
@@ -88,8 +88,8 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
insertChapter(val) {
|
||||
Asc.scope.alias = val;
|
||||
insertChapter (val) {
|
||||
Asc.scope.alias = val
|
||||
Asc.scope.numData = this.numData
|
||||
this.ctx.callCommand(() => {
|
||||
try {
|
||||
@@ -104,12 +104,12 @@
|
||||
let SpacingBefore
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -122,7 +122,7 @@
|
||||
}
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
@@ -131,8 +131,8 @@
|
||||
}
|
||||
const allElement = oDocument.GetElementsCount()
|
||||
if (table) {
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1);
|
||||
SpacingBefore = number.GetSpacingBefore();
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1)
|
||||
SpacingBefore = number.GetSpacingBefore()
|
||||
}
|
||||
if (SpacingBefore) {
|
||||
if (currentNumbering) {
|
||||
@@ -140,11 +140,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -158,10 +158,10 @@
|
||||
if (currentNumbering) {
|
||||
oNumLvl = currentNumbering.GetNumbering().GetLevel(0)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
oNumLvl = oNumbering.GetLevel(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + ".%1";
|
||||
oNumLvl.SetCustomType("decimal", sFormatString, "left");
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
oNumLvl = oNumbering.GetLevel(0)
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1'
|
||||
oNumLvl.SetCustomType('decimal', sFormatString, 'left')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -170,11 +170,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -188,41 +188,44 @@
|
||||
if (currentNumbering) {
|
||||
oNumLvl = currentNumbering.GetNumbering().GetLevel(0)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
oNumLvl = oNumbering.GetLevel(0);
|
||||
const sFormatString = "%1";
|
||||
oNumLvl.SetCustomType("decimal", sFormatString, "left");
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
oNumLvl = oNumbering.GetLevel(0)
|
||||
const sFormatString = '%1'
|
||||
oNumLvl.SetCustomType('decimal', sFormatString, 'left')
|
||||
}
|
||||
}
|
||||
}
|
||||
// oParagraphOne.Delete()
|
||||
// const oParagraph = Api.CreateParagraph()
|
||||
let oTextPr = oNumLvl.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
let oParaPr = oNumLvl.GetParaPr();
|
||||
oNumLvl.SetSuff("space");
|
||||
oParagraph.SetNumbering(oNumLvl)
|
||||
const oParagraphNew = Api.CreateParagraph()
|
||||
oParagraphNew.AddText(' ' + oParagraph.GetText())
|
||||
oParagraph.Delete()
|
||||
let oTextPr = oNumLvl.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
let oParaPr = oNumLvl.GetParaPr()
|
||||
oNumLvl.SetSuff('none')
|
||||
oParagraphNew.SetNumbering(oNumLvl)
|
||||
if (SpacingBefore) {
|
||||
oParagraph.SetIndLeft(0);
|
||||
oParaPr.SetIndFirstLine(20);
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
oParaPr.SetIndFirstLine(20)
|
||||
} else {
|
||||
oParagraph.SetIndLeft(0);
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
}
|
||||
oParagraph.SetSpacingAfter(267)
|
||||
oParagraph.SetSpacingBefore(267)
|
||||
oParagraph.SetBold(false);
|
||||
const oNewDocumentStyle = oDocument.GetStyle("Heading 1");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetStyle(oNewDocumentStyle);
|
||||
oParagraph.SetFontSize(21);
|
||||
// oParagraph.SetJc("left");
|
||||
oParagraph.AddText(' ')
|
||||
oParagraph.SetColor(0, 0, 0);
|
||||
oParagraph.SetFontFamily("黑体");
|
||||
oDocument.InsertContent([oParagraph])
|
||||
let GetNext = oParagraph.GetNext()
|
||||
oParagraphNew.SetSpacingAfter(267)
|
||||
oParagraphNew.SetSpacingBefore(267)
|
||||
oParagraphNew.SetBold(false)
|
||||
const oNewDocumentStyle = oDocument.GetStyle('Heading 1')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetStyle(oNewDocumentStyle)
|
||||
oParagraphNew.SetFontSize(21)
|
||||
// oParagraphNew.SetJc("left");
|
||||
// oParagraphNew.AddText(' ')
|
||||
oParagraphNew.SetColor(0, 0, 0)
|
||||
oParagraphNew.SetFontFamily('黑体')
|
||||
oDocument.InsertContent([oParagraphNew])
|
||||
let GetNext = oParagraphNew.GetNext()
|
||||
GetNext.SetSpacingAfter(0)
|
||||
GetNext.SetSpacingBefore(0)
|
||||
// GetNext.Delete()
|
||||
@@ -231,10 +234,10 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
insertBar(val, isTrue) {
|
||||
Asc.scope.alias = val;
|
||||
Asc.scope.isTrue = isTrue;
|
||||
Asc.scope.numData = this.numData;
|
||||
insertBar (val, isTrue) {
|
||||
Asc.scope.alias = val
|
||||
Asc.scope.isTrue = isTrue
|
||||
Asc.scope.numData = this.numData
|
||||
this.ctx.callCommand(() => {
|
||||
try {
|
||||
const oDocument = Api.GetDocument()
|
||||
@@ -248,12 +251,12 @@
|
||||
let SpacingBefore
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -266,7 +269,7 @@
|
||||
}
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
@@ -275,8 +278,8 @@
|
||||
}
|
||||
const allElement = oDocument.GetElementsCount()
|
||||
if (table) {
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1);
|
||||
SpacingBefore = number.GetSpacingBefore();
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1)
|
||||
SpacingBefore = number.GetSpacingBefore()
|
||||
}
|
||||
if (SpacingBefore) {
|
||||
if (currentNumbering) {
|
||||
@@ -284,11 +287,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -302,8 +305,8 @@
|
||||
if (currentNumbering) {
|
||||
numbering = currentNumbering.GetNumbering().GetLevel(Asc.scope.alias)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias);
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -312,11 +315,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -330,189 +333,191 @@
|
||||
if (currentNumbering) {
|
||||
numbering = currentNumbering.GetNumbering().GetLevel(Asc.scope.alias)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias);
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// const oParagraph = Api.CreateParagraph()
|
||||
const oParagraphNew = Api.CreateParagraph()
|
||||
oParagraphNew.AddText(' ' + oParagraph.GetText())
|
||||
oParagraph.Delete()
|
||||
let oNewDocumentStyle = null
|
||||
if (SpacingBefore) {
|
||||
if (Asc.scope.alias == '1') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 2");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 2')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '2') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 3");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 3')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '3') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 4");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 4')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '4') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 5");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 5')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '5') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5.%6';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 6");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5.%6'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 6')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
}
|
||||
} else {
|
||||
if (Asc.scope.alias == '1') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 2");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = '%1.%2'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 2')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '2') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2.%3';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 3");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = '%1.%2.%3'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 3')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '3') {
|
||||
const sFormatString = '%1.%2.%3.%4';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 4");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = '%1.%2.%3.%4'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 4')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '4') {
|
||||
const sFormatString = '%1.%2.%3.%4.%5';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 5");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = '%1.%2.%3.%4.%5'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 5')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
} else if (Asc.scope.alias == '5') {
|
||||
const sFormatString = '%1.%2.%3.%4.%5.%6';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Heading 6");
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr();
|
||||
oTextPr3.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(0);
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
const sFormatString = '%1.%2.%3.%4.%5.%6'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Heading 6')
|
||||
const oTextPr3 = oNewDocumentStyle.GetTextPr()
|
||||
oTextPr3.SetFontFamily('黑体')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
}
|
||||
}
|
||||
// oParagraphOne.Delete()
|
||||
const ParaPr = numbering.GetParaPr()
|
||||
ParaPr.SetStyle(oNewDocumentStyle)
|
||||
ParaPr.SetSpacingAfter(140)
|
||||
oParagraph.SetStyle(oNewDocumentStyle);
|
||||
oParagraph.SetNumbering(numbering)
|
||||
oParagraph.SetSpacingAfter(127)
|
||||
oParagraph.SetSpacingBefore(127)
|
||||
let isTrue = false
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("paragraph" === element.GetClassType()) {
|
||||
let ContentControls = element.GetParaPr().GetStyle()
|
||||
if (ContentControls && ContentControls.GetName() == 'Heading 1') {
|
||||
if (element.GetText() == ' 术语和定义') {
|
||||
isTrue = true
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isTrue) {
|
||||
let text = oParagraph.GetText()
|
||||
oParagraph.RemoveAllElements()
|
||||
oParagraph.AddLineBreak();
|
||||
oParagraph.AddText(' '+text)
|
||||
}else{
|
||||
oParagraph.AddText(' ')
|
||||
}
|
||||
oParagraph.SetBold(false);
|
||||
oParagraph.SetFontFamily("黑体");
|
||||
oParagraph.SetFontSize(21);
|
||||
oParagraph.SetJc("both");
|
||||
oParagraph.SetColor(0, 0, 0);
|
||||
let GetNext = oParagraph.GetNext()
|
||||
oParagraphNew.SetStyle(oNewDocumentStyle)
|
||||
oParagraphNew.SetNumbering(numbering)
|
||||
oParagraphNew.SetSpacingAfter(127)
|
||||
oParagraphNew.SetSpacingBefore(127)
|
||||
// let isTrue = false
|
||||
// for (let i = num - 1; i >= 0; i--) {
|
||||
// const element = oDocument.GetElement(i)
|
||||
// if ('paragraph' === element.GetClassType()) {
|
||||
// let ContentControls = element.GetParaPr().GetStyle()
|
||||
// if (ContentControls && ContentControls.GetName() == 'Heading 1') {
|
||||
// if (element.GetText() == ' 术语和定义') {
|
||||
// isTrue = true
|
||||
// }
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (isTrue) {
|
||||
// let text = oParagraphNew.GetText()
|
||||
// oParagraphNew.RemoveAllElements()
|
||||
// oParagraphNew.AddLineBreak()
|
||||
// oParagraphNew.AddText(' ' + text)
|
||||
// } else {
|
||||
// oParagraphNew.AddText(' ')
|
||||
// }
|
||||
oParagraphNew.SetBold(false)
|
||||
oParagraphNew.SetFontFamily('黑体')
|
||||
oParagraphNew.SetFontSize(21)
|
||||
oParagraphNew.SetJc('both')
|
||||
oParagraphNew.SetColor(0, 0, 0)
|
||||
oDocument.InsertContent([oParagraphNew])
|
||||
let GetNext = oParagraphNew.GetNext()
|
||||
GetNext.SetSpacingAfter(0)
|
||||
GetNext.SetSpacingBefore(0)
|
||||
// GetNext.Delete()
|
||||
// oDocument.InsertContent([oParagraph])
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
},
|
||||
insertBarOne(val, isTrue) {
|
||||
Asc.scope.alias = val;
|
||||
Asc.scope.isTrue = isTrue;
|
||||
Asc.scope.numData = this.numData;
|
||||
insertBarOne (val, isTrue) {
|
||||
Asc.scope.alias = val
|
||||
Asc.scope.isTrue = isTrue
|
||||
Asc.scope.numData = this.numData
|
||||
this.ctx.callCommand(() => {
|
||||
try {
|
||||
const oDocument = Api.GetDocument()
|
||||
@@ -526,12 +531,12 @@
|
||||
let SpacingBefore
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -544,7 +549,7 @@
|
||||
}
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
table = element
|
||||
break
|
||||
@@ -553,8 +558,8 @@
|
||||
}
|
||||
const allElement = oDocument.GetElementsCount()
|
||||
if (table) {
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1);
|
||||
SpacingBefore = number.GetSpacingBefore();
|
||||
let number = table.GetCell(0, 0).GetContent().GetElement(1)
|
||||
SpacingBefore = number.GetSpacingBefore()
|
||||
}
|
||||
if (SpacingBefore) {
|
||||
if (currentNumbering) {
|
||||
@@ -562,11 +567,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -580,8 +585,8 @@
|
||||
if (currentNumbering) {
|
||||
numbering = currentNumbering.GetNumbering().GetLevel(Asc.scope.alias)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias);
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -590,11 +595,11 @@
|
||||
} else {
|
||||
for (let i = num + 1; i < allElement; i++) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("table" === element.GetClassType()) {
|
||||
if ('table' === element.GetClassType()) {
|
||||
if (element.GetTableDescription() == 'appendix') {
|
||||
break
|
||||
}
|
||||
} else if ("paragraph" === element.GetClassType()) {
|
||||
} else if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
const text = element.GetSpacingAfter()
|
||||
if (getNumbering !== null) {
|
||||
@@ -608,137 +613,139 @@
|
||||
if (currentNumbering) {
|
||||
numbering = currentNumbering.GetNumbering().GetLevel(Asc.scope.alias)
|
||||
} else {
|
||||
let oNumbering = oDocument.CreateNumbering("numbered");
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias);
|
||||
let oNumbering = oDocument.CreateNumbering('numbered')
|
||||
numbering = oNumbering.GetLevel(Asc.scope.alias)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// const oParagraph = Api.CreateParagraph()
|
||||
const oParagraphNew = Api.CreateParagraph()
|
||||
oParagraphNew.AddText(' ' + oParagraph.GetText())
|
||||
oParagraph.Delete()
|
||||
let oNewDocumentStyle = null
|
||||
if (SpacingBefore) {
|
||||
if (Asc.scope.alias == '1') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
} else if (Asc.scope.alias == '2') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
} else if (Asc.scope.alias == '3') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
} else if (Asc.scope.alias == '4') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
} else if (Asc.scope.alias == '5') {
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5.%6';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(25);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = Asc.scope.numData[SpacingBefore] + '.%1.%2.%3.%4.%5.%6'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(25)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
}
|
||||
} else {
|
||||
if (Asc.scope.alias == '1') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = '%1.%2'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
} else if (Asc.scope.alias == '2') {
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2.%3';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
const sFormatString = '%1.%2.%3'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
} else if (Asc.scope.alias == '3') {
|
||||
const sFormatString = '%1.%2.%3.%4';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2.%3.%4'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
} else if (Asc.scope.alias == '4') {
|
||||
const sFormatString = '%1.%2.%3.%4.%5';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2.%3.%4.%5'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
} else if (Asc.scope.alias == '5') {
|
||||
const sFormatString = '%1.%2.%3.%4.%5.%6';
|
||||
numbering.SetCustomType("decimal", sFormatString, "left");
|
||||
numbering.SetSuff("space");
|
||||
let oParaPr = numbering.GetParaPr();
|
||||
oParaPr.SetIndFirstLine(0);
|
||||
oNewDocumentStyle = oDocument.GetStyle("Normal");
|
||||
oParagraph.SetIndLeft(0);
|
||||
const sFormatString = '%1.%2.%3.%4.%5.%6'
|
||||
numbering.SetCustomType('decimal', sFormatString, 'left')
|
||||
numbering.SetSuff('none')
|
||||
let oParaPr = numbering.GetParaPr()
|
||||
oParaPr.SetIndFirstLine(0)
|
||||
oNewDocumentStyle = oDocument.GetStyle('Normal')
|
||||
oParagraphNew.SetIndLeft(0)
|
||||
}
|
||||
}
|
||||
// oParagraphOne.Delete()
|
||||
let oTextPr = numbering.GetTextPr();
|
||||
oTextPr.SetFontFamily("黑体");
|
||||
let oTextPr = numbering.GetTextPr()
|
||||
oTextPr.SetFontFamily('黑体')
|
||||
const ParaPr = numbering.GetParaPr()
|
||||
ParaPr.SetStyle(oNewDocumentStyle)
|
||||
ParaPr.SetSpacingAfter(140)
|
||||
oParagraph.SetStyle(oNewDocumentStyle);
|
||||
oParagraph.SetNumbering(numbering)
|
||||
oParagraph.SetSpacingAfter(127)
|
||||
oParagraph.SetSpacingBefore(127)
|
||||
oParagraph.SetFontFamily("宋体");
|
||||
oParagraphNew.SetStyle(oNewDocumentStyle)
|
||||
oParagraphNew.SetNumbering(numbering)
|
||||
oParagraphNew.SetSpacingAfter(0)
|
||||
oParagraphNew.SetSpacingBefore(0)
|
||||
oParagraphNew.SetFontFamily('宋体')
|
||||
let isTrue = false
|
||||
for (let i = num - 1; i >= 0; i--) {
|
||||
const element = oDocument.GetElement(i)
|
||||
if ("paragraph" === element.GetClassType()) {
|
||||
let ContentControls = element.GetParaPr().GetStyle()
|
||||
if (ContentControls && ContentControls.GetName() == 'Heading 1') {
|
||||
if (element.GetText() == ' 术语和定义') {
|
||||
isTrue = true
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isTrue) {
|
||||
let text = oParagraph.GetText()
|
||||
oParagraph.RemoveAllElements()
|
||||
oParagraph.AddLineBreak();
|
||||
oParagraph.AddText(' '+text)
|
||||
}else{
|
||||
oParagraph.AddText(' ')
|
||||
}
|
||||
oParagraph.SetBold(false);
|
||||
oParagraph.SetFontSize(21);
|
||||
oParagraph.SetJc("left");
|
||||
oParagraph.SetColor(0, 0, 0);
|
||||
oDocument.InsertContent([oParagraph])
|
||||
let GetNext = oParagraph.GetNext()
|
||||
// for (let i = num - 1; i >= 0; i--) {
|
||||
// const element = oDocument.GetElement(i)
|
||||
// if ('paragraph' === element.GetClassType()) {
|
||||
// let ContentControls = element.GetParaPr().GetStyle()
|
||||
// if (ContentControls && ContentControls.GetName() == 'Heading 1') {
|
||||
// if (element.GetText() == ' 术语和定义') {
|
||||
// isTrue = true
|
||||
// }
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (isTrue) {
|
||||
// let text = oParagraphNew.GetText()
|
||||
// oParagraphNew.RemoveAllElements()
|
||||
// oParagraphNew.AddLineBreak()
|
||||
// oParagraphNew.AddText(' ' + text)
|
||||
// } else {
|
||||
// oParagraphNew.AddText(' ')
|
||||
// }
|
||||
oParagraphNew.SetBold(false)
|
||||
oParagraphNew.SetFontSize(21)
|
||||
oParagraphNew.SetJc('left')
|
||||
oParagraphNew.SetColor(0, 0, 0)
|
||||
oDocument.InsertContent([oParagraphNew])
|
||||
let GetNext = oParagraphNew.GetNext()
|
||||
GetNext.SetSpacingAfter(0)
|
||||
GetNext.SetSpacingBefore(0)
|
||||
// GetNext.Delete()
|
||||
@@ -747,8 +754,8 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
adjustTo(val) {
|
||||
Asc.scope.alias = val.key;
|
||||
adjustTo (val) {
|
||||
Asc.scope.alias = val.key
|
||||
this.ctx.callCommand(() => {
|
||||
try {
|
||||
const oDocument = Api.GetDocument()
|
||||
@@ -757,12 +764,12 @@
|
||||
let currentNumbering = null
|
||||
for (let index = 0; index < allElement; index++) {
|
||||
const element = oDocument.GetElement(index)
|
||||
if ("paragraph" === element.GetClassType()) {
|
||||
if ('paragraph' === element.GetClassType()) {
|
||||
const getNumbering = element.GetNumbering()
|
||||
if (getNumbering !== null) {
|
||||
currentNumbering = getNumbering
|
||||
} else {
|
||||
currentNumbering = element.CreateNumbering("numbered");
|
||||
currentNumbering = element.CreateNumbering('numbered')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -770,30 +777,30 @@
|
||||
if (currentNumbering) {
|
||||
numbering = currentNumbering.GetNumbering().GetLevel(Asc.scope.alias)
|
||||
} else {
|
||||
const numberingIndex = oDocument.CreateNumbering("numbered");
|
||||
numbering = numberingIndex.GetLevel(0);
|
||||
const numberingIndex = oDocument.CreateNumbering('numbered')
|
||||
numbering = numberingIndex.GetLevel(0)
|
||||
}
|
||||
}
|
||||
const oParagraph = Api.CreateParagraph()
|
||||
oParagraph.SetNumbering(numbering)
|
||||
oParagraph.SetIndLeft(360);
|
||||
oParagraph.SetBold(false);
|
||||
oParagraph.SetFontSize(21);
|
||||
oParagraph.SetFontFamily("黑体");
|
||||
oParagraph.SetIndLeft(360)
|
||||
oParagraph.SetBold(false)
|
||||
oParagraph.SetFontSize(21)
|
||||
oParagraph.SetFontFamily('黑体')
|
||||
oDocument.InsertContent([oParagraph])
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
},
|
||||
demoteClick() {
|
||||
demoteClick () {
|
||||
|
||||
},
|
||||
upgradeClick() {
|
||||
upgradeClick () {
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user