update 参考文献改为手动插入

This commit is contained in:
赵霄
2024-05-15 10:30:32 +08:00
parent f979ec9e7e
commit 9d8ce26127
+19 -19
View File
@@ -35,11 +35,15 @@
<a-button @click="addReviseForeword">前言修订标准</a-button>
</a-button-group>
<a-button-group v-if="!!form.processId">
<a-button-group v-if="!!form.processId" style="margin-bottom: 10px">
<a-button @click="addPublicationChapter">添加发布章</a-button>
<a-button @click="insertSignatureInfo">插入签审信息</a-button>
</a-button-group>
<a-button-group>
<a-button @click="initReferences">参考文献</a-button>
</a-button-group>
<!-- 企标基础信息读取 -->
<a-modal v-model="initModalVisible" title="企标文件初始化" @ok="handleInitModalConfirm">
<a-form-model id="components-form-demo-validate-other" :model="form" v-bind="formItemLayout"
@@ -1126,6 +1130,16 @@ export default {
oParagraph9.AddPageBreak()
oDocument.InsertContent([oParagraph9])
// 插入终止线
const oParagraphLine = Api.CreateParagraph()
const oFill = Api.CreateSolidFill(Api.CreateRGBColor(0, 0, 0))
const oStroke = Api.CreateStroke(0, Api.CreateNoFill())
const oDrawing = Api.CreateShape('rect', 1810900, 19000, oFill, oStroke)
oParagraphLine.SetJc('center')
oParagraphLine.SetSpacingBefore(840)
oParagraphLine.AddDrawing(oDrawing)
oDocument.Push(oParagraphLine)
Api.GoToFooter(1)
Api.asc_SetSectionStartPage(1)
@@ -1150,7 +1164,6 @@ export default {
let timer = setTimeout(() => {
this.initializeDirectory()
this.replaceData()
this.initReferences()
clearTimeout(timer)
timer = null
}, 1600)
@@ -2126,11 +2139,7 @@ export default {
if (flag) {
return
}
// 参考文献是在最后生成的,所以不需要和引言一样校验正文是否存在
const documentCount = oDocument.GetElementsCount()
// 获取文档最后一个段落
const lastParagraph = oDocument.GetElement(documentCount - 1)
// 参考文献标题文本
DE.controllers.Toolbar.api.put_AddPageBreak()
const oRunTitle = Api.CreateRun()
const oParagraphTitle = Api.CreateParagraph()
let oNewDocumentStyle = oDocument.GetStyle('Heading 1')
@@ -2148,8 +2157,7 @@ export default {
oParagraphTitle.SetColor(0, 0, 0)
oParagraphTitle.SetJc('center')
oParagraphTitle.SetBold(false)
lastParagraph.AddPageBreak()
oDocument.Push(oParagraphTitle)
oDocument.InsertContent([oParagraphTitle])
const text = '[1] GB/T 10112-1999 术语工作 原则与方法'
const contentParagraph = Api.CreateParagraph()
contentParagraph.AddText(text)
@@ -2158,16 +2166,8 @@ export default {
contentParagraph.SetColor(0, 0, 0)
contentParagraph.SetSpacingAfter(0)
contentParagraph.SetBold(false)
oDocument.Push(contentParagraph)
// 插入终止线
const oParagraphLine = Api.CreateParagraph()
const oFill = Api.CreateSolidFill(Api.CreateRGBColor(0, 0, 0))
const oStroke = Api.CreateStroke(0, Api.CreateNoFill())
const oDrawing = Api.CreateShape('rect', 1810900, 19000, oFill, oStroke)
oParagraphLine.SetJc('center')
oParagraphLine.SetSpacingBefore(840)
oParagraphLine.AddDrawing(oDrawing)
oDocument.Push(oParagraphLine)
oDocument.InsertContent([contentParagraph])
} catch (e) {
console.log(e)
}