zydx-plus 1.30.161 → 1.30.163
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 +8 -5
- package/src/components/dragPopup/src/dragPopup.vue +9 -7
- package/src/components/editor/src/butJson.js +143 -0
- package/src/components/editor/src/editor.vue +562 -151
- package/src/components/editor/src/extend/contenteditable.js +33 -0
- package/src/components/editor/src/extend/font-size.js +49 -0
- package/src/components/editor/src/extend/sign-id.js +33 -0
- package/src/components/editor2/src/editor.vue +15 -3
- package/src/components/editor2/src/sign-id.js +33 -0
- package/src/components/treeList/src/treeList.vue +5 -1
- package/src/index.js +1 -1
- package/src/components/editor/src/menu.js +0 -595
- package/src/components/editor/src/node.js +0 -122
- package/src/components/editor/src/wangeditor5-for-vue3/core/editable.js +0 -334
- package/src/components/editor/src/wangeditor5-for-vue3/core/editor.js +0 -53
- package/src/components/editor/src/wangeditor5-for-vue3/core/hooks.js +0 -134
- package/src/components/editor/src/wangeditor5-for-vue3/core/toolbar.js +0 -79
- package/src/components/editor/src/wangeditor5-for-vue3/core/types.js +0 -2
- package/src/components/editor/src/wangeditor5-for-vue3/core/utils.js +0 -65
- package/src/components/editor/src/wangeditor5-for-vue3/index.js +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zydx-plus",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.163",
|
|
4
4
|
"description": "Vue.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,19 +22,22 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"vue-draggable-next": "^2.1.1",
|
|
24
24
|
"pdfjs-dist": "^2.0.943",
|
|
25
|
-
"@wangeditor/editor": "^5.1.23",
|
|
26
25
|
"snabbdom": "^3.5.1",
|
|
27
|
-
"@wangeditor/plugin-formula": "^1.0.11",
|
|
28
26
|
"katex": "^0.15.6",
|
|
29
27
|
"simple-mind-map": "^0.5.11",
|
|
30
28
|
"html2json": "^1.0.2",
|
|
31
29
|
"@tiptap/extension-image": "^2.0.3",
|
|
32
30
|
"@tiptap/starter-kit": "^2.0.3",
|
|
33
31
|
"@tiptap/vue-3": "^2.0.3",
|
|
34
|
-
"@tiptap/extension-
|
|
32
|
+
"@tiptap/extension-color": "^2.0.3",
|
|
33
|
+
"@tiptap/extension-font-family": "^2.0.3",
|
|
34
|
+
"@tiptap/extension-horizontal-rule": "^2.0.3",
|
|
35
|
+
"@tiptap/extension-paragraph": "^2.0.3",
|
|
35
36
|
"@tiptap/extension-placeholder": "^2.0.3",
|
|
37
|
+
"@tiptap/extension-superscript": "^2.0.3",
|
|
38
|
+
"@tiptap/extension-text-align": "^2.0.3",
|
|
36
39
|
"@tiptap/extension-text-style": "^2.0.3",
|
|
37
|
-
"@tiptap/extension-
|
|
40
|
+
"@tiptap/extension-link": "^2.0.3",
|
|
38
41
|
"@vue-office/docx": "^1.1.3",
|
|
39
42
|
"@vue-office/excel": "^1.1.3",
|
|
40
43
|
"fabric": "^5.3.0"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
<div class="drag-cont-slot">
|
|
16
16
|
<slot name="content"></slot>
|
|
17
17
|
</div>
|
|
18
|
-
<i class="down" v-if="dragStatus" @mousedown="footDown($event,'d')" @mouseup="footUp"></i>
|
|
19
|
-
<i class="in" v-if="dragStatus" @mousedown="footDown($event,'in')" @mouseup="footUp"></i>
|
|
20
|
-
<i class="right" v-if="dragStatus" @mousedown="footDown($event,'r')" @mouseup="footUp"></i>
|
|
18
|
+
<i class="drag-down" v-if="dragStatus" @mousedown="footDown($event,'d')" @mouseup="footUp"></i>
|
|
19
|
+
<i class="drag-in" v-if="dragStatus" @mousedown="footDown($event,'in')" @mouseup="footUp"></i>
|
|
20
|
+
<i class="drag-right" v-if="dragStatus" @mousedown="footDown($event,'r')" @mouseup="footUp"></i>
|
|
21
21
|
</div>
|
|
22
22
|
<div class="down-text" v-if="dragStatus">
|
|
23
23
|
<div class="down-text-cont">
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
},
|
|
99
99
|
computed: {
|
|
100
100
|
position() {
|
|
101
|
-
return `
|
|
101
|
+
return `transform: translate(${this.x}px, ${this.y}px);width:${this.footRightOffset}px;height:${this.footDownOffset}px;`;
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
emits: ['dragStatus','close'],
|
|
@@ -201,7 +201,7 @@ export default {
|
|
|
201
201
|
padding: 0 10px;
|
|
202
202
|
text-align: right;
|
|
203
203
|
}
|
|
204
|
-
.down{
|
|
204
|
+
.drag-down{
|
|
205
205
|
position: absolute;
|
|
206
206
|
bottom: -50px;
|
|
207
207
|
right: 20px;
|
|
@@ -212,7 +212,7 @@ export default {
|
|
|
212
212
|
cursor: ns-resize;
|
|
213
213
|
user-select: none;
|
|
214
214
|
}
|
|
215
|
-
.in{
|
|
215
|
+
.drag-in{
|
|
216
216
|
position: absolute;
|
|
217
217
|
bottom: -40px;
|
|
218
218
|
right: -20px;
|
|
@@ -223,7 +223,7 @@ export default {
|
|
|
223
223
|
cursor: nwse-resize;
|
|
224
224
|
user-select: none;
|
|
225
225
|
}
|
|
226
|
-
.right{
|
|
226
|
+
.drag-right{
|
|
227
227
|
position: absolute;
|
|
228
228
|
bottom: 0;
|
|
229
229
|
right: -20px;
|
|
@@ -272,6 +272,8 @@ export default {
|
|
|
272
272
|
}
|
|
273
273
|
.drag-pop {
|
|
274
274
|
position: fixed;
|
|
275
|
+
top: 0;
|
|
276
|
+
left: 0;
|
|
275
277
|
box-shadow: 0 0 3px 2px #ccc;
|
|
276
278
|
background-color: #fff;
|
|
277
279
|
border-radius: 3px;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
|
|
2
|
+
const num = {1: '①', 2: '②', 3: '③', 4: '④', 5: '⑤', 6: '⑥', 7: '⑦', 8: '⑧', 9: '⑨', 10: '⑩', 11: '⑪', 12: '⑫', 13: '⑬', 14: '⑭', 15: '⑮', 16: '⑯', 17: '⑰', 18: '⑱', 19: '⑲', 20: '⑳',}
|
|
3
|
+
|
|
4
|
+
export function butJson (editor,data) {
|
|
5
|
+
return {
|
|
6
|
+
signMenu: {
|
|
7
|
+
name: '添加标志',
|
|
8
|
+
key: 'signMenu',
|
|
9
|
+
menuKeys: []
|
|
10
|
+
},
|
|
11
|
+
titleMenu: {
|
|
12
|
+
name: '添加标题',
|
|
13
|
+
key: 'titleMenu',
|
|
14
|
+
menuKeys: [
|
|
15
|
+
{name: '(中)黑体小4号', key: 'blackCenter4'},
|
|
16
|
+
{name: '(左)黑体小4号', key: 'blackLeft4'},
|
|
17
|
+
{name: '(中)黑体5号', key: 'blackCenter5'},
|
|
18
|
+
{name: '(左)黑体5号', key: 'blackLeft5'},
|
|
19
|
+
],
|
|
20
|
+
html: {
|
|
21
|
+
blackCenter4: `<p data-signId="title" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data,'titleMenu')?.text}</span></p>`,
|
|
22
|
+
blackLeft4: `<p data-signId="title" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data,'titleMenu')?.text}</span></p>`,
|
|
23
|
+
blackCenter5: `<p data-signId="title" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 14px;font-family: SimHei">${menusData(data,'titleMenu')?.text}</span></p>`,
|
|
24
|
+
blackLeft5: `<p data-signId="title" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 14px;font-family: SimHei">${menusData(data,'titleMenu')?.text}</span></p>`,
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
textMenu: {
|
|
28
|
+
name: '添加正文',
|
|
29
|
+
key: 'textMenu',
|
|
30
|
+
menuKeys: [
|
|
31
|
+
{name: '宋体5号', key: 'Song5'},
|
|
32
|
+
{name: '楷体5号', key: 'regular5'},
|
|
33
|
+
],
|
|
34
|
+
html: {
|
|
35
|
+
Song5: `<p style="text-align: left;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">请输入正文</span></p>`,
|
|
36
|
+
regular5: `<p style="text-align: left;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">请输入正文</span></p>`,
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
redMenu: {
|
|
40
|
+
name: '添加红头',
|
|
41
|
+
key: 'redMenu',
|
|
42
|
+
menuKeys: [],
|
|
43
|
+
html: `<p style="text-align: center;"><span style="color: rgb(225, 60, 57);font-size: 48px;">XXXXXXX(单位)文件</span></p><p data-signId="red" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 16px;">xxx〔xx〕xxxx 号</span></p>`
|
|
44
|
+
},
|
|
45
|
+
authorMenu: {
|
|
46
|
+
name: '添加作者',
|
|
47
|
+
key: 'authorMenu',
|
|
48
|
+
menuKeys: [],
|
|
49
|
+
html: `<p <p contenteditable="false" data-signId="author" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 14px;">${menusData(data,'authorMenu')?.text}</span></p>`
|
|
50
|
+
},
|
|
51
|
+
subjectMenu: {
|
|
52
|
+
name: '添加题目',
|
|
53
|
+
key: 'subjectMenu',
|
|
54
|
+
menuKeys: [],
|
|
55
|
+
html: `<p contenteditable="false" data-signId="subject" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 24px;">${menusData(data,'subjectMenu')?.text}</span></p>`
|
|
56
|
+
},
|
|
57
|
+
paragraphMenu: {
|
|
58
|
+
name: '添加落款',
|
|
59
|
+
key: 'paragraphMenu',
|
|
60
|
+
menuKeys: [],
|
|
61
|
+
html: `<p data-signId="paragraph" style="text-align: right;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;">落款人名</span></p><p style="text-align: right;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700">${getTime()}</span></p>`
|
|
62
|
+
},
|
|
63
|
+
numberMenu: {
|
|
64
|
+
name: '标注编号',
|
|
65
|
+
key: 'numberMenu',
|
|
66
|
+
menuKeys: [],
|
|
67
|
+
html: `<sup>【${menusData(data,'numberMenu')?.text}】</sup>`
|
|
68
|
+
},
|
|
69
|
+
keywordMenu: {
|
|
70
|
+
name: '关键词',
|
|
71
|
+
key: 'keywordMenu',
|
|
72
|
+
menuKeys: [],
|
|
73
|
+
html: `<p><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;"> 关键词:</span><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">关键词内容...</span></p>`
|
|
74
|
+
},
|
|
75
|
+
abstractMenu: {
|
|
76
|
+
name: '添加摘要',
|
|
77
|
+
key: 'abstractMenu',
|
|
78
|
+
menuKeys: [],
|
|
79
|
+
html: `<p><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;"> 摘要:</span><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">摘要内容...</span></p>`
|
|
80
|
+
},
|
|
81
|
+
literatureMenu: {
|
|
82
|
+
name: '添加文献',
|
|
83
|
+
key: 'literatureMenu',
|
|
84
|
+
menuKeys: [],
|
|
85
|
+
html: `<p><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">[1]作者.期刊论文名称IJ1.期刊名称,发表年份(第几期):页码</span></p><p><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">[2]作者.学位论文名称[D1.毕业院校所在城市:毕业院校,论文提交年份:页码</span></p><p><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">[3]作者.著作名称[M.出版社所在城市:出版社名称,出版年份:页码.</span></p><p data-signId="literature"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">[4]作者.文章名称[N].报纸名称,发行日期(版面)</span></p>`
|
|
86
|
+
},
|
|
87
|
+
taggingMenu: {
|
|
88
|
+
name: '添加标注',
|
|
89
|
+
key: 'taggingMenu',
|
|
90
|
+
menuKeys: [],
|
|
91
|
+
html: [
|
|
92
|
+
`<sup>${num[numSort(editor)]}</sup>`,
|
|
93
|
+
`<hr class="custom-link" contenteditable="false">`,
|
|
94
|
+
`<p data-signId="s-${numSort(editor)}"><span style="font-family: KaiTi">${num[numSort(editor)]}填写标注内容<span></p>`
|
|
95
|
+
],
|
|
96
|
+
index: numSort(editor)
|
|
97
|
+
},
|
|
98
|
+
'group-image': {
|
|
99
|
+
name: '上传图片',
|
|
100
|
+
key: 'group-image',
|
|
101
|
+
menuKeys: [
|
|
102
|
+
{name: '网络图片', key: 'insertImage'},
|
|
103
|
+
{name: '上传图片', key: 'uploadImage'},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
'group-upload': {
|
|
107
|
+
name: '上传文件',
|
|
108
|
+
key: 'group-upload',
|
|
109
|
+
menuKeys: [],
|
|
110
|
+
html: `<p contenteditable="false" data-signId="enclosure"><span style="font-weight: 700;font-size: 16px;">附件列表:</span></p>`
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function numSort(editor) {
|
|
116
|
+
let num = 1
|
|
117
|
+
const data = editor.getJSON().content
|
|
118
|
+
data.forEach((item, index) => {
|
|
119
|
+
const id = item?.attrs?.signId
|
|
120
|
+
if(id) {
|
|
121
|
+
let arr = item.attrs.signId.split('-')[1]
|
|
122
|
+
num = Number(arr) + 1 > num ? Number(arr) + 1 : num
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
return num
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function menusData(data,key) {
|
|
129
|
+
let arr = {}
|
|
130
|
+
data.forEach(item => {
|
|
131
|
+
if (item.key === key) arr = item
|
|
132
|
+
})
|
|
133
|
+
return arr
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 时间
|
|
137
|
+
function getTime() {
|
|
138
|
+
let date = new Date()
|
|
139
|
+
let year = date.getFullYear()
|
|
140
|
+
let month = date.getMonth() + 1
|
|
141
|
+
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
142
|
+
return year + '年' + month + '月' + day + '日'
|
|
143
|
+
}
|