zydx-plus 1.35.493 → 1.35.494

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.493",
3
+ "version": "1.35.494",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -33,6 +33,17 @@ export function butJson(editor, data) {
33
33
  menuKeys: [],
34
34
  html: ''
35
35
  },
36
+ {
37
+ name: '图书版式',
38
+ key: 'bookLayout',
39
+ menuKeys: [],
40
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color:#000;line-height: 1;">请在此处输入一级标题</span></strong></p>
41
+ <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
42
+ <p data-signid="title-1" style="text-align: center;" class="title ${randomId()}"><strong><span style="font-size: 20px; font-family: SimHei; color:#000">一、请在此处输入一级标题</span></strong></p>
43
+ <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
44
+ <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#000">(一)请在此处输入二级标题</span></strong></p>
45
+ <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>`
46
+ },
36
47
  {
37
48
  name: '公文版式',
38
49
  key: 'officialDocumentFormat',
@@ -43,7 +54,7 @@ export function butJson(editor, data) {
43
54
  <p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color:#333333;line-height: 1;">请在此处输入标题</span></strong></p>
44
55
  <p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
45
56
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
46
- <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
57
+ <p data-signid="title-1" style="text-align: center;" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
47
58
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
48
59
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
49
60
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
@@ -57,7 +68,7 @@ export function butJson(editor, data) {
57
68
  html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>
58
69
  <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>
59
70
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
60
- <p data-signid="title-1" style="text-align: center" class="title ${randomId()} "><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
71
+ <p data-signid="title-1" style="text-align: center" class="title ${randomId()} "><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
61
72
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
62
73
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
63
74
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
@@ -70,10 +81,10 @@ export function butJson(editor, data) {
70
81
  menuKeys: [],
71
82
  html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入题目</span></strong></p>
72
83
  <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>
73
- <p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: #333333;">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
74
- <p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: #333333">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
84
+ <p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: FangSong; color: #333333;">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
85
+ <p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: FangSong; color: #333333">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
75
86
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
76
- <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
87
+ <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
77
88
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
78
89
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimH ei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
79
90
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
@@ -130,12 +141,12 @@ export function butJson(editor, data) {
130
141
  name: '摘&nbsp;&nbsp;&nbsp;要',
131
142
  key: 'abstractMenu',
132
143
  menuKeys: [],
133
- html: `<p class="abstract" data-signId="abstract"><span style="color:#333333;font-size: 14px;font-weight: 700;font-family: SimSun;">摘要:</span> <span style="color: rgb(0, 0, 0);font-size: 14px;font-family: FangSong"> 摘要内容...</span></p>`
144
+ html: `<p class="abstract" data-signId="abstract"><span style="color:#333333;font-size: 14px;font-weight: 700;font-family: FangSong;">摘要:</span> <span style="color: rgb(0, 0, 0);font-size: 14px;font-family: FangSong"> 摘要内容...</span></p>`
134
145
  }, {
135
146
  name: '关键词',
136
147
  key: 'keywordMenu',
137
148
  menuKeys: [],
138
- html: `<p class="keyword" data-signId="keyword"><span contenteditable="false" style="color:#333333;font-size: 14px;font-weight: 700;font-family: SimSun;">关键词:</span> <span style="color: rgb(0, 0, 0);font-size: 14px;font-family: FangSong"> 关键词内容...</span></p>`
149
+ html: `<p class="keyword" data-signId="keyword"><span contenteditable="false" style="color:#333333;font-size: 14px;font-weight: 700;font-family: FangSong;">关键词:</span> <span style="color: rgb(0, 0, 0);font-size: 14px;font-family: FangSong"> 关键词内容...</span></p>`
139
150
  }, {
140
151
  name: '标&nbsp;&nbsp;&nbsp;题',
141
152
  key: 'paragraphTitle',
@@ -189,6 +200,18 @@ export function butJson(editor, data) {
189
200
  name: '大纲级别',
190
201
  key: 'outlineMenu',
191
202
  menuKeys: [
203
+ {
204
+ name: '文章标题',
205
+ key: 'subjectMenu',
206
+ menuKeys: [],
207
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>`
208
+ },
209
+ {
210
+ name: '作者',
211
+ key: 'authorMenu',
212
+ menuKeys: [],
213
+ html: `<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>`
214
+ },
192
215
  {name: '一级标题', key: 'title-1'},
193
216
  {name: '二级标题', key: 'title-2'},
194
217
  {name: '三级标题', key: 'title-3'},
@@ -214,7 +237,7 @@ export function butJson(editor, data) {
214
237
  name: '一级标题',
215
238
  key: 'firstLevelHeading',
216
239
  menuKeys: [],
217
- html: `<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
240
+ html: `<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
218
241
  },
219
242
  secondaryHeading: {
220
243
  name: '二级标题',
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="only" class="z-editor">
2
+ <div ref="only" class="z-editor" :style="!readOnly?'border: 1px solid rgba(204, 204, 204, 1);':''">
3
3
  <div v-show="!readOnly" class="editor-header">
4
4
  <div v-for="(item,index) in butData" :key="index" class="editor-but">
5
5
  <div v-if="uploadTypeArr.indexOf(item.key) !== -1" class="editor-but-name">
@@ -1030,17 +1030,17 @@ export default {
1030
1030
  this.editor?.commands.setContent(dataHtml)
1031
1031
  if (this.readOnly) {
1032
1032
  if (this.page) this.editableShow = true
1033
- // setTimeout(() => {
1034
- if (this.page) {
1035
- this.editableShow = false
1036
- this.readOnlyPage()
1037
- }
1038
- // }, 300)
1033
+ setTimeout(() => {
1034
+ if (this.page) {
1035
+ this.editableShow = false
1036
+ this.readOnlyPage()
1037
+ }
1038
+ }, 300)
1039
1039
  }
1040
1040
  setTimeout(() => {
1041
1041
  this.init = true
1042
1042
  this.templateType = this.htmlJson.templateType
1043
- this.changeTemplateType()
1043
+ // this.changeTemplateType()
1044
1044
  }, 500)
1045
1045
  },
1046
1046
  deep: true,
@@ -1248,6 +1248,7 @@ export default {
1248
1248
  this.limits = true
1249
1249
  },
1250
1250
  onUpdate: ({editor}) => {
1251
+ _this.$emit('changeOutlineMenu', _this.changeOutlineMenu())
1251
1252
  editor.commands.focus()
1252
1253
  const json = editor.getJSON()
1253
1254
  for (let i = 0; i < json.content.length; i++) {
@@ -1369,7 +1370,7 @@ export default {
1369
1370
  this.y = event.clientY - this.top;
1370
1371
  })
1371
1372
  this.templateType = this.htmlJson.templateType
1372
- this.changeTemplateType()
1373
+ // this.changeTemplateType()
1373
1374
  // document.addEventListener('click', () => {
1374
1375
  // // if(this.limits) return
1375
1376
  // // this.close()
@@ -1424,7 +1425,8 @@ export default {
1424
1425
  }
1425
1426
  let oldContent = []
1426
1427
  let signIdArrObj = {
1427
- officialDocumentFormat: ['red','text', 'paragraph', 'date', 'subject'],
1428
+ bookLayout:['text', 'paragraph', 'date', 'subject'],
1429
+ officialDocumentFormat: ['red', 'text', 'paragraph', 'date', 'subject'],
1428
1430
  newsFormat: ['text', 'paragraph', 'date', 'subject', 'author'],
1429
1431
  paperFormat: ['text', 'paragraph', 'date', 'subject', 'author']
1430
1432
  }
@@ -1495,6 +1497,18 @@ export default {
1495
1497
  })
1496
1498
  this.editor.chain().setContent({type: 'doc', content: oldContent}).run()
1497
1499
  }
1500
+ // 图书版式
1501
+ if (this.templateType === 'bookLayout' && !this.readOnly) {
1502
+ const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
1503
+ this.editor.chain().setContent(html).run()
1504
+ this.toolbar = [
1505
+ 'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
1506
+ 'outlineMenu', 'alignmentMode', 'titleMenu',
1507
+ 'textMenu', 'color', 'interposition']
1508
+ this.organizeButton()
1509
+ this.interpositionData = []
1510
+ oldFormatWriteNewFormat(oldJson)
1511
+ }
1498
1512
  // 公文版式
1499
1513
  if (this.templateType === 'officialDocumentFormat' && !this.readOnly) {
1500
1514
  const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
@@ -2575,7 +2589,7 @@ export default {
2575
2589
  const html = butJson(this.editor, this.menusText)[v].html
2576
2590
  if (r === -1) {
2577
2591
  const last = this.editor.state.selection.$anchor.path[0].content.size
2578
- if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
2592
+ if (t === -1) this.editor.chain().focus().insertContentAt(to, html).run()
2579
2593
  const num = this.upSort(this.editor, 'enclosure')
2580
2594
  const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
2581
2595
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
@@ -2812,6 +2826,16 @@ export default {
2812
2826
  this.toolbar.forEach(item => {
2813
2827
  let obj = butJson(this.editor, this.menusText)[item.key === undefined ? item : item.key]
2814
2828
  if (obj) {
2829
+ if (this.templateType === 'bookLayout' && obj.key === 'outlineMenu') {
2830
+ obj.menuKeys = [
2831
+ {name: '一级标题', key: 'title-1'},
2832
+ {name: '二级标题', key: 'title-2'},
2833
+ {name: '三级标题', key: 'title-3'},
2834
+ // {name: '四级标题', key: 'title-4'},
2835
+ {name: '正文文本', key: 'text'},]
2836
+ this.butData.push(obj)
2837
+ return
2838
+ }
2815
2839
  if (item.key === undefined) {
2816
2840
  this.butData.push(obj)
2817
2841
  } else {
@@ -2874,6 +2898,10 @@ export default {
2874
2898
 
2875
2899
  await this.changeTemplateType()
2876
2900
  }
2901
+ if(this.templateType === 'bookLayout'){
2902
+
2903
+ await this.changeTemplateType()
2904
+ }
2877
2905
  if (this.templateType === 'officialDocumentFormat') {
2878
2906
 
2879
2907
  await this.changeTemplateType()
@@ -2901,34 +2929,6 @@ export default {
2901
2929
  this.editor.commands.setHorizontalRule() // 添加分割线
2902
2930
  }
2903
2931
  }
2904
- // 题目
2905
- if (key.key === 'subjectMenu') {
2906
- const html = menusHtml.filter(item => item.key == key.key)[0].html
2907
- // const html = butJson(this.editor, this.menusText)[data.key].html
2908
- const b = await this.signIdData('red') // 判断是否有红头文件
2909
- const r = await this.signIdData('subject')// 判断是否有题目
2910
- if (b === -1) {
2911
- if (r === -1) this.editor.chain().focus().insertContentAt(0, html).run()
2912
- } else {
2913
- if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('red'), html).run()
2914
- }
2915
- }
2916
- // 作者
2917
- if (key.key === 'authorMenu') {
2918
- const html = menusHtml.filter(item => item.key == key.key)[0].html
2919
- const b = await this.signIdData('subject') // 判断是否有题目
2920
- const r = await this.signIdData('author')// 判断是否有作者
2921
- const a = await this.signIdData('red') // 判断是否有红头文件
2922
- if (b === -1) {
2923
- if (a === -1) {
2924
- if (r === -1) this.editor.chain().focus().insertContentAt(0, html).run()
2925
- return
2926
- }
2927
- if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('red'), html).run()
2928
- return
2929
- }
2930
- if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('subject'), html).run()
2931
- }
2932
2932
  // 摘要
2933
2933
  if (key.key === 'abstractMenu') {
2934
2934
  const html = menusHtml.filter(item => item.key == key.key)[0].html
@@ -3229,6 +3229,37 @@ export default {
3229
3229
  }
3230
3230
  // 大纲级别
3231
3231
  if (data.key === 'outlineMenu') {
3232
+ const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
3233
+ // 题目
3234
+ if (key.key === 'subjectMenu') {
3235
+ const html = menusHtml.filter(item => item.key == key.key)[0].html
3236
+ // const html = butJson(this.editor, this.menusText)[data.key].html
3237
+ const b = await this.signIdData('red') // 判断是否有红头文件
3238
+ const r = await this.signIdData('subject')// 判断是否有题目
3239
+ if (b === -1) {
3240
+ if (r === -1) this.editor.chain().focus().insertContentAt(0, html).run()
3241
+ } else {
3242
+ if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('red'), html).run()
3243
+ }
3244
+ return
3245
+ }
3246
+ // 作者
3247
+ if (key.key === 'authorMenu') {
3248
+ const html = menusHtml.filter(item => item.key == key.key)[0].html
3249
+ const b = await this.signIdData('subject') // 判断是否有题目
3250
+ const r = await this.signIdData('author')// 判断是否有作者
3251
+ const a = await this.signIdData('red') // 判断是否有红头文件
3252
+ if (b === -1) {
3253
+ if (a === -1) {
3254
+ if (r === -1) this.editor.chain().focus().insertContentAt(0, html).run()
3255
+ return
3256
+ }
3257
+ if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('red'), html).run()
3258
+ return
3259
+ }
3260
+ if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('subject'), html).run()
3261
+ return
3262
+ }
3232
3263
  if (key.key === 'text') {
3233
3264
  this.editor.commands.setNode('paragraph', {class: 'indent'})
3234
3265
  this.editor.commands.setTitleId(key.key)
@@ -3237,21 +3268,31 @@ export default {
3237
3268
  } else {
3238
3269
  const t = key.key.split('-')[0]
3239
3270
  const level = key.key.split('-')[1]
3240
- let size = '16px'
3271
+ let size = this.templateType === 'bookLayout' ? '24px' : '18px'
3272
+ let color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3241
3273
  if (level === '1') {
3242
3274
  this.editor.commands.setNode('paragraph', {class: ''})
3243
3275
  this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3244
3276
  this.editor.commands.setSignId(key.key)
3245
- this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('center').focus().run()
3277
+ this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign('center').focus().run()
3246
3278
  } else if (level === '2') {
3279
+ size = this.templateType === 'bookLayout' ? '20px' : '16px'
3280
+ color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3281
+ let align = this.templateType === 'bookLayout' ? 'center' : 'left'
3247
3282
  this.editor.commands.setSignId(key.key)
3248
- this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3249
- this.editor.chain().unsetBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
3283
+ if (this.templateType === 'bookLayout') {
3284
+ this.editor.commands.setNode('paragraph', {class: ''})
3285
+ this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3286
+ } else {
3287
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3288
+ }
3289
+ this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign(align).focus().run()
3250
3290
  } else {
3251
- size = '14px'
3291
+ size = this.templateType === 'bookLayout' ? '16px' : '14px'
3292
+ color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3252
3293
  this.editor.commands.setSignId(key.key)
3253
3294
  this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3254
- this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
3295
+ this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign('left').focus().run()
3255
3296
  }
3256
3297
  }
3257
3298
  this.$emit('changeOutlineMenu', this.changeOutlineMenu())
@@ -4314,7 +4355,6 @@ li {
4314
4355
  }
4315
4356
 
4316
4357
  .z-editor {
4317
- border: 1px solid rgba(204, 204, 204, 1);
4318
4358
  position: relative;
4319
4359
  width: 100%;
4320
4360
  max-height: 900px;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.493',
90
+ version: '1.35.494',
91
91
  install,
92
92
  Calendar,
93
93
  Message,