zydx-plus 1.33.387 → 1.33.388
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/editor.vue +144 -6
- package/src/components/editor/src/extend/insertHorizontalLine.js +2 -2
- package/src/components/editor/src/image/center.png +0 -0
- package/src/components/editor/src/image/left.png +0 -0
- package/src/components/editor/src/image/right.png +0 -0
- package/src/components/editor/src/image-size.js +23 -0
- package/src/components/flip/src/flip.vue +16 -13
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -83,6 +83,41 @@
|
|
|
83
83
|
</div>
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
|
+
<!--图片的浮动菜单-->
|
|
87
|
+
<div class="bubble-menu-img">
|
|
88
|
+
<template v-if="editor">
|
|
89
|
+
<div class="line">
|
|
90
|
+
<div class="label">图片缩放:</div>
|
|
91
|
+
<div class="percent">
|
|
92
|
+
<div class="symbol">%</div>
|
|
93
|
+
<input type="number" v-model="imgSizeVal" @input="changePercent" onfocus="this.select()" placeholder="10-100">
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="line">
|
|
97
|
+
<div class="label">图片位置:</div>
|
|
98
|
+
<div class="alignmentMode">
|
|
99
|
+
<div @click="changeAlign('left')">
|
|
100
|
+
<div class="imgBgc" :class="{imgBgcAction: editor.isActive({ textAlign: 'left' })}">
|
|
101
|
+
<img :src="alignmentModeLeft">
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="segmentation"></div>
|
|
105
|
+
<div @click="changeAlign('center')">
|
|
106
|
+
<div class="imgBgc" :class="{imgBgcAction: editor.isActive({ textAlign: 'center' })}">
|
|
107
|
+
<img :src="alignmentModeCenter">
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="segmentation"></div>
|
|
111
|
+
<div @click="changeAlign('right')">
|
|
112
|
+
<div class="imgBgc" :class="{imgBgcAction: editor.isActive({ textAlign: 'right' })}">
|
|
113
|
+
<img :src="alignmentModeRight">
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
86
121
|
<div v-if="!readOnly && toolbar.length > 0" class="complete">
|
|
87
122
|
<button v-if="butShow" class="but" @click="confirm">完成</button>
|
|
88
123
|
</div>
|
|
@@ -182,13 +217,11 @@
|
|
|
182
217
|
<div class="p-popup-title">缩进设置</div>
|
|
183
218
|
<div class="p-popup-retraction">
|
|
184
219
|
<div class="p-popup-setting">
|
|
185
|
-
<div class="name">左侧缩进</div
|
|
186
|
-
:
|
|
220
|
+
<div class="name">左侧缩进</div>:
|
|
187
221
|
<input v-model="paragraph.left" min="0" type="number" @input="checkNum"/>
|
|
188
222
|
<p>px</p></div>
|
|
189
223
|
<div class="p-popup-setting">
|
|
190
|
-
<div class="name">右侧缩进</div
|
|
191
|
-
:
|
|
224
|
+
<div class="name">右侧缩进</div>:
|
|
192
225
|
<input v-model="paragraph.right" min="0" type="number" @input="checkNum"/>
|
|
193
226
|
<p>px</p></div>
|
|
194
227
|
</div>
|
|
@@ -338,7 +371,6 @@
|
|
|
338
371
|
<div class="page-margin-title"> 切换版式</div>
|
|
339
372
|
<div class="page-line-select">
|
|
340
373
|
<div class="name">选择版式:</div>
|
|
341
|
-
:
|
|
342
374
|
<zydx-select v-model:value="templateType" :options="templateOptions"></zydx-select>
|
|
343
375
|
</div>
|
|
344
376
|
</div>
|
|
@@ -616,6 +648,10 @@ import MarginNarrow from "../src/margin-narrow.vue";
|
|
|
616
648
|
import MarginStandard from "../src/margin-standard.vue";
|
|
617
649
|
import MarginWide from "../src/margin-wide.vue";
|
|
618
650
|
import isSelect from "../src/isSelect.vue";
|
|
651
|
+
import {CustomImage} from "./image-size";
|
|
652
|
+
import alignmentModeCenter from './image/center.png'
|
|
653
|
+
import alignmentModeLeft from './image/left.png'
|
|
654
|
+
import alignmentModeRight from './image/right.png'
|
|
619
655
|
|
|
620
656
|
const img = require('./image/annotation.png')
|
|
621
657
|
export default {
|
|
@@ -821,7 +857,12 @@ export default {
|
|
|
821
857
|
menuKeys: [],
|
|
822
858
|
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>`
|
|
823
859
|
}
|
|
824
|
-
]
|
|
860
|
+
],
|
|
861
|
+
imgSizeVal: '',
|
|
862
|
+
imgSizeLock: true,
|
|
863
|
+
alignmentModeLeft: alignmentModeLeft,
|
|
864
|
+
alignmentModeCenter: alignmentModeCenter,
|
|
865
|
+
alignmentModeRight: alignmentModeRight,
|
|
825
866
|
}
|
|
826
867
|
},
|
|
827
868
|
props: {
|
|
@@ -1061,6 +1102,7 @@ export default {
|
|
|
1061
1102
|
titleId, // 标题id
|
|
1062
1103
|
lineHeightId,//行高
|
|
1063
1104
|
dataUrl,
|
|
1105
|
+
CustomImage,// 自定义图片大小
|
|
1064
1106
|
Superscript.configure({
|
|
1065
1107
|
HTMLAttributes: {
|
|
1066
1108
|
class: 'annotation',
|
|
@@ -1108,6 +1150,19 @@ export default {
|
|
|
1108
1150
|
}
|
|
1109
1151
|
},
|
|
1110
1152
|
}),
|
|
1153
|
+
BubbleMenu.configure({
|
|
1154
|
+
pluginKey: 'bubbleMenuImg',
|
|
1155
|
+
element: document.querySelector('.bubble-menu-img'),
|
|
1156
|
+
tippyOptions: { duration: 100 },
|
|
1157
|
+
shouldShow: ({editor, view, state, oldState, from, to}) => {
|
|
1158
|
+
if(editor.isActive('image')) {
|
|
1159
|
+
this.imgSizeVal = parseInt(this.editor.getAttributes('image').width)
|
|
1160
|
+
} else {
|
|
1161
|
+
this.imgSizeVal = ''
|
|
1162
|
+
}
|
|
1163
|
+
return editor.isActive('image')
|
|
1164
|
+
},
|
|
1165
|
+
}),
|
|
1111
1166
|
Link.configure({
|
|
1112
1167
|
openOnClick: false,
|
|
1113
1168
|
HTMLAttributes: {
|
|
@@ -1274,6 +1329,26 @@ export default {
|
|
|
1274
1329
|
},
|
|
1275
1330
|
emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee'],
|
|
1276
1331
|
methods: {
|
|
1332
|
+
changeAlign(tag) {
|
|
1333
|
+
// 图片对齐方式
|
|
1334
|
+
this.editor.chain().setTextAlign(tag).run()
|
|
1335
|
+
},
|
|
1336
|
+
changePercent(e) {
|
|
1337
|
+
// 改变图片百分比
|
|
1338
|
+
if(parseInt(e.target.value) > 100) {
|
|
1339
|
+
this.imgSizeVal = 100
|
|
1340
|
+
this.editor.chain().setImageWidth('100%').focus().run()
|
|
1341
|
+
} else if(parseInt(e.target.value) < 10) {
|
|
1342
|
+
} else {
|
|
1343
|
+
if(this.imgSizeLock) {
|
|
1344
|
+
this.imgSizeLock = false
|
|
1345
|
+
setTimeout(() => {
|
|
1346
|
+
this.editor.chain().setImageWidth(e.target.value + '%').focus().run()
|
|
1347
|
+
this.imgSizeLock = true
|
|
1348
|
+
}, 500)
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1277
1352
|
selectMargin(selectItem) {
|
|
1278
1353
|
this.pageMarginSvg.forEach(item => {
|
|
1279
1354
|
item.isSelect = item.title === selectItem.title;
|
|
@@ -4680,4 +4755,67 @@ li {
|
|
|
4680
4755
|
border:1px solid #000;
|
|
4681
4756
|
border-radius: 50%;
|
|
4682
4757
|
}
|
|
4758
|
+
.bubble-menu-img {
|
|
4759
|
+
position: relative;
|
|
4760
|
+
padding: 15px;
|
|
4761
|
+
background-color: #fff;
|
|
4762
|
+
border-radius: 5px;
|
|
4763
|
+
box-shadow: 0 1px 6px #d2d2d2;
|
|
4764
|
+
}
|
|
4765
|
+
.line {
|
|
4766
|
+
display: flex;
|
|
4767
|
+
align-items: center;
|
|
4768
|
+
padding-bottom: 10px;
|
|
4769
|
+
}
|
|
4770
|
+
.line:last-child {
|
|
4771
|
+
padding-bottom: 0
|
|
4772
|
+
}
|
|
4773
|
+
.percent {
|
|
4774
|
+
position: relative;
|
|
4775
|
+
}
|
|
4776
|
+
.percent input{
|
|
4777
|
+
border-radius: 4px;
|
|
4778
|
+
width: 68px;
|
|
4779
|
+
}
|
|
4780
|
+
.percent input::-webkit-outer-spin-button,
|
|
4781
|
+
.percent input::-webkit-inner-spin-button {
|
|
4782
|
+
-webkit-appearance: none !important;
|
|
4783
|
+
}
|
|
4784
|
+
.percent input[type='number']{
|
|
4785
|
+
-moz-appearance: textfield;
|
|
4786
|
+
box-shadow: none;
|
|
4787
|
+
border: 1px solid #8c939d;
|
|
4788
|
+
padding: 5px 15px 5px 5px;
|
|
4789
|
+
}
|
|
4790
|
+
.symbol {
|
|
4791
|
+
position: absolute;
|
|
4792
|
+
right: 5px;
|
|
4793
|
+
top: 5px
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4796
|
+
.alignmentMode {
|
|
4797
|
+
display: flex;
|
|
4798
|
+
justify-content: center;
|
|
4799
|
+
align-items: center;
|
|
4800
|
+
}
|
|
4801
|
+
.segmentation {
|
|
4802
|
+
height: 13px;
|
|
4803
|
+
width: 1px;
|
|
4804
|
+
margin: 0 5px;
|
|
4805
|
+
background-color: #565656;
|
|
4806
|
+
}
|
|
4807
|
+
.imgBgc {
|
|
4808
|
+
border-radius: 3px;
|
|
4809
|
+
width: 20px;
|
|
4810
|
+
height: 20px;
|
|
4811
|
+
background-color: #CCCCCC;
|
|
4812
|
+
}
|
|
4813
|
+
.imgBgcAction {
|
|
4814
|
+
background-color: #2A82E4;
|
|
4815
|
+
}
|
|
4816
|
+
.imgBgc > img {
|
|
4817
|
+
padding: 1px;
|
|
4818
|
+
width: 100%;
|
|
4819
|
+
height: 100%;
|
|
4820
|
+
}
|
|
4683
4821
|
</style>
|
|
@@ -33,12 +33,12 @@ export const borderBottom = Extension.create({
|
|
|
33
33
|
|
|
34
34
|
addCommands() {
|
|
35
35
|
return {
|
|
36
|
-
|
|
36
|
+
setBorder: borderBottom => ({ chain }) => {
|
|
37
37
|
return chain()
|
|
38
38
|
.setNode('paragraph', { borderBottom })
|
|
39
39
|
.run()
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
unsetBorder: () => ({ chain }) => {
|
|
42
42
|
return chain()
|
|
43
43
|
.setNode('paragraph', { borderBottom: null })
|
|
44
44
|
.run()
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Image from '@tiptap/extension-image'
|
|
2
|
+
|
|
3
|
+
export const CustomImage = Image.extend({
|
|
4
|
+
addCommands() {
|
|
5
|
+
return {
|
|
6
|
+
setImageWidth: width => ({commands}) => {
|
|
7
|
+
return commands.updateAttributes('image', {width: width})
|
|
8
|
+
},
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
addAttributes() {
|
|
12
|
+
return {
|
|
13
|
+
width: {
|
|
14
|
+
default: '',
|
|
15
|
+
renderHTML: attributes => {
|
|
16
|
+
return {
|
|
17
|
+
style: `width: ${attributes.width}`,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
})
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<div class="docView">
|
|
3
3
|
<div class="full-screen">
|
|
4
4
|
<div class="full-screen-img" @click.stop="fullScreen">
|
|
5
|
-
<div class="full-screen-title" style="" v-if="showText">全屏查看</div
|
|
6
|
-
<img @mouseover="showText=true" @mouseout="showText=false" src="../img/full-screen.png" alt="">
|
|
5
|
+
<!-- <div class="full-screen-title" style="" v-if="showText">全屏查看</div>-->
|
|
6
|
+
<img @mouseover="showText=true" @mouseout="showText=false" src="../img/full-screen.png" alt="" title="全屏查看">
|
|
7
7
|
</div>
|
|
8
|
-
<div class="full-screen-img" v-if="doublePage" @click.stop="
|
|
9
|
-
<div class="full-screen-title" style="" v-if="showMultiText">多页查看</div
|
|
10
|
-
<img @mouseover="showMultiText=true" @mouseout="showMultiText=false" src="../img/multi-page.png" alt="">
|
|
8
|
+
<div class="full-screen-img" v-if="doublePage" @click.stop="changeView">
|
|
9
|
+
<!-- <div class="full-screen-title" style="" v-if="showMultiText">多页查看</div>-->
|
|
10
|
+
<img @mouseover="showMultiText=true" @mouseout="showMultiText=false" src="../img/multi-page.png" alt="" title="多页查看">
|
|
11
11
|
</div>
|
|
12
|
-
<div class="full-screen-img" v-else @click.stop="
|
|
13
|
-
<div class="full-screen-title" style="" v-if="showSingleText">单页查看</div
|
|
14
|
-
<img @mouseover="showSingleText=true" @mouseout="showSingleText=false" src="../img/single-page.png" alt="">
|
|
12
|
+
<div class="full-screen-img" v-else @click.stop="changeView">
|
|
13
|
+
<!-- <div class="full-screen-title" style="" v-if="showSingleText">单页查看</div>-->
|
|
14
|
+
<img @mouseover="showSingleText=true" @mouseout="showSingleText=false" src="../img/single-page.png" alt="" title="单页查看">
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
<div>
|
|
@@ -123,7 +123,7 @@ export default {
|
|
|
123
123
|
flipRights: false,
|
|
124
124
|
flipLefts: false,
|
|
125
125
|
oneIndex: 'right',
|
|
126
|
-
scales: 1.
|
|
126
|
+
scales: 1.35,
|
|
127
127
|
timer: null,
|
|
128
128
|
resultImg: '',
|
|
129
129
|
startX: 0,
|
|
@@ -287,6 +287,9 @@ export default {
|
|
|
287
287
|
window.removeEventListener('keydown', this.handleKeyEvent)
|
|
288
288
|
},
|
|
289
289
|
methods: {
|
|
290
|
+
changeView(){
|
|
291
|
+
this.doublePage=! this.doublePage
|
|
292
|
+
},
|
|
290
293
|
fullScreen(){
|
|
291
294
|
window.open(this.source)
|
|
292
295
|
},
|
|
@@ -1195,7 +1198,7 @@ export default {
|
|
|
1195
1198
|
let canvas2 = document.getElementById(`${item.id}2`)
|
|
1196
1199
|
item.ctx = canvas.getContext('2d');
|
|
1197
1200
|
item.ctx2 = canvas2.getContext('2d');
|
|
1198
|
-
let viewport = page.getViewport({scale: that.scales/2
|
|
1201
|
+
let viewport = page.getViewport({scale: that.scales/2})
|
|
1199
1202
|
const sc = viewport.width / viewport.height
|
|
1200
1203
|
const wid = that.$refs[`wrap-${item.id}`][0].offsetWidth-15
|
|
1201
1204
|
const hei = wid / sc
|
|
@@ -1304,7 +1307,7 @@ export default {
|
|
|
1304
1307
|
display: inline-block;
|
|
1305
1308
|
margin: 0 auto;
|
|
1306
1309
|
position: relative;
|
|
1307
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.
|
|
1310
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
|
|
1308
1311
|
//cursor: none;
|
|
1309
1312
|
}
|
|
1310
1313
|
|
|
@@ -1467,7 +1470,7 @@ div{
|
|
|
1467
1470
|
.full-screen{
|
|
1468
1471
|
position: absolute;
|
|
1469
1472
|
top: 20px;
|
|
1470
|
-
right: -
|
|
1473
|
+
right: -20px;
|
|
1471
1474
|
z-index: 100;
|
|
1472
1475
|
}
|
|
1473
1476
|
|
|
@@ -1497,6 +1500,6 @@ div{
|
|
|
1497
1500
|
.full-screen-img>img{
|
|
1498
1501
|
width: 20px;
|
|
1499
1502
|
height: 20px;
|
|
1500
|
-
margin-left: 5px;
|
|
1503
|
+
//margin-left: 5px;
|
|
1501
1504
|
}
|
|
1502
1505
|
</style>
|