zydx-plus 1.35.528 → 1.35.530

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.528",
3
+ "version": "1.35.530",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -255,6 +255,9 @@ li{list-style-type:none;}
255
255
  .cle-but-right{
256
256
  flex: 2;
257
257
  }
258
+ .cle-but-right-cont{
259
+ display: flex;
260
+ }
258
261
  .cle-time{
259
262
  display: inline-block;
260
263
  position: relative;
@@ -60,7 +60,7 @@
60
60
  <div class="cle-frame"></div>
61
61
  <div class="cle-time-y">
62
62
  <ul @scroll="scrollHour($event)">
63
- <li v-for="(item,index) in 30"></li>
63
+ <li v-for="(item,index) in 30*4"></li>
64
64
  </ul>
65
65
  <div class="cle-time-li" :style="{transform: 'translateY('+ transHour +'px)'}">
66
66
  <p v-for="(item,index) in 30" :class="{'cle-time-act': index === -(transHour/26)+3}">{{ (index > 2 && index < 27)? ((index - 3) < 10)? '0'+(index - 3): (index - 3) : '' }}</p>
@@ -68,7 +68,7 @@
68
68
  </div>
69
69
  <div class="cle-time-y">
70
70
  <ul @scroll="scrollMinute($event)">
71
- <li v-for="(item,index) in 66"></li>
71
+ <li v-for="(item,index) in 66*4"></li>
72
72
  </ul>
73
73
  <div class="cle-time-li" :style="{transform: 'translateY('+ transMinute +'px)'}">
74
74
  <p v-for="(item,index) in 66" :class="{'cle-time-act': index === -(transMinute/26)+3}">{{ (index > 2 && index < 63)? ((index - 3) < 10)? '0'+(index - 3): (index - 3) : '' }}</p>
@@ -78,8 +78,10 @@
78
78
  </div>
79
79
  </div>
80
80
  <div class="cle-but-right">
81
- <button class="cle-but" @click="cancel">取消</button>
82
- <button class="cle-but" @click="confirm">确认</button>
81
+ <div class="cle-but-right-cont">
82
+ <button class="cle-but" @click="cancel">取消</button>
83
+ <button class="cle-but" @click="confirm">确认</button>
84
+ </div>
83
85
  </div>
84
86
  </div>
85
87
  </div>
@@ -248,15 +250,17 @@ export default {
248
250
  this.cleFocusShow = true
249
251
  },
250
252
  scrollMinute(e) {
251
- let top = e.target.scrollTop
253
+ let top = e.target.scrollTop/3.8
252
254
  let index = Math.floor(top/26)
255
+ if(index > 59 || index < 0) return
253
256
  this.transMinute = -(index * 26)
254
257
  this.minute = (index < 10)? '0'+ index: index
255
258
  this.cleDate = `${this.hour}:${this.minute}`
256
259
  },
257
260
  scrollHour(e) {
258
- let top = e.target.scrollTop
261
+ let top = e.target.scrollTop/3.8
259
262
  let index = Math.floor(top/26)
263
+ if(index > 23 || index < 0) return
260
264
  this.transHour = -(index * 26)
261
265
  this.hour = (index < 10)? '0'+ index: index
262
266
  this.cleDate = `${this.hour}:${this.minute}`
@@ -12,7 +12,8 @@
12
12
  </div>
13
13
  </div>
14
14
  <div :class="{'drag-cont2': fixedStart,'drag-conts': true}">
15
- <div class="drag-cont-slot">
15
+ <div class="drag-cont-slot" :class="{'zIndexSlot': footIsMove}">
16
+ <div class="zIndexSlot" v-if="footIsMove || draggableMove"></div>
16
17
  <slot name="content"></slot>
17
18
  </div>
18
19
  <div v-show="!fixedStart&&!autoHeight">
@@ -55,7 +56,8 @@ export default {
55
56
  transAll: false,
56
57
  fixedStart: false,
57
58
  initWidth: 1280,
58
- draggableState: null
59
+ draggableState: null,
60
+ draggableMove: false
59
61
  }
60
62
  },
61
63
  props: {
@@ -194,6 +196,10 @@ export default {
194
196
  this.y = this.top - scrollTop
195
197
  }
196
198
  }
199
+ document.addEventListener('fullscreenchange', this.handleFullScreenChange);
200
+ document.addEventListener('mozfullscreenchange', this.handleFullScreenChange); // Firefox
201
+ document.addEventListener('webkitfullscreenchange', this.handleFullScreenChange); // Chrome, Safari and Opera
202
+ document.addEventListener('msfullscreenchange', this.handleFullScreenChange); // IE/Edge
197
203
  // 监听窗口变化
198
204
  window.addEventListener('resize', () => {
199
205
  const wid = document.getElementById('app').offsetWidth
@@ -218,6 +224,24 @@ export default {
218
224
  },
219
225
  emits: ['dragStatus', 'close', 'enlarge','updateDrag','minimize','dragMouseup'],
220
226
  methods: {
227
+ handleFullScreenChange() {
228
+ if (!document.fullscreenElement) {
229
+ let clientWidth = window.innerWidth
230
+ this.x = clientWidth / 2 - this.width / 2;
231
+ this.y = (window.innerHeight / 2 - this.height / 2) - 80;
232
+ this.footDownOffset = this.height;
233
+ this.footRightOffset = this.width;
234
+ this.draggableState.draggable({enabled: true})
235
+ this.state = false
236
+ this.$emit('updateDrag', {
237
+ width: this.footRightOffset,
238
+ height: this.footDownOffset - ((this.dragTextShow)?60:30),
239
+ left: this.x,
240
+ top: this.y
241
+ })
242
+ this.$emit('enlarge', this.state)
243
+ }
244
+ },
221
245
  // 全屏
222
246
  fullScreen() {
223
247
  this.draggableState.draggable({enabled: false})
@@ -293,6 +317,7 @@ export default {
293
317
  enabled: true,
294
318
  listeners: {
295
319
  start (event) {
320
+ that.draggableMove = true
296
321
  that.dragTap()
297
322
  },
298
323
  move (event) {
@@ -312,6 +337,9 @@ export default {
312
337
  if (that.y > that.clientHeight - that.footDownOffset + that.footDownOffset / 2) {
313
338
  that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
314
339
  }
340
+ },
341
+ end (event) {
342
+ that.draggableMove = false
315
343
  }
316
344
  }
317
345
  })
@@ -391,13 +419,13 @@ export default {
391
419
  minimizeTap() {
392
420
  this.isMove = false
393
421
  this.footIsMove = false
394
- this.exitFullscreen()
422
+ if(this.state) this.exitFullscreen()
395
423
  this.$emit('minimize');
396
424
  },
397
425
  close() {
398
426
  this.isMove = false
399
427
  this.footIsMove = false
400
- this.exitFullscreen()
428
+ if(this.state) this.exitFullscreen()
401
429
  this.$emit('close');
402
430
  },
403
431
  selectedDrag(){
@@ -582,4 +610,13 @@ export default {
582
610
  .zIndex10000{
583
611
  z-index: 10000;
584
612
  }
613
+ .zIndexSlot{
614
+ position: absolute;
615
+ top: 0;
616
+ right: 0;
617
+ left: 0;
618
+ bottom: 0;
619
+ z-index: 5;
620
+ background-color: rgba(255,255,255,0);
621
+ }
585
622
  </style>
@@ -14,6 +14,7 @@
14
14
  </div>
15
15
  <div :class="{'drag-cont2': fixedStart,'drag-conts': true}">
16
16
  <div class="drag-cont-slot">
17
+ <div class="zIndexSlot" v-if="footIsMove || draggableMove"></div>
17
18
  <slot name="content"></slot>
18
19
  </div>
19
20
  <div v-show="!fixedStart&&!autoHeight">
@@ -56,7 +57,8 @@ export default {
56
57
  transAll: false,
57
58
  fixedStart: false,
58
59
  initWidth: 1280,
59
- draggableState: null
60
+ draggableState: null,
61
+ draggableMove: false
60
62
  }
61
63
  },
62
64
  props: {
@@ -197,6 +199,11 @@ export default {
197
199
  this.y = this.top - scrollTop
198
200
  }
199
201
  }
202
+ document.addEventListener('fullscreenchange', this.handleFullScreenChange);
203
+ document.addEventListener('mozfullscreenchange', this.handleFullScreenChange); // Firefox
204
+ document.addEventListener('webkitfullscreenchange', this.handleFullScreenChange); // Chrome, Safari and Opera
205
+ document.addEventListener('msfullscreenchange', this.handleFullScreenChange); // IE/Edge
206
+
200
207
  // 监听窗口变化
201
208
  window.addEventListener('resize', () => {
202
209
  const wid = document.getElementById('app').offsetWidth
@@ -226,6 +233,24 @@ export default {
226
233
  },
227
234
  emits: ['dragStatus', 'close', 'enlarge','updateDrag','minimize','dragMouseup'],
228
235
  methods: {
236
+ handleFullScreenChange() {
237
+ if (!document.fullscreenElement) {
238
+ let clientWidth = window.innerWidth
239
+ this.x = clientWidth / 2 - this.width / 2;
240
+ this.y = (window.innerHeight / 2 - this.height / 2) - 80;
241
+ this.footDownOffset = this.height;
242
+ this.footRightOffset = this.width;
243
+ this.draggableState.draggable({enabled: true})
244
+ this.state = false
245
+ this.$emit('updateDrag', {
246
+ width: this.footRightOffset,
247
+ height: this.footDownOffset - ((this.dragTextShow)?60:30),
248
+ left: this.x,
249
+ top: this.y
250
+ })
251
+ this.$emit('enlarge', this.state)
252
+ }
253
+ },
229
254
  // 全屏
230
255
  fullScreen() {
231
256
  this.draggableState.draggable({enabled: false})
@@ -301,7 +326,12 @@ export default {
301
326
  this.draggableState.draggable({
302
327
  enabled: true,
303
328
  listeners: {
329
+ start (event) {
330
+ that.draggableMove = true
331
+ that.dragTap()
332
+ },
304
333
  move (event) {
334
+ console.log('移动')
305
335
  // 获取滚动距离
306
336
  const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
307
337
  that.y = event.rect.top - scrollTop
@@ -318,6 +348,9 @@ export default {
318
348
  if (that.y > that.clientHeight - that.footDownOffset + that.footDownOffset / 2) {
319
349
  that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
320
350
  }
351
+ },
352
+ end (event) {
353
+ that.draggableMove = false
321
354
  }
322
355
  }
323
356
  })
@@ -397,13 +430,13 @@ export default {
397
430
  minimizeTap() {
398
431
  this.isMove = false
399
432
  this.footIsMove = false
400
- this.exitFullscreen()
433
+ if(this.state) this.exitFullscreen()
401
434
  this.$emit('minimize');
402
435
  },
403
436
  close() {
404
437
  this.isMove = false
405
438
  this.footIsMove = false
406
- this.exitFullscreen()
439
+ if(this.state) this.exitFullscreen()
407
440
  this.$emit('close');
408
441
  },
409
442
  selectedDrag(){
@@ -588,4 +621,13 @@ export default {
588
621
  .zIndex10000{
589
622
  z-index: 10000;
590
623
  }
624
+ .zIndexSlot{
625
+ position: absolute;
626
+ top: 0;
627
+ right: 0;
628
+ left: 0;
629
+ bottom: 0;
630
+ z-index: 5;
631
+ background-color: rgba(255,255,255,0);
632
+ }
591
633
  </style>
@@ -54,9 +54,9 @@ export function butJson(editor, data) {
54
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>
55
55
  <p data-signid="lookUp"><strong><span style="font-size: 18px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
56
56
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></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>
57
+ <p data-signid="title-1" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
58
58
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
59
- <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
59
+ <p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
60
60
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
61
61
  <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>
62
62
  <p data-signid="date" style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
@@ -66,11 +66,11 @@ export function butJson(editor, data) {
66
66
  key: 'newsFormat',
67
67
  menuKeys: [],
68
68
  html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>
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>
69
+ <p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>
70
70
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></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>
71
+ <p data-signid="title-1" class="title ${randomId()} "><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
72
72
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
73
- <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
73
+ <p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
74
74
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
75
75
  <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>
76
76
  <p data-signid="date" style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
@@ -80,13 +80,13 @@ export function butJson(editor, data) {
80
80
  key: 'paperFormat',
81
81
  menuKeys: [],
82
82
  html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入题目</span></strong></p>
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>
83
+ <p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者</span></p>
84
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
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>
86
86
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></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>
87
+ <p data-signid="title-1" class="title ${randomId()}"><strong><span style="font-size: 20px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
88
88
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
89
- <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
89
+ <p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
90
90
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
91
91
  <p data-signid="splitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
92
92
  <p data-signid="annotation" contenteditable="false" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">注释</span></strong></p>
@@ -210,7 +210,7 @@ export function butJson(editor, data) {
210
210
  name: '作者',
211
211
  key: 'authorMenu',
212
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>`
213
+ html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
214
214
  },
215
215
  {name: '一级标题', key: 'title-1'},
216
216
  {name: '二级标题', key: 'title-2'},
@@ -237,13 +237,19 @@ export function butJson(editor, data) {
237
237
  name: '一级标题',
238
238
  key: 'firstLevelHeading',
239
239
  menuKeys: [],
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>`
240
+ html: `<p data-signid="title-1" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
241
241
  },
242
242
  secondaryHeading: {
243
243
  name: '二级标题',
244
244
  key: 'secondaryHeading',
245
245
  menuKeys: [],
246
- html: `<p data-signid="title-2" class="title ${randomId()} indent"><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></p>`
246
+ html: `<p data-signid="title-2" class="title ${randomId()}"><span style="font-size: 16px; font-family: SimHei; color:#333333">(二)请在此处输入二级标题</span></p>`
247
+ },
248
+ level3Heading: {
249
+ name: '三级标题',
250
+ key: 'level3Heading',
251
+ menuKeys: [],
252
+ html: `<p data-signid="title-3" class="title ${randomId()}"><span style="font-size: 16px; font-family: SimHei; color:#333333">(三)请在此处输入三级标题</span></p>`
247
253
  },
248
254
  paragraphBody: {
249
255
  name: '正文文本',
@@ -326,7 +332,7 @@ export function butJson(editor, data) {
326
332
  name: '作者',
327
333
  key: 'authorMenu',
328
334
  menuKeys: [],
329
- 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>`
335
+ html: `<p class="author" data-signId="author" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiT;">${menusData(data, 'authorMenu').text}</span></p>`
330
336
  },
331
337
  numberMenu: {
332
338
  name: '参考编号',
@@ -1197,7 +1197,6 @@ export default {
1197
1197
  this.limits = true
1198
1198
  },
1199
1199
  onUpdate: ({editor}) => {
1200
- _this.$emit('changeOutlineMenu', _this.changeOutlineMenu())
1201
1200
  editor.commands.focus()
1202
1201
  const json = editor.getJSON()
1203
1202
  for (let i = 0; i < json.content.length; i++) {
@@ -1251,6 +1250,7 @@ export default {
1251
1250
  _this.interpositionData = []
1252
1251
  }
1253
1252
  }
1253
+ _this.$emit('changeOutlineMenu', _this.changeOutlineMenu())
1254
1254
  },
1255
1255
  onTransaction: () => {
1256
1256
  const index = _this.editor.state.selection.$anchor.path[1]
@@ -2911,7 +2911,7 @@ export default {
2911
2911
  // {name: '四级标题', key: 'title-4'},
2912
2912
  {name: '正文文本', key: 'text'},]
2913
2913
  }
2914
- if(this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
2914
+ if(this.templateType === 'newsFormat'){
2915
2915
  obj.menuKeys = [
2916
2916
  {
2917
2917
  name: '文章标题',
@@ -2923,13 +2923,32 @@ export default {
2923
2923
  name: '作者',
2924
2924
  key: 'authorMenu',
2925
2925
  menuKeys: [],
2926
- 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>`
2926
+ html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
2927
2927
  },
2928
2928
  {name: '一级标题', key: 'title-1'},
2929
2929
  {name: '二级标题', key: 'title-2'},
2930
2930
  // {name: '三级标题', key: 'title-3'},
2931
2931
  // {name: '四级标题', key: 'title-4'},
2932
2932
  {name: '正文文本', key: 'text'},]
2933
+ }else if(this.templateType === 'paperFormat'){
2934
+ obj.menuKeys = [
2935
+ {
2936
+ name: '文章标题',
2937
+ key: 'subjectMenu',
2938
+ menuKeys: [],
2939
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>`
2940
+ },
2941
+ {
2942
+ name: '作者',
2943
+ key: 'authorMenu',
2944
+ menuKeys: [],
2945
+ html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
2946
+ },
2947
+ {name: '一级标题', key: 'title-1'},
2948
+ {name: '二级标题', key: 'title-2'},
2949
+ {name: '三级标题', key: 'title-3'},
2950
+ // {name: '四级标题', key: 'title-4'},
2951
+ {name: '正文文本', key: 'text'},]
2933
2952
  }
2934
2953
  this.butData.push(obj)
2935
2954
  return
@@ -3328,28 +3347,7 @@ export default {
3328
3347
  // 大纲级别
3329
3348
  if (data.key === 'outlineMenu') {
3330
3349
  const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
3331
- if (this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
3332
- const level = key.key.split('-')[1]
3333
- // 一级标题
3334
- if (level === '1') {
3335
- const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
3336
- this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3337
- this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3338
- }
3339
- // 二级标题
3340
- if (level === '2') {
3341
- const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
3342
- this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3343
- this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3344
- }
3345
- // 正文
3346
- if (key.key === 'text') {
3347
- const html = butJson(this.editor, this.menusText)['paragraphBody'].html
3348
- this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3349
- }
3350
- return
3351
- }
3352
-
3350
+ if (!key.key)return
3353
3351
  // 题目
3354
3352
  if (key.key === 'subjectMenu') {
3355
3353
  const html = menusHtml.filter(item => item.key == key.key)[0].html
@@ -3401,6 +3399,56 @@ export default {
3401
3399
  officialDocumentFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3402
3400
  newsFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3403
3401
  }
3402
+
3403
+ if (this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
3404
+ const level = key.key.split('-')[1]
3405
+ // 一级标题
3406
+ if (level === '1') {
3407
+ const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
3408
+ if(this.templateType === 'paperFormat'){
3409
+ const obj1 = sizeObj1[this.templateType]
3410
+ let from = this.selection()
3411
+ this.editor.chain().focus().insertContentAt(from, html).run()
3412
+ this.editor.chain().setTextSelection({ from: from, to: from+14 }).setFontSize(obj1.size).setTextSelection(from+14).run()
3413
+ }else {
3414
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3415
+ }
3416
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3417
+ }
3418
+ // 二级标题
3419
+ if (level === '2') {
3420
+ const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
3421
+ if(this.templateType === 'paperFormat'){
3422
+ const obj2 = sizeObj2[this.templateType]
3423
+ let from = this.selection()
3424
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3425
+ this.editor.chain().setTextSelection({ from: from, to: from+15 }).setFontSize(obj2.size).setTextSelection(from+15).run()
3426
+ }else {
3427
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3428
+ }
3429
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3430
+ }
3431
+ // 三级标题
3432
+ if (level === '3') {
3433
+ const html = butJson(this.editor, this.menusText)['level3Heading'].html
3434
+ if(this.templateType === 'paperFormat'){
3435
+ const obj3 = sizeObj3[this.templateType]
3436
+ let from = this.selection()
3437
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3438
+ this.editor.chain().setTextSelection({ from: from, to: from+15 }).setFontSize(obj3.size).setTextSelection(from+15).run()
3439
+ }else {
3440
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3441
+ }
3442
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3443
+ }
3444
+ // 正文
3445
+ if (key.key === 'text') {
3446
+ const html = butJson(this.editor, this.menusText)['paragraphBody'].html
3447
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3448
+ }
3449
+ return
3450
+ }
3451
+
3404
3452
  if (key.key === 'text') {
3405
3453
  this.tipTitle = window.getSelection().toString()
3406
3454
  if (this.tipTitle.length === 0) {
@@ -14,18 +14,16 @@ selectItem 传入当前选择的节点,是一个对象
14
14
  <template>
15
15
  <div>
16
16
  <div
17
- class="lineHeight30"
18
- :class="menuInfo.level === 0 ? '' : 'marginLeft14'"
17
+ :class="menuInfo.level === 0 ? '' : 'marginLeft14'"
18
+ class="lineHeight30"
19
19
  >
20
20
  <div
21
- :class=" menuConfig.isShowLine ? 'dashed' : 'no_dashed'"
21
+ :class=" menuConfig.isShowLine ? 'dashed' : 'no_dashed'"
22
22
  >
23
- <div
24
- class="widthB100 ellipse cursor "
25
- :class="menuTitleStyle"
26
- @click.stop="clickItem(menuInfo)"
27
- :title="menuInfo.title"
28
- >
23
+ <div :class="menuTitleStyle"
24
+ :title="menuInfo.title"
25
+ class="widthB100 ellipse cursor "
26
+ @click.stop="clickItem(menuInfo)">
29
27
  <template v-if="menuConfig.isCheckBox">
30
28
  <checkBox v-model="menuConfig.checkBoxValue" :value="menuInfo.catalogId"></checkBox>
31
29
  </template>
@@ -33,21 +31,23 @@ selectItem 传入当前选择的节点,是一个对象
33
31
  </div>
34
32
  <div v-show="menuConfig.isShowUpDown && menuInfo.children">
35
33
  <template v-if="menuConfig.isShowBtn">
36
- <button class="z-button" @click="clickFont(menuInfo)">{{menuInfo.isShowUpDown ? '收&ensp;&ensp;起': '展&ensp;&ensp;开'}}</button>
34
+ <button class="z-button" @click="clickFont(menuInfo)">
35
+ {{ menuInfo.isShowUpDown ? '收&ensp;&ensp;起' : '展&ensp;&ensp;开' }}
36
+ </button>
37
37
  </template>
38
38
  <template v-else>
39
- <span class="iconfont" v-html="defaultFont" @click="clickFont(menuInfo)"></span>
39
+ <span class="iconfont" @click="clickFont(menuInfo)" v-html="defaultFont"></span>
40
40
  </template>
41
41
  </div>
42
42
  </div>
43
43
  <div v-show="menuInfo.isShowUpDown">
44
44
  <div v-for="(item, index) in menuInfo.children" :key="index">
45
45
  <zydx-menu-tree-info
46
- :menuConfig="menuConfig"
47
- :selectItem="selectItem"
48
- :menu-info="item"
49
- :nodeLevel="nodeLevel"
50
- @clickItem="clickItem"
46
+ :menu-info="item"
47
+ :menuConfig="menuConfig"
48
+ :nodeLevel="nodeLevel"
49
+ :selectItem="selectItem"
50
+ @clickItem="clickItem"
51
51
  >
52
52
  </zydx-menu-tree-info>
53
53
  </div>
@@ -68,17 +68,17 @@ export default {
68
68
  props: {
69
69
  // 目录配置
70
70
  menuConfig: {
71
- type: Object,
72
- default: function () {
73
- return {
74
- isShowUpDown: false, // 是否显示收起展开
75
- isShowLine: false, // 是否显示下划线
76
- isShowBtn: false, // 显示按钮或者图标
77
- isCheckBox: false, // 是否显示复选框
78
- isUnifyFontSize: false, // 字体是否需要统一字号,
79
- checkBoxValue: [], // 复选款选中的值
80
- };
81
- }
71
+ type: Object,
72
+ default: function () {
73
+ return {
74
+ isShowUpDown: false, // 是否显示收起展开
75
+ isShowLine: false, // 是否显示下划线
76
+ isShowBtn: false, // 显示按钮或者图标
77
+ isCheckBox: false, // 是否显示复选框
78
+ isUnifyFontSize: false, // 字体是否需要统一字号,
79
+ checkBoxValue: [], // 复选款选中的值
80
+ };
81
+ }
82
82
  },
83
83
  // 显示可操作节点
84
84
  nodeLevel: {
@@ -109,21 +109,24 @@ export default {
109
109
  let ar = [];
110
110
  ar.push("level" + this.menuInfo.level);
111
111
  if (!this.menuConfig.isUnifyFontSize) {
112
- if (parseInt(this.menuInfo.level) == 0) {
113
- ar.push("text_center");
114
- }
115
- if (parseInt(this.menuInfo.level) == 0 || parseInt(this.menuInfo.level) == 1) {
116
- ar.push("font_border");
117
- }
112
+ if (parseInt(this.menuInfo.level) == 0) {
113
+ ar.push("text_center");
114
+ }
115
+ if (parseInt(this.menuInfo.level) == 0 || parseInt(this.menuInfo.level) == 1) {
116
+ ar.push("font_border");
117
+ }
118
+ }
119
+ if (this.menuInfo.hasData !== undefined && !this.menuInfo.hasData) {
120
+ ar.push("disable");
118
121
  }
119
122
  if (parseInt(this.menuInfo.level) > parseInt(this.nodeLevel)) {
120
123
  ar.push("disable");
121
124
  }
122
125
  // 如果显示复选。 怎不显示高亮
123
126
  if (!this.menuConfig.isCheckBox) {
124
- if (this.selectItem && (this.selectItem.catalogId === this.menuInfo.catalogId)) {
125
- ar.push("active");
126
- }
127
+ if (this.selectItem && (this.selectItem.catalogId === this.menuInfo.catalogId)) {
128
+ ar.push("active");
129
+ }
127
130
  }
128
131
  return ar;
129
132
  }
@@ -144,6 +147,7 @@ export default {
144
147
  font-family: "iconfont";
145
148
  src: url("./iconfont.ttf?t=1660878683989") format("truetype");
146
149
  }
150
+
147
151
  .iconfont {
148
152
  font-family: "iconfont" !important;
149
153
  font-size: 16px;
@@ -152,51 +156,64 @@ export default {
152
156
  -moz-osx-font-smoothing: grayscale;
153
157
  cursor: pointer;
154
158
  }
159
+
155
160
  .cursor {
156
161
  cursor: pointer;
157
162
  }
163
+
158
164
  .disable {
159
165
  color: #7c7c7c;
160
166
  pointer-events: none;
161
167
  cursor: default;
162
168
  }
169
+
163
170
  .border_bottom {
164
171
  border-bottom: 1px #cccccc dashed;
165
172
  }
173
+
166
174
  .active {
167
175
  color: #4B0C77;
168
176
  }
177
+
169
178
  .ellipse {
170
179
  text-overflow: ellipsis;
171
180
  white-space: nowrap;
172
181
  overflow: hidden;
173
182
  }
183
+
174
184
  .marginLeft14 {
175
185
  margin-left: 14px;
176
186
  }
187
+
177
188
  .widthB100 {
178
189
  width: 100%;
179
190
  }
191
+
180
192
  .dashed {
181
193
  display: flex;
182
194
  flex-direction: row;
183
195
  border-bottom: 1px #CCCCCC dashed;
184
196
  }
197
+
185
198
  .no_dashed {
186
199
  display: flex;
187
200
  flex-direction: row;
188
201
  border-bottom: 1px #FFFFFF dashed;
189
202
  }
203
+
190
204
  .lineHeight30 {
191
- line-height: 30px;
205
+ line-height: 30px;
192
206
  }
193
- .text_center {
194
- font-size: 16px;
195
- text-align: center;
196
- }
197
- .font_border {
198
- font-weight: bolder;
199
- }
207
+
208
+ .text_center {
209
+ font-size: 16px;
210
+ text-align: center;
211
+ }
212
+
213
+ .font_border {
214
+ font-weight: bolder;
215
+ }
216
+
200
217
  .z-button {
201
218
  margin: 1px;
202
219
  width: auto;
@@ -219,9 +236,11 @@ export default {
219
236
  font-weight: normal;
220
237
  box-sizing: border-box;
221
238
  }
239
+
222
240
  .level0 {
223
241
  font-weight: bold;
224
242
  }
243
+
225
244
  .level1 {
226
245
  font-weight: bold;
227
246
  }
@@ -24,6 +24,22 @@ export default {
24
24
  type: Boolean,
25
25
  default: true
26
26
  },
27
+ leftInitWidth:{
28
+ type: Number,
29
+ default: 310
30
+ },
31
+ leftMinWidth:{
32
+ type: Number,
33
+ default: 0
34
+ },
35
+ rightMinWidth:{
36
+ type: Number,
37
+ default: 0
38
+ },
39
+ isPercent: {
40
+ type: Boolean,
41
+ default: false
42
+ },
27
43
  },
28
44
  watch: {
29
45
  isShowsRight: {
@@ -59,29 +75,35 @@ export default {
59
75
  mounted() {
60
76
  },
61
77
  methods: {
62
- handleResize(leftMinWidth = 310, rightMinWidth = 310) {
78
+ handleResize() {
63
79
  // 获取Dom节点
64
80
  const boxDom = this.$refs.boxRef,
65
81
  leftDom = this.$refs.leftRef,
66
82
  resizeDom = this.$refs.resizeRef,
67
83
  rightDom = this.$refs.rightRef;
68
84
  if (resizeDom) {
69
- leftDom.style.width = '50%'
70
- rightDom.style.width = '50%'
85
+ const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
86
+ leftDom.style.width = `${this.isPercent?
87
+ this.leftInitWidth<=0||this.leftInitWidth>=100 ? 30 : this.leftInitWidth
88
+ : this.leftInitWidth}${this.isPercent? '%' : 'px'}`
89
+ rightDom.style.width = `${this.isPercent?
90
+ this.leftInitWidth<=0||this.leftInitWidth>=100 ? 70 : 100-this.leftInitWidth
91
+ : maxWidth-this.leftInitWidth}${this.isPercent? '%' : 'px'}`
92
+ /*leftDom.style.width = '50%'
93
+ rightDom.style.width = '50%'*/
71
94
  resizeDom.onmousedown = e => {
72
95
  const startX = e.clientX; // 记录坐标起始位置
73
96
  leftDom.left = leftDom.offsetWidth; // 左边元素起始宽度
74
97
  document.onmousemove = e => {
75
98
  const endX = e.clientX; // 鼠标拖动的终止位置
76
99
  let moveLen = leftDom.left + (endX - startX); // 移动的距离 = endX - startX,左边区域最后的宽度 = resizeDom.left + 移动的距离
77
- const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
78
100
  // 限制左边区域的最小宽度为 leftMinWidth
79
- if (moveLen < leftMinWidth) {
80
- moveLen = leftMinWidth;
101
+ if (moveLen < this.leftMinWidth) {
102
+ moveLen = this.leftMinWidth;
81
103
  }
82
104
  // 右边区域最小宽度为 rightMinWidth
83
- if (moveLen > maxWidth - rightMinWidth) {
84
- moveLen = maxWidth - rightMinWidth;
105
+ if (moveLen > maxWidth - this.rightMinWidth) {
106
+ moveLen = maxWidth - this.rightMinWidth;
85
107
  }
86
108
  leftDom.style.width = (moveLen / maxWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
87
109
  rightDom.style.width = ((maxWidth - moveLen) / maxWidth) * 100 + "%"; // 右边区域 = 总大小 - 左边宽度 - 拖动条宽度
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.528',
92
+ version: '1.35.530',
93
93
  install,
94
94
  Calendar,
95
95
  Message,