zydx-plus 1.33.382 → 1.33.383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/editor/src/butJson.js +59 -16
- package/src/components/editor/src/editor.vue +198 -76
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -23,11 +23,10 @@ const num = {
|
|
|
23
23
|
|
|
24
24
|
export function butJson(editor, data) {
|
|
25
25
|
return {
|
|
26
|
-
switchingFormat:{
|
|
26
|
+
switchingFormat: {
|
|
27
27
|
name: '切换版式',
|
|
28
28
|
key: 'switchingFormat',
|
|
29
|
-
menuKeys:[
|
|
30
|
-
]
|
|
29
|
+
menuKeys: []
|
|
31
30
|
},
|
|
32
31
|
shortcut: {
|
|
33
32
|
name: '快捷排版',
|
|
@@ -57,7 +56,7 @@ export function butJson(editor, data) {
|
|
|
57
56
|
name: '抬 头',
|
|
58
57
|
key: 'lookUp',
|
|
59
58
|
menuKeys: [],
|
|
60
|
-
html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size:
|
|
59
|
+
html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size: 16px; font-family:SimHei;font-weight: 700;">请在此处输入抬头:</span><span> </span></p>`
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
62
|
name: '摘 要',
|
|
@@ -118,6 +117,62 @@ export function butJson(editor, data) {
|
|
|
118
117
|
{name: '间距设置', key: 'LineSpace'}
|
|
119
118
|
],
|
|
120
119
|
},
|
|
120
|
+
outlineMenu: {
|
|
121
|
+
name: '大纲级别',
|
|
122
|
+
key: 'outlineMenu',
|
|
123
|
+
menuKeys: [
|
|
124
|
+
{name: '一级标题', key: 'title-1'},
|
|
125
|
+
{name: '二级标题', key: 'title-2'},
|
|
126
|
+
{name: '三级标题', key: 'title-3'},
|
|
127
|
+
{name: '四级标题', key: 'title-4'},
|
|
128
|
+
{name: '正文文本', key: 'text'},
|
|
129
|
+
],
|
|
130
|
+
html: {}
|
|
131
|
+
},
|
|
132
|
+
signMenu: {
|
|
133
|
+
name: '标 志',
|
|
134
|
+
key: 'signMenu',
|
|
135
|
+
menuKeys: []
|
|
136
|
+
},
|
|
137
|
+
redMenu: {
|
|
138
|
+
name: '红 头',
|
|
139
|
+
key: 'redMenu',
|
|
140
|
+
menuKeys: [],
|
|
141
|
+
html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p><p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>`
|
|
142
|
+
},
|
|
143
|
+
firstLevelHeading: {
|
|
144
|
+
name: '一级标题',
|
|
145
|
+
key: 'firstLevelHeading',
|
|
146
|
+
menuKeys: [],
|
|
147
|
+
html: `<p data-signid="title-1" class="title indent"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p>`
|
|
148
|
+
},
|
|
149
|
+
secondaryHeading: {
|
|
150
|
+
name: '二级标题',
|
|
151
|
+
key: 'secondaryHeading',
|
|
152
|
+
menuKeys: [],
|
|
153
|
+
html: `<p data-signid="title-2" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p>`
|
|
154
|
+
},
|
|
155
|
+
paragraphBody: {
|
|
156
|
+
name: '正文文本',
|
|
157
|
+
key: 'paragraphBody',
|
|
158
|
+
menuKeys: [],
|
|
159
|
+
html: `<p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>`
|
|
160
|
+
},
|
|
161
|
+
ackMenu: {
|
|
162
|
+
name: '致 谢',
|
|
163
|
+
key: 'ackMenu',
|
|
164
|
+
menuKeys: [],
|
|
165
|
+
html: [
|
|
166
|
+
`<p data-signId="ack" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 16px;font-weight: bold;">致谢</span></p>`,
|
|
167
|
+
`<p><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi;">致谢内容...</span></p>`
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
paragraphMenu: {
|
|
171
|
+
name: '落 款',
|
|
172
|
+
key: 'paragraphMenu',
|
|
173
|
+
menuKeys: [],
|
|
174
|
+
html: `<p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p><p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
175
|
+
},
|
|
121
176
|
alignmentMode: {
|
|
122
177
|
name: '对齐方式',
|
|
123
178
|
key: 'alignmentMode',
|
|
@@ -174,18 +229,6 @@ export function butJson(editor, data) {
|
|
|
174
229
|
regular5: `<p class="text" style="text-align: left;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">请输入正文</span></p>`,
|
|
175
230
|
}
|
|
176
231
|
},
|
|
177
|
-
outlineMenu: {
|
|
178
|
-
name: '大纲级别',
|
|
179
|
-
key: 'outlineMenu',
|
|
180
|
-
menuKeys: [
|
|
181
|
-
{name: '一级标题', key: 'title-1'},
|
|
182
|
-
{name: '二级标题', key: 'title-2'},
|
|
183
|
-
{name: '三级标题', key: 'title-3'},
|
|
184
|
-
{name: '四级标题', key: 'title-4'},
|
|
185
|
-
{name: '正文文本', key: 'text'},
|
|
186
|
-
],
|
|
187
|
-
html: {}
|
|
188
|
-
},
|
|
189
232
|
authorMenu: {
|
|
190
233
|
name: '作者',
|
|
191
234
|
key: 'authorMenu',
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
</div>
|
|
274
274
|
</div>
|
|
275
275
|
<div v-if="!readOnly" class="p-popup-but-box">
|
|
276
|
-
<div class="tip-btn" @click="nounExplainSubmit
|
|
276
|
+
<div class="tip-btn" @click="nounExplainSubmit" v-html="'完成'"></div>
|
|
277
277
|
</div>
|
|
278
278
|
</div>
|
|
279
279
|
</template>
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
<div class="page-line-select">
|
|
318
318
|
<div class="name">样 式</div>
|
|
319
319
|
:
|
|
320
|
-
<zydx-select v-model:value="lineType" :options="lineOptions"
|
|
320
|
+
<zydx-select v-model:value="lineType" :options="lineOptions"></zydx-select>
|
|
321
321
|
</div>
|
|
322
322
|
</div>
|
|
323
323
|
<div class="tip-btnBox">
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
<div class="page-line-select">
|
|
340
340
|
<div class="name">选择版式:</div>
|
|
341
341
|
:
|
|
342
|
-
<zydx-select v-model:value="templateType" :options="templateOptions"
|
|
342
|
+
<zydx-select v-model:value="templateType" :options="templateOptions"></zydx-select>
|
|
343
343
|
</div>
|
|
344
344
|
</div>
|
|
345
345
|
<div class="tip-btnBox">
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
|
|
384
384
|
<!-- 展示弹窗 -->
|
|
385
385
|
<div v-for="(item,index) in interpositionData" :key="index">
|
|
386
|
-
<zydx-drag-popup v-if="item.isShow" :enlargeShow="false" :minHeight="183"
|
|
386
|
+
<zydx-drag-popup v-if="item.isShow" :drag-text-show="false" :enlargeShow="false" :minHeight="183"
|
|
387
387
|
:minWidth="['importWorks', 'linkCourseware', 'importArticles', 'videoLink'].indexOf(item.type) === -1 ? 640 :905"
|
|
388
388
|
:minimize="false" :minimizeCir="false"
|
|
389
389
|
:title="titleDragPopup[item.type]?titleDragPopup[item.type]:'参考文献'"
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
</div>
|
|
571
571
|
</template>
|
|
572
572
|
|
|
573
|
-
<script>
|
|
573
|
+
<script lang="jsx">
|
|
574
574
|
import exportWord from 'js-export-word'
|
|
575
575
|
import mammoth from './mammoth.browser.min'
|
|
576
576
|
import {butJson} from './butJson'
|
|
@@ -751,10 +751,14 @@ export default {
|
|
|
751
751
|
audioData: [],
|
|
752
752
|
time: {},
|
|
753
753
|
hex: '',
|
|
754
|
-
toolbar:
|
|
755
|
-
'switchingFormat','
|
|
754
|
+
toolbar: [
|
|
755
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
|
|
756
756
|
'outlineMenu', 'alignmentMode', 'titleMenu',
|
|
757
757
|
'textMenu', 'color', 'interposition'],
|
|
758
|
+
// toolbar: [
|
|
759
|
+
// 'switchingFormat', 'shortcut', 'pageMargin', 'paragraph',
|
|
760
|
+
// 'outlineMenu', 'alignmentMode', 'titleMenu',
|
|
761
|
+
// 'textMenu', 'color', 'interposition'],
|
|
758
762
|
bubbleData: {},
|
|
759
763
|
htmlJson: [],
|
|
760
764
|
showRetractionPopup: false,
|
|
@@ -773,10 +777,11 @@ export default {
|
|
|
773
777
|
{label: '---------------------------------------', value: 'dashed'},
|
|
774
778
|
{label: '════════════════════════', value: 'double'}],
|
|
775
779
|
templateOptions: [
|
|
780
|
+
{label: '自由排版', value: 'freeTypesetting'},
|
|
776
781
|
{label: '公文版式', value: 'officialDocumentFormat'},
|
|
777
782
|
{label: '新闻版式', value: 'newsFormat'},
|
|
778
783
|
{label: '论文版式', value: 'paperFormat'}],
|
|
779
|
-
lineType:'solid',
|
|
784
|
+
lineType: 'solid',
|
|
780
785
|
paragraph: {
|
|
781
786
|
left: 0,
|
|
782
787
|
right: 0,
|
|
@@ -790,25 +795,31 @@ export default {
|
|
|
790
795
|
isShowPageMargin: false,
|
|
791
796
|
isShowHorizontalLine: false,
|
|
792
797
|
isShowSwitchingFormat: false,
|
|
793
|
-
templateType:'
|
|
794
|
-
switchingFormat:[
|
|
798
|
+
templateType: 'freeTypesetting',
|
|
799
|
+
switchingFormat: [
|
|
800
|
+
{
|
|
801
|
+
name: '自由排版',
|
|
802
|
+
key: 'freeTypesetting',
|
|
803
|
+
menuKeys: [],
|
|
804
|
+
html: ''
|
|
805
|
+
},
|
|
795
806
|
{
|
|
796
807
|
name: '公文版式',
|
|
797
808
|
key: 'officialDocumentFormat',
|
|
798
809
|
menuKeys: [],
|
|
799
|
-
html
|
|
810
|
+
html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p><p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p><p contenteditable="false" class="solid"></p><p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);line-height: 1;">请在此处输入标题</span></strong></p><p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-1" class="title drrvcvmj indent"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-2" class="title xxhnhuja indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p><p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
800
811
|
},
|
|
801
812
|
{
|
|
802
813
|
name: '新闻版式',
|
|
803
814
|
key: 'newsFormat',
|
|
804
815
|
menuKeys: [],
|
|
805
|
-
html
|
|
816
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入标题</span></strong></p><p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-1" class="title drrvcvmj indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-2" class="title xxhnhuja indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p><p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
806
817
|
},
|
|
807
818
|
{
|
|
808
819
|
name: '论文版式',
|
|
809
820
|
key: 'paperFormat',
|
|
810
821
|
menuKeys: [],
|
|
811
|
-
html
|
|
822
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入题目</span></strong></p><p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者</span></p><p data-signid="abstract" class="abstract abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p><p data-signid="keyword" class="keyword keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p><p></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-1" class="title drrvcvmj indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p><p data-signid="title-2" class="title xxhnhuja indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p><p class="indent indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p><p data-signid="splitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p><p></p><p data-signid="annotation" contenteditable="false" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">注释</span></strong></p><p data-signid="author" contenteditable="false" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px;font-weight: 700; color: rgba(0, 0, 0, 0.5);">(请在文中标识要注释的内容,此处将生成注释的序号而后需要作者填写注释内容)</span></p><p data-signid="a-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;">① 注释:是指解释字句的文字,也指用文字解释字句,可以是文字符号图片等多种形式。(当前文本只是示例展示,不会出现在保存的文本中。)</span></p><p data-signid="annotationSplitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p><p></p><p contenteditable="false" data-signId="reference" style="text-align: center;margin-bottom: 30px;"><span font-family: SimHei; style="font-weight: 700;font-size: 24px;">参考文献</span></p><p data-signid="author" contenteditable="false" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px;font-weight: 700; color: rgba(0, 0, 0, 0.5);">(请在文中标识要注释的内容,此处将生成注释的序号而后需要作者填写注释内容)</span></p><p data-signid="r-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;"> [1] 孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22. (当前文本只是示例展示,不会出现在保存的文本中。)</span></p><p data-signid="r-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;"> [2] 张和生.地质力学系统理论[D].太原:太原理工大学,1998. (当前文本只是示例展示,不会出现在保存的文本中。)</span></p><p data-signid="referenceSplitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p><p></p><p data-signid="ack" style="text-align: center"><strong><span style="font-size: 16px; color: rgb(0, 0, 0)">致谢</span></strong></p><p><span style="font-size: 14px; font-family: KaiTi; color: rgb(0, 0, 0)">致谢内容...</span></p><p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p><p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
812
823
|
}
|
|
813
824
|
]
|
|
814
825
|
}
|
|
@@ -953,12 +964,12 @@ export default {
|
|
|
953
964
|
this.editor?.commands.setContent(dataHtml)
|
|
954
965
|
if (this.readOnly) {
|
|
955
966
|
if (this.page) this.editableShow = true
|
|
956
|
-
setTimeout(() => {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}, 300)
|
|
967
|
+
// setTimeout(() => {
|
|
968
|
+
if (this.page) {
|
|
969
|
+
this.editableShow = false
|
|
970
|
+
this.readOnlyPage()
|
|
971
|
+
}
|
|
972
|
+
// }, 300)
|
|
962
973
|
}
|
|
963
974
|
setTimeout(() => {
|
|
964
975
|
this.init = true
|
|
@@ -1269,41 +1280,67 @@ export default {
|
|
|
1269
1280
|
})
|
|
1270
1281
|
},
|
|
1271
1282
|
//修改分割线类型
|
|
1272
|
-
changeLineType(){
|
|
1273
|
-
if(this.lineType==='solid'){
|
|
1274
|
-
let html = `${this.selection()===1?'<p></p>':''}<p contenteditable="false" class="solid"></p><p></p>`
|
|
1283
|
+
changeLineType() {
|
|
1284
|
+
if (this.lineType === 'solid') {
|
|
1285
|
+
let html = `${this.selection() === 1 ? '<p></p>' : ''}<p contenteditable="false" class="solid"></p><p></p>`
|
|
1275
1286
|
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
1276
1287
|
}
|
|
1277
|
-
if(this.lineType==='dashed'){
|
|
1278
|
-
let html = `${this.selection()===1?'<p></p>':''}<p contenteditable="false" class="dashed"></p><p></p>`
|
|
1288
|
+
if (this.lineType === 'dashed') {
|
|
1289
|
+
let html = `${this.selection() === 1 ? '<p></p>' : ''}<p contenteditable="false" class="dashed"></p><p></p>`
|
|
1279
1290
|
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
1280
1291
|
}
|
|
1281
|
-
if(this.lineType==='double'){
|
|
1282
|
-
let html = `${this.selection()===1?'<p></p>':''}<p contenteditable="false" class="double"></p><p></p>`
|
|
1292
|
+
if (this.lineType === 'double') {
|
|
1293
|
+
let html = `${this.selection() === 1 ? '<p></p>' : ''}<p contenteditable="false" class="double"></p><p></p>`
|
|
1283
1294
|
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
1284
1295
|
}
|
|
1285
1296
|
this.isShowHorizontalLine = false
|
|
1286
1297
|
},
|
|
1287
1298
|
//修改模板类型
|
|
1288
|
-
async changeTemplateType(){
|
|
1299
|
+
async changeTemplateType() {
|
|
1289
1300
|
await Message(
|
|
1290
1301
|
{type: 'text', promptContent: '切换版式后,已编辑的内容将被清空且无法保存,是否确认切换版式?'}).then(() => {
|
|
1302
|
+
// 自由排版
|
|
1303
|
+
if (this.templateType === 'freeTypesetting') {
|
|
1304
|
+
const html = this.switchingFormat.filter(item => item.key === this.templateType)[0].html
|
|
1305
|
+
this.editor.chain().setContent(html).run()
|
|
1306
|
+
this.toolbar = [
|
|
1307
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
|
|
1308
|
+
'outlineMenu', 'alignmentMode', 'titleMenu',
|
|
1309
|
+
'textMenu', 'color', 'interposition']
|
|
1310
|
+
this.organizeButton()
|
|
1311
|
+
}
|
|
1291
1312
|
// 公文版式
|
|
1292
1313
|
if (this.templateType === 'officialDocumentFormat') {
|
|
1293
1314
|
const html = this.switchingFormat.filter(item => item.key === this.templateType)[0].html
|
|
1294
1315
|
this.editor.chain().setContent(html).run()
|
|
1316
|
+
this.toolbar = [
|
|
1317
|
+
'switchingFormat', 'signMenu', 'pageMargin','redMenu', 'firstLevelHeading',
|
|
1318
|
+
'secondaryHeading', 'paragraphBody', 'paragraphMenu', 'alignmentMode',
|
|
1319
|
+
'titleMenu', 'color', 'interposition']
|
|
1320
|
+
this.organizeButton()
|
|
1295
1321
|
}
|
|
1296
1322
|
// 新闻版式
|
|
1297
1323
|
if (this.templateType === 'newsFormat') {
|
|
1298
1324
|
const html = this.switchingFormat.filter(item => item.key === this.templateType)[0].html
|
|
1299
1325
|
this.editor.chain().setContent(html).run()
|
|
1326
|
+
this.toolbar = [
|
|
1327
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'firstLevelHeading',
|
|
1328
|
+
'secondaryHeading', 'paragraphBody', 'paragraphMenu', 'alignmentMode',
|
|
1329
|
+
'titleMenu', 'color', 'interposition']
|
|
1330
|
+
this.organizeButton()
|
|
1300
1331
|
}
|
|
1301
1332
|
// 论文版式
|
|
1302
1333
|
if (this.templateType === 'paperFormat') {
|
|
1303
1334
|
const html = this.switchingFormat.filter(item => item.key === this.templateType)[0].html
|
|
1304
1335
|
this.editor.chain().setContent(html).run()
|
|
1336
|
+
this.toolbar = [
|
|
1337
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'firstLevelHeading',
|
|
1338
|
+
'secondaryHeading', 'paragraphBody', 'ackMenu', 'paragraphMenu', 'alignmentMode',
|
|
1339
|
+
'titleMenu', 'color', 'interposition']
|
|
1340
|
+
this.organizeButton()
|
|
1305
1341
|
}
|
|
1306
1342
|
this.isShowSwitchingFormat = false
|
|
1343
|
+
this.interpositionData = []
|
|
1307
1344
|
}).catch((err) => {
|
|
1308
1345
|
console.log('取消', err)
|
|
1309
1346
|
})
|
|
@@ -1918,9 +1955,9 @@ export default {
|
|
|
1918
1955
|
})
|
|
1919
1956
|
},
|
|
1920
1957
|
readOnlyPage() { // 只读分页
|
|
1921
|
-
this
|
|
1922
|
-
|
|
1923
|
-
|
|
1958
|
+
this.$nextTick(() => {
|
|
1959
|
+
this.htmlArr = []
|
|
1960
|
+
const data = document.querySelectorAll('.editing-cont')[0].childNodes[0].childNodes
|
|
1924
1961
|
this.wit = document.getElementsByClassName('editor-content')[0].offsetWidth + 20
|
|
1925
1962
|
if (this.wit > 900) this.wit = 900
|
|
1926
1963
|
let max = this.wit * 1.6 - 46
|
|
@@ -2004,7 +2041,7 @@ export default {
|
|
|
2004
2041
|
pHeight = end.size
|
|
2005
2042
|
} else {
|
|
2006
2043
|
pHeight += text
|
|
2007
|
-
if(data[i].dataset?.signid !== 'splitLine'&&data[i].dataset?.signid !== 'referenceSplitLine')html += data[i].outerHTML
|
|
2044
|
+
if (data[i].dataset?.signid !== 'splitLine' && data[i].dataset?.signid !== 'referenceSplitLine') html += data[i].outerHTML
|
|
2008
2045
|
}
|
|
2009
2046
|
if (i === data.length - 1) {
|
|
2010
2047
|
this.htmlArr.push(html)
|
|
@@ -2013,11 +2050,11 @@ export default {
|
|
|
2013
2050
|
break
|
|
2014
2051
|
}
|
|
2015
2052
|
}
|
|
2053
|
+
// 绑定点击事件
|
|
2054
|
+
setTimeout(() => {
|
|
2055
|
+
this.documentClick()
|
|
2056
|
+
}, 500)
|
|
2016
2057
|
})
|
|
2017
|
-
// 绑定点击事件
|
|
2018
|
-
setTimeout(() => {
|
|
2019
|
-
this.documentClick()
|
|
2020
|
-
}, 500)
|
|
2021
2058
|
},
|
|
2022
2059
|
documentClick() {
|
|
2023
2060
|
const p = document.getElementsByClassName('mu')
|
|
@@ -2189,6 +2226,7 @@ export default {
|
|
|
2189
2226
|
return width * fontSize / 10;
|
|
2190
2227
|
},
|
|
2191
2228
|
confirm() {
|
|
2229
|
+
this.delGiveExample()
|
|
2192
2230
|
let directoryJson = html2json(this.editor.getHTML()).child
|
|
2193
2231
|
let editorHtml = this.editor.getHTML()
|
|
2194
2232
|
let editorJson = this.editor.getJSON()
|
|
@@ -2212,6 +2250,7 @@ export default {
|
|
|
2212
2250
|
this.$emit('confirm', data)
|
|
2213
2251
|
},
|
|
2214
2252
|
getConfirm() {
|
|
2253
|
+
this.delGiveExample()
|
|
2215
2254
|
let directoryJson = html2json(this.editor.getHTML()).child
|
|
2216
2255
|
let editorHtml = this.editor.getHTML()
|
|
2217
2256
|
let editorJson = this.editor.getJSON()
|
|
@@ -2615,7 +2654,7 @@ export default {
|
|
|
2615
2654
|
},
|
|
2616
2655
|
|
|
2617
2656
|
async butTap(data, key, childKey) {
|
|
2618
|
-
//
|
|
2657
|
+
// 切换版式
|
|
2619
2658
|
if (data.key === 'switchingFormat') {
|
|
2620
2659
|
this.isShowSwitchingFormat = true
|
|
2621
2660
|
}
|
|
@@ -2747,8 +2786,8 @@ export default {
|
|
|
2747
2786
|
}
|
|
2748
2787
|
const num = this.upSort(this.editor, 'paragraph')
|
|
2749
2788
|
if (r === -1) {
|
|
2750
|
-
this.editor.chain().focus().insertContentAt(num.len-6, html[0]).run()
|
|
2751
|
-
this.editor.chain().focus().insertContentAt(num.len-2, html[1]).run()
|
|
2789
|
+
this.editor.chain().focus().insertContentAt(num.len - 6, html[0]).run()
|
|
2790
|
+
this.editor.chain().focus().insertContentAt(num.len - 2, html[1]).run()
|
|
2752
2791
|
}
|
|
2753
2792
|
return
|
|
2754
2793
|
}
|
|
@@ -2838,6 +2877,78 @@ export default {
|
|
|
2838
2877
|
}*/
|
|
2839
2878
|
}
|
|
2840
2879
|
|
|
2880
|
+
// 标志
|
|
2881
|
+
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
2882
|
+
// 红头文件
|
|
2883
|
+
if (data.key === 'redMenu') {
|
|
2884
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2885
|
+
// console.log('menusHtml',menusHtml)
|
|
2886
|
+
// const html = menusHtml.filter(item => item.key == key.key)[0].html
|
|
2887
|
+
const r = await this.signIdData('red')
|
|
2888
|
+
if (r === -1) {
|
|
2889
|
+
this.editor.chain().focus().insertContentAt(0, html).run()
|
|
2890
|
+
this.editor.commands.setHorizontalRule() // 添加分割线
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
// 一级标题
|
|
2894
|
+
if (data.key === 'firstLevelHeading') {
|
|
2895
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2896
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
2897
|
+
}
|
|
2898
|
+
// 二级标题
|
|
2899
|
+
if (data.key === 'secondaryHeading') {
|
|
2900
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2901
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
2902
|
+
}
|
|
2903
|
+
// 正文
|
|
2904
|
+
if (data.key === 'paragraphBody') {
|
|
2905
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2906
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
2907
|
+
}
|
|
2908
|
+
// 致谢
|
|
2909
|
+
if (data.key === 'ackMenu') {
|
|
2910
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2911
|
+
const last = this.editor.state.selection.$anchor.path[0].content.size
|
|
2912
|
+
const r = await this.signIdData('ack')//致谢
|
|
2913
|
+
const n = await this.signIdData('paragraph')//落款
|
|
2914
|
+
const b = await this.signIdData('enclosure')//附件
|
|
2915
|
+
if (b === -1) {
|
|
2916
|
+
if (n === -1) {
|
|
2917
|
+
if (r === -1) {
|
|
2918
|
+
this.editor.chain().focus().insertContentAt(last, html[0]).run()
|
|
2919
|
+
this.editor.chain().focus().insertContentAt(last + 3, html[1]).run()
|
|
2920
|
+
}
|
|
2921
|
+
return
|
|
2922
|
+
}
|
|
2923
|
+
const num = this.upSort(this.editor, 'paragraph')
|
|
2924
|
+
if (r === -1) {
|
|
2925
|
+
this.editor.chain().focus().insertContentAt(num.len - 10, html[0]).run()
|
|
2926
|
+
this.editor.chain().focus().insertContentAt(num.len - 6, html[1]).run()
|
|
2927
|
+
}
|
|
2928
|
+
return
|
|
2929
|
+
}
|
|
2930
|
+
const num = this.selectionPath('enclosure')
|
|
2931
|
+
if (r === -1) {
|
|
2932
|
+
this.editor.chain().focus().insertContentAt(num - 7, html[0]).run()
|
|
2933
|
+
const ackNum = this.selectionPath('ack')
|
|
2934
|
+
this.editor.chain().focus().insertContentAt(ackNum, html[1]).run()
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
// 添加落款
|
|
2938
|
+
if (data.key === 'paragraphMenu') {
|
|
2939
|
+
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
2940
|
+
const last = this.editor.state.selection.$anchor.path[0].content.size
|
|
2941
|
+
const r = await this.signIdData('paragraph')//落款
|
|
2942
|
+
const n = await this.signIdData('enclosure')//附件
|
|
2943
|
+
if (n === -1) {
|
|
2944
|
+
if (r === -1) this.editor.chain().focus().insertContentAt(last, html).run()
|
|
2945
|
+
return
|
|
2946
|
+
}
|
|
2947
|
+
const num = this.selectionPath('enclosure')
|
|
2948
|
+
if (r === -1) this.editor.chain().focus().insertContentAt(num - 7, html).run()
|
|
2949
|
+
return
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2841
2952
|
if (data.key === 'textMenu' && key === 0 || data.key === 'titleMenu' && key === 0) return
|
|
2842
2953
|
// 边距
|
|
2843
2954
|
if (data.key === 'pageMargin') {
|
|
@@ -2970,11 +3081,11 @@ export default {
|
|
|
2970
3081
|
}
|
|
2971
3082
|
// 添加注释
|
|
2972
3083
|
if (key.key === 'taggingMenu') {
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3084
|
+
this.tipTitle = window.getSelection().toString()
|
|
3085
|
+
if (this.tipTitle.length === 0) {
|
|
3086
|
+
await Message({type: 'text', promptContent: '请选中需要注释的文字'})
|
|
3087
|
+
return
|
|
3088
|
+
}
|
|
2978
3089
|
this.exegesisType = "add"
|
|
2979
3090
|
this.titlePopup = '注释'
|
|
2980
3091
|
this.isShowPopup = true
|
|
@@ -3628,15 +3739,22 @@ export default {
|
|
|
3628
3739
|
}
|
|
3629
3740
|
},
|
|
3630
3741
|
|
|
3631
|
-
async addAnnotationMenu(
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3742
|
+
async addAnnotationMenu() {
|
|
3743
|
+
this.interpositionData.forEach((item,index)=>{
|
|
3744
|
+
if(item.type!=='taggingMenu') return
|
|
3745
|
+
const t = this.signIdData('annotation')
|
|
3746
|
+
const b = this.signIdData('annotationSplitLine') // 判断是否有分页线
|
|
3747
|
+
const html = `<p contenteditable="false" data-signId="annotation" style="text-align: center;margin-bottom: 30px;"><span style="font-weight: 700;font-size: 16px;">注释:</span></p>`
|
|
3748
|
+
const html2 = `<p contenteditable="false" class="text" data-signId="r-${index+1}"><span style="font-family: FangSong;font-size: 12px;line-height25px"><span class="annotation-num">${index+1}</span> ${item.exegesis}: ${item.text}</span></p>`
|
|
3749
|
+
const last = this.editor.state.selection.$anchor.path[0].content.size
|
|
3750
|
+
if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
|
|
3751
|
+
let last1 = this.editor.state.selection.$anchor.path[0].content.size
|
|
3752
|
+
if (b === -1) {
|
|
3753
|
+
this.editor.chain().focus().insertContentAt(last1, html2).run()
|
|
3754
|
+
} else {
|
|
3755
|
+
this.editor.chain().focus().insertContentAt(this.selectionPath('annotationSplitLine') - 22, html2).run()
|
|
3756
|
+
}
|
|
3757
|
+
})
|
|
3640
3758
|
},
|
|
3641
3759
|
|
|
3642
3760
|
async addReferenceMenu(data) {
|
|
@@ -3645,16 +3763,20 @@ export default {
|
|
|
3645
3763
|
const html = `<p contenteditable="false" data-signId="reference" style="text-align: center;margin-bottom: 30px;"><span style="font-weight: 700;font-size: 16px;">参考文献:</span></p>`
|
|
3646
3764
|
const html2 = `<p contenteditable="false" class="text" data-signId="r-${data.number}"><span style="font-family: FangSong;font-size: 12px;line-height25px">${data.text}</span></p>`
|
|
3647
3765
|
const last = this.editor.state.selection.$anchor.path[0].content.size
|
|
3648
|
-
|
|
3649
|
-
|
|
3766
|
+
if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
|
|
3767
|
+
let last1 = this.editor.state.selection.$anchor.path[0].content.size
|
|
3650
3768
|
if (b === -1) {
|
|
3651
|
-
|
|
3769
|
+
this.editor.chain().focus().insertContentAt(last1, html2).run()
|
|
3652
3770
|
} else {
|
|
3653
|
-
|
|
3771
|
+
this.editor.chain().focus().insertContentAt(this.selectionPath('referenceSplitLine') - 22, html2).run()
|
|
3654
3772
|
}
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3773
|
+
},
|
|
3774
|
+
// 删除举例说明
|
|
3775
|
+
delGiveExample(){
|
|
3776
|
+
const json = this.editor.getJSON()
|
|
3777
|
+
let jsonData = json.content.filter(item => !(/r-/.test(item.attrs.signId)) && !(/a-/.test(item.attrs.signId)))
|
|
3778
|
+
this.editor?.commands.setContent(jsonData)
|
|
3779
|
+
this.addAnnotationMenu()
|
|
3658
3780
|
},
|
|
3659
3781
|
|
|
3660
3782
|
delReferenceMenu(data) {
|
|
@@ -3808,7 +3930,7 @@ label {
|
|
|
3808
3930
|
}
|
|
3809
3931
|
|
|
3810
3932
|
:deep(.custom-link) {
|
|
3811
|
-
color: #
|
|
3933
|
+
color: #000;
|
|
3812
3934
|
text-decoration: none;
|
|
3813
3935
|
}
|
|
3814
3936
|
|
|
@@ -3901,7 +4023,7 @@ label {
|
|
|
3901
4023
|
}
|
|
3902
4024
|
|
|
3903
4025
|
:deep(.custom-link) {
|
|
3904
|
-
margin: 10px 0;
|
|
4026
|
+
//margin: 10px 0;
|
|
3905
4027
|
}
|
|
3906
4028
|
|
|
3907
4029
|
:deep(.mu) {
|
|
@@ -4515,25 +4637,25 @@ li {
|
|
|
4515
4637
|
color: rgba(0, 0, 0, 1);
|
|
4516
4638
|
}
|
|
4517
4639
|
|
|
4518
|
-
:deep(.solid){
|
|
4640
|
+
:deep(.solid) {
|
|
4519
4641
|
height: 0;
|
|
4520
|
-
border-bottom:1px solid #000;
|
|
4642
|
+
border-bottom: 1px solid #000;
|
|
4521
4643
|
}
|
|
4522
4644
|
|
|
4523
|
-
:deep(.dashed){
|
|
4645
|
+
:deep(.dashed) {
|
|
4524
4646
|
height: 0;
|
|
4525
|
-
border-bottom:1px dashed #000;
|
|
4647
|
+
border-bottom: 1px dashed #000;
|
|
4526
4648
|
}
|
|
4527
4649
|
|
|
4528
|
-
:deep(.double){
|
|
4650
|
+
:deep(.double) {
|
|
4529
4651
|
height: 0;
|
|
4530
|
-
border-style:double;
|
|
4531
|
-
border-top:none;
|
|
4652
|
+
border-style: double;
|
|
4653
|
+
border-top: none;
|
|
4532
4654
|
border-left: none;
|
|
4533
4655
|
border-right: none;
|
|
4534
4656
|
}
|
|
4535
4657
|
|
|
4536
|
-
:deep(.paging-line){
|
|
4658
|
+
:deep(.paging-line) {
|
|
4537
4659
|
width: 100%;
|
|
4538
4660
|
font-size: 12px;
|
|
4539
4661
|
font-weight: 400;
|
|
@@ -4546,16 +4668,16 @@ li {
|
|
|
4546
4668
|
justify-content: space-around;
|
|
4547
4669
|
align-items: center;
|
|
4548
4670
|
}
|
|
4549
|
-
|
|
4550
|
-
|
|
4671
|
+
|
|
4672
|
+
:deep(.paging-line)::before, :deep(.paging-line)::after {
|
|
4673
|
+
content: '';
|
|
4551
4674
|
flex: 1;
|
|
4552
4675
|
height: 0px;
|
|
4553
4676
|
border-bottom: 1px dashed rgba(204, 204, 204, 1);
|
|
4554
4677
|
}
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
:
|
|
4559
|
-
//margin-left: 0.25rem;
|
|
4678
|
+
|
|
4679
|
+
:deep(.annotation-num) {
|
|
4680
|
+
border:1px solid #000;
|
|
4681
|
+
border-radius: 50%;
|
|
4560
4682
|
}
|
|
4561
4683
|
</style>
|