zydx-plus 1.35.592 → 1.35.593
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/chat/index.js +6 -0
- package/src/components/chat/src/ai.png +0 -0
- package/src/components/chat/src/chat.vue +720 -0
- package/src/components/editor/index.js +6 -0
- package/src/components/editor/src/butJson-copy.js +183 -0
- package/src/components/editor/src/butJson.js +506 -0
- package/src/components/editor/src/delete-svg.vue +33 -0
- package/src/components/editor/src/edit-svg.vue +30 -0
- package/src/components/editor/src/editor-copy.vue +1360 -0
- package/src/components/editor/src/editor.vue +5299 -0
- package/src/components/editor/src/extend/contenteditable.js +33 -0
- package/src/components/editor/src/extend/data-url.js +33 -0
- package/src/components/editor/src/extend/exegesis-id.js +44 -0
- package/src/components/editor/src/extend/extension-image.js +86 -0
- package/src/components/editor/src/extend/font-size.js +49 -0
- package/src/components/editor/src/extend/insertHorizontalLine.js +48 -0
- package/src/components/editor/src/extend/line-height-id.js +43 -0
- package/src/components/editor/src/extend/margin.js +48 -0
- package/src/components/editor/src/extend/sign-id.js +43 -0
- package/src/components/editor/src/extend/title-id.js +43 -0
- package/src/components/editor/src/image/annotation.png +0 -0
- 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 +27 -0
- package/src/components/editor/src/isSelect.vue +20 -0
- package/src/components/editor/src/mammoth.browser.min.js +18 -0
- package/src/components/editor/src/margin-moderation.vue +68 -0
- package/src/components/editor/src/margin-narrow.vue +70 -0
- package/src/components/editor/src/margin-standard.vue +66 -0
- package/src/components/editor/src/margin-wide.vue +66 -0
- package/src/components/editor/src/view-svg.vue +31 -0
- package/src/index.js +1 -1
|
@@ -0,0 +1,183 @@
|
|
|
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: '微软雅黑', key: 'Microsoft Yahei'},
|
|
16
|
+
{name: '楷体', key: 'Kaiti'},
|
|
17
|
+
{name: '仿宋', key: 'FangSong'},
|
|
18
|
+
{name: '黑体', key: 'SimHei'},
|
|
19
|
+
],
|
|
20
|
+
html: {
|
|
21
|
+
blackCenter4: `<p data-signId="title-1" class="title ${randomId()}" 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-2" class="title ${randomId()}" 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-3" class="title ${randomId()}" 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-4" class="title ${randomId()}" 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: '12', key: '12px'},
|
|
32
|
+
{name: '14', key: '14px'},
|
|
33
|
+
{name: '16', key: '16px'},
|
|
34
|
+
{name: '18', key: '18px'},
|
|
35
|
+
{name: '20', key: '20px'},
|
|
36
|
+
{name: '22', key: '22px'},
|
|
37
|
+
{name: '24', key: '24px'},
|
|
38
|
+
{name: '26', key: '26px'},
|
|
39
|
+
{name: '28', key: '28px'},
|
|
40
|
+
{name: '30', key: '30px'},
|
|
41
|
+
{name: '32', key: '32px'}
|
|
42
|
+
],
|
|
43
|
+
html: {
|
|
44
|
+
Song5: `<p class="text" style="text-align: left;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">请输入正文</span></p>`,
|
|
45
|
+
regular5: `<p class="text" style="text-align: left;"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi">请输入正文</span></p>`,
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
outlineMenu: {
|
|
49
|
+
name: '大纲级别',
|
|
50
|
+
key: 'outlineMenu',
|
|
51
|
+
menuKeys: [
|
|
52
|
+
{name: '一级标题', key: 'title-1'},
|
|
53
|
+
{name: '二级标题', key: 'title-2'},
|
|
54
|
+
{name: '三级标题', key: 'title-3'},
|
|
55
|
+
{name: '四级标题', key: 'title-4'},
|
|
56
|
+
{name: '正文文本', key: 'text'},
|
|
57
|
+
],
|
|
58
|
+
html: {}
|
|
59
|
+
},
|
|
60
|
+
redMenu: {
|
|
61
|
+
name: '添加红头',
|
|
62
|
+
key: 'redMenu',
|
|
63
|
+
menuKeys: [],
|
|
64
|
+
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>`
|
|
65
|
+
},
|
|
66
|
+
authorMenu: {
|
|
67
|
+
name: '添加作者',
|
|
68
|
+
key: 'authorMenu',
|
|
69
|
+
menuKeys: [],
|
|
70
|
+
html: `<p class="author" data-signId="author" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 16px;font-family: KaiT;">${menusData(data,'authorMenu').text}</span></p>`
|
|
71
|
+
},
|
|
72
|
+
subjectMenu: {
|
|
73
|
+
name: '添加题目',
|
|
74
|
+
key: 'subjectMenu',
|
|
75
|
+
menuKeys: [],
|
|
76
|
+
html: `<p data-signId="subject" style="text-align: center;padding-bottom: 30px;"><span style="color: rgb(0, 0, 0);font-size: 24px;font-family: SimHei;font-weight: 700;">${menusData(data,'subjectMenu').text}</span></p>`
|
|
77
|
+
},
|
|
78
|
+
paragraphMenu: {
|
|
79
|
+
name: '添加落款',
|
|
80
|
+
key: 'paragraphMenu',
|
|
81
|
+
menuKeys: [],
|
|
82
|
+
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>`
|
|
83
|
+
},
|
|
84
|
+
numberMenu: {
|
|
85
|
+
name: '标注编号',
|
|
86
|
+
key: 'numberMenu',
|
|
87
|
+
menuKeys: [],
|
|
88
|
+
html: [
|
|
89
|
+
`<sup>[${menusData(data,'numberMenu').text}]</sup>`,
|
|
90
|
+
`<sup>[${menusData(data,'numberMenu').text}]</sup><span> </span>`
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
keywordMenu: {
|
|
94
|
+
name: '关键词',
|
|
95
|
+
key: 'keywordMenu',
|
|
96
|
+
menuKeys: [],
|
|
97
|
+
html: `<p class="keyword" data-signId="keyword"><span style="color: rgb(0, 0, 0);font-size: 12px;font-weight: 700;font-family: SimSun;">关键词:</span><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi">关键词内容...</span></p>`
|
|
98
|
+
},
|
|
99
|
+
abstractMenu: {
|
|
100
|
+
name: '添加摘要',
|
|
101
|
+
key: 'abstractMenu',
|
|
102
|
+
menuKeys: [],
|
|
103
|
+
html: `<p class="abstract" data-signId="abstract"><span style="color: rgb(0, 0, 0);font-size: 12px;font-weight: 700;font-family: SimSun;">摘要:</span><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi">摘要内容...</span></p>`
|
|
104
|
+
},
|
|
105
|
+
literatureMenu: {
|
|
106
|
+
name: '添加文献',
|
|
107
|
+
key: 'literatureMenu',
|
|
108
|
+
menuKeys: [],
|
|
109
|
+
html: `<p class="literature"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">[1]作者.期刊论文名称IJ1.期刊名称,发表年份(第几期):页码</span></p><p class="literature"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">[2]作者.学位论文名称[D1.毕业院校所在城市:毕业院校,论文提交年份:页码</span></p><p class="literature"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">[3]作者.著作名称[M.出版社所在城市:出版社名称,出版年份:页码.</span></p><p class="literature" data-signId="literature"><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: SimSun">[4]作者.文章名称[N].报纸名称,发行日期(版面)</span></p>`
|
|
110
|
+
},
|
|
111
|
+
taggingMenu: {
|
|
112
|
+
name: '添加标注',
|
|
113
|
+
key: 'taggingMenu',
|
|
114
|
+
menuKeys: [],
|
|
115
|
+
html: [
|
|
116
|
+
`<sup>${num[numSort(editor)]}</sup>`,
|
|
117
|
+
`<hr class="custom-link" contenteditable="false">`,
|
|
118
|
+
`<p data-signId="s-${numSort(editor)}"><span style="font-family: KaiTi">${num[numSort(editor)]}填写标注内容<span></p>`,
|
|
119
|
+
`<sup>${num[numSort(editor)]}</sup><span> </span>`,
|
|
120
|
+
],
|
|
121
|
+
index: numSort(editor)
|
|
122
|
+
},
|
|
123
|
+
ackMenu: {
|
|
124
|
+
name: '致谢',
|
|
125
|
+
key: 'ackMenu',
|
|
126
|
+
menuKeys: [],
|
|
127
|
+
html: [
|
|
128
|
+
`<p data-signId="ack" contenteditable="false" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 16px;font-weight: bold;">致谢</span></p>`,
|
|
129
|
+
`<p><span style="color: rgb(0, 0, 0);font-size: 14px;font-family: KaiTi;">致谢内容...</span></p>`
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
'group-image': {
|
|
133
|
+
name: '上传图片',
|
|
134
|
+
key: 'group-image',
|
|
135
|
+
menuKeys: [
|
|
136
|
+
{name: '网络图片', key: 'insertImage'},
|
|
137
|
+
{name: '上传图片', key: 'uploadImage'},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
'group-upload': {
|
|
141
|
+
name: '上传文件',
|
|
142
|
+
key: 'group-upload',
|
|
143
|
+
menuKeys: [],
|
|
144
|
+
html: `<p contenteditable="false" data-signId="enclosure"><span style="font-weight: 700;font-size: 16px;">附件列表:</span></p>`
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function numSort(editor) {
|
|
150
|
+
let num = 1
|
|
151
|
+
const data = editor.getJSON().content
|
|
152
|
+
data.forEach((item, index) => {
|
|
153
|
+
const id = item.attrs === undefined? null :item.attrs.signId
|
|
154
|
+
if(id) {
|
|
155
|
+
let arr = item.attrs.signId.split('-')[1]
|
|
156
|
+
num = Number(arr) + 1 > num ? Number(arr) + 1 : num
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
return num
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function menusData(data,key) {
|
|
163
|
+
let arr = {}
|
|
164
|
+
data.forEach(item => {
|
|
165
|
+
if (item.key === key) arr = item
|
|
166
|
+
})
|
|
167
|
+
return arr
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 随机
|
|
171
|
+
function randomId() {
|
|
172
|
+
const id = Math.random().toString(36).substr(2)
|
|
173
|
+
return id.replace(/[0-9]/g, '')
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 时间
|
|
177
|
+
function getTime() {
|
|
178
|
+
let date = new Date()
|
|
179
|
+
let year = date.getFullYear()
|
|
180
|
+
let month = date.getMonth() + 1
|
|
181
|
+
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
182
|
+
return year + '年' + month + '月' + day + '日'
|
|
183
|
+
}
|