zydx-plus 1.33.353 → 1.33.354

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.33.353",
3
+ "version": "1.33.354",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -4,8 +4,7 @@
4
4
  <div v-for="(item,index) in butData" class="editor-but">
5
5
  <div v-if="uploadTypeArr.indexOf(item.key) !== -1" class="editor-but-name">
6
6
  <label>
7
- <input :accept="acceptType[item.key]" style="display: none;" type="file"
8
- @change="upload($event,item.key)">
7
+ <input :accept="acceptType[item.key]" style="display: none;" type="file" @change="upload($event,item.key)">
9
8
  <span v-html="item.name"></span>
10
9
  </label>
11
10
  </div>
@@ -18,8 +17,7 @@
18
17
  <ul v-for="(item2,index2) in item.menuKeys" style="position: relative">
19
18
  <li v-if="uploadTypeArr.indexOf(item2.key) !== -1">
20
19
  <label>
21
- <input :accept="acceptType[item2.key]" style="display: none;" type="file"
22
- @change="upload($event,item2.key)">
20
+ <input :accept="acceptType[item2.key]" style="display: none;" type="file" @change="upload($event,item2.key)">
23
21
  <span v-html="item2.name"></span>
24
22
  </label>
25
23
  </li>
@@ -32,8 +30,7 @@
32
30
  <li v-for="(childItem,childIndex) in item2.childMenuKeys" @click="butTap(item,item2,childItem)">
33
31
  <!-- childItem.key === 'uploadImage'-->
34
32
  <label v-if=" uploadTypeArr.indexOf(childItem.key) !== -1 ">
35
- <input :accept="acceptType[childItem.key]" style="display: none;" type="file"
36
- @change="upload($event,childItem.key)">
33
+ <input :accept="acceptType[childItem.key]" style="display: none;" type="file" @change="upload($event,childItem.key)">
37
34
  <span v-html="item2.name"></span>
38
35
  </label>
39
36
  <span v-else v-html="childItem.name"></span>
@@ -304,7 +301,7 @@
304
301
 
305
302
  <!-- 展示弹窗 -->
306
303
  <div v-for="(item,index) in interpositionData" :key="index">
307
- <zydx-drag-popup v-if="item.isShow"
304
+ <zydx-drag-popup v-if="item.isShow" :minWidth="640" :minHeight="183"
308
305
  :enlargeShow="false" :minimize="false" :minimizeCir="false"
309
306
  :title="titleDragPopup[item.type]?titleDragPopup[item.type]:'参考文献'" height="auto"
310
307
  width="auto" @close="closeDataShowPopup(item)">
@@ -370,7 +367,7 @@
370
367
  v-html="'删除'"></div>
371
368
  </div>
372
369
  </div>
373
- <div :style="{width: item.type === 'linkCourseware'?'1280px':'885px'}" class="tip-box">
370
+ <div style="min-width:600px;width: 600px" class="tip-box">
374
371
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
375
372
  <div class="tip-boxContent">
376
373
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -389,7 +386,7 @@
389
386
  v-html="'删除'"></div>
390
387
  </div>
391
388
  </div>
392
- <div :style="{width: item.type === 'linkCourseware'?'1280px':'885px'}" class="tip-box">
389
+ <div style="min-width:600px;width: 600px" class="tip-box">
393
390
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
394
391
  <div class="tip-boxContent">
395
392
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -408,7 +405,7 @@
408
405
  v-html="'删除'"></div>
409
406
  </div>
410
407
  </div>
411
- <div :style="{width: item.type === 'linkCourseware'?'1280px':'885px'}" class="tip-box">
408
+ <div style="min-width:600px;width: 600px" class="tip-box">
412
409
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
413
410
  <div class="tip-boxContent">
414
411
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -427,7 +424,7 @@
427
424
  v-html="'删除'"></div>
428
425
  </div>
429
426
  </div>
430
- <div :style="{width: item.type === 'linkCourseware'?'1280px':'885px'}" class="tip-box">
427
+ <div style="min-width:600px;width: 600px" class="tip-box">
431
428
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
432
429
  <div class="tip-boxContent">
433
430
  <iframe v-if="item.type === 'linkCourseware'" :src="item.url" frameborder="no" height="590"
@@ -449,7 +446,7 @@
449
446
  v-html="'删除'"></div>
450
447
  </div>
451
448
  </div>
452
- <div class="tip-box" style="width: auto">
449
+ <div class="tip-box" style="min-width:600px;width: 600px">
453
450
  <div class="tip-boxContent">
454
451
  {{ item.text }}
455
452
  </div>
@@ -462,6 +459,29 @@
462
459
  </zydx-drag-popup>
463
460
  </div>
464
461
 
462
+
463
+ <!-- 链接注释-->
464
+ <zydx-drag-popup v-if="isShowUpload" :dragStatus="false" :width="400"
465
+ :enlargeShow="false" :minimize="false" :height="200"
466
+ :minimizeCir="false" :title="'上传附件'" @close="isShowUpload=false">
467
+ <template #content>
468
+ <div class="upload-box">
469
+ <div class="check-upload">
470
+ <label>
471
+ <input type="checkbox" v-model="checkboxObj.value" :checked="checkboxObj.checked" @change="checkboxTao(checkboxObj)"/>
472
+ <span>{{ checkboxObj.label }}</span>
473
+ </label>
474
+ </div>
475
+ <div >
476
+ <label style="border:1px solid #000;border-radius: 3px;padding:2px 5px;">
477
+ <input :accept="acceptType['group-upload']" style="display: none;" type="file" @change="upload($event,'group-upload')">
478
+ <span v-html="'上传附件'"></span>
479
+ </label>
480
+ </div>
481
+ </div>
482
+ </template>
483
+ </zydx-drag-popup>
484
+
465
485
  </div>
466
486
  </template>
467
487
 
@@ -500,6 +520,7 @@ import viewSvg from "./view-svg.vue";
500
520
  import Recorder from 'js-audio-recorder'
501
521
  import zydxColoring from '../../coloring'
502
522
  import Message from '../../../components/tipBox/index';
523
+ import Upload from '../../../components/upload' //上传文件
503
524
  import zydxTextarea from '../../textarea'
504
525
  import zydxRead from '../../read'
505
526
  import zydxDragPopup from '../../dragPopup'
@@ -528,6 +549,8 @@ export default {
528
549
  },
529
550
  data() {
530
551
  return {
552
+ checkboxObj:{value: '1', label: '是否开启缩进', checked: false},
553
+ checkbox:false,
531
554
  titleDragPopup: {
532
555
  nounExplain: '链接名词',
533
556
  taggingMenu: '注释',
@@ -549,6 +572,7 @@ export default {
549
572
  tipTitle: '',
550
573
  taggingText: '',
551
574
  isShowPopup: false,
575
+ isShowUpload: false,
552
576
  isShowExegesis: false,
553
577
  isShowFile: false,
554
578
  exegesisType: 'add',
@@ -562,7 +586,7 @@ export default {
562
586
  uploadImage: 'image/*',
563
587
  },
564
588
  uploadTypeArr: [
565
- 'group-upload',
589
+ // 'group-upload',
566
590
  'importArticles',
567
591
  'importWorks',
568
592
  'videoLink',
@@ -893,7 +917,8 @@ export default {
893
917
  shouldShow: ({editor, view, state, oldState, from, to}) => {
894
918
  _this.encIndex = state.selection.$from.parent.attrs
895
919
  if (_this.encIndex && _this.encIndex.titleId) {
896
- return state.selection.$from.parent.attrs.titleId === 'mu'
920
+ let titleIdArr = state.selection.$from.parent.attrs.titleId.split(' ')
921
+ return state.selection.$from.parent.attrs.titleId === 'mu' || titleIdArr.indexOf('mu')!==-1
897
922
  } else {
898
923
  return false
899
924
  }
@@ -1082,6 +1107,9 @@ export default {
1082
1107
  },
1083
1108
  emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee'],
1084
1109
  methods: {
1110
+ checkboxTao(checkboxObj){
1111
+ this.checkbox = checkboxObj.value
1112
+ },
1085
1113
  closeDataShowPopup(item) {
1086
1114
  item.isShow = false
1087
1115
  item.edit = false
@@ -1998,23 +2026,35 @@ export default {
1998
2026
  const last = this.editor.state.selection.$anchor.path[0].content.size
1999
2027
  if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
2000
2028
  const num = this.upSort(this.editor, 'enclosure')
2001
- const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="mu"><span>${num.num}. ${name}</span></p>`
2029
+ const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
2002
2030
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
2031
+ const json = this.editor.getJSON()
2032
+ for (let i = 0; i < json.content.length; i++) {
2033
+ const item = json.content[i]
2034
+ if( item.attrs.signId === 'enclosure'&&item.content[0].text==='附件列表:'){
2035
+ item.attrs.titleId = this.checkbox? 'indent' : null
2036
+ }
2037
+ }
2038
+ this.editor.chain().setContent(<p></p>).run()
2039
+ this.editor.chain().setContent(json).run()
2040
+ this.isShowUpload = false
2003
2041
  return
2004
2042
  }
2005
2043
  const num1 = this.upSort(this.editor, 'reference')
2006
2044
  if (t === -1) this.editor.chain().focus().insertContentAt(num1.len-7, html).run()
2007
2045
  const num = this.upSort(this.editor, 'enclosure')
2008
- const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="mu"><span>${num.num}. ${name}</span></p>`
2046
+ const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
2009
2047
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
2010
-
2011
- // if (b === -1) {
2012
- // } else {
2013
- // if (t === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('paragraph', b - 1), html).run()
2014
- // const num = this.upSort(this.editor, 'enclosure')
2015
- // const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="mu"><span>${num.num}. ${name}</span></p>`
2016
- // this.editor.chain().focus().insertContentAt(num.len, html2).run()
2017
- // }
2048
+ const json = this.editor.getJSON()
2049
+ for (let i = 0; i < json.content.length; i++) {
2050
+ const item = json.content[i]
2051
+ if( item.attrs.signId === 'enclosure'&&item.content[0].text==='附件列表:'){
2052
+ item.attrs.titleId = this.checkbox? 'indent' : null
2053
+ }
2054
+ }
2055
+ this.editor.chain().setContent(<p></p>).run()
2056
+ this.editor.chain().setContent(json).run()
2057
+ this.isShowUpload = false
2018
2058
  })
2019
2059
  }
2020
2060
  if (v === 'uploadImage') {
@@ -2475,13 +2515,15 @@ export default {
2475
2515
  // this.editor.commands.unsetTitleId()
2476
2516
  // return
2477
2517
  // }
2478
- // this.editor.commands.setTitleId(key.key)
2518
+ // this.editor.commands.setTitleId('indent')
2479
2519
  // }
2480
2520
  // if (key.key === 'LineSpace') {
2521
+ // }
2481
2522
  this.showDragPopup = true
2482
2523
  const index = this.editor.state.selection.$anchor.path[1]
2483
2524
  const json = this.editor.getJSON()
2484
2525
  const margin = json.content[index].attrs.margin
2526
+ console.log('attrs',json.content[index].attrs)
2485
2527
  const lineHeight = json.content[index].attrs.lineHeightId
2486
2528
  if (!margin === false) {
2487
2529
  const marginArr = margin.split(' ').map(item => item.replace('px', ''))
@@ -2495,7 +2537,6 @@ export default {
2495
2537
  const index = lineHeight.split('-')[1]
2496
2538
  this.paragraph.distance = child[index - 1]
2497
2539
  }
2498
- // }
2499
2540
  }
2500
2541
  // 字体
2501
2542
  if (data.key === 'titleMenu') {
@@ -2565,6 +2606,9 @@ export default {
2565
2606
  }
2566
2607
  // 插入
2567
2608
  if (data.key === 'interposition') {
2609
+ if(key.key === 'group-upload'){
2610
+ this.isShowUpload = true
2611
+ }
2568
2612
  // 添加图片
2569
2613
  if (key.key === 'group-image') {
2570
2614
  if (childKey.key === 'insertImage') {
@@ -2937,10 +2981,17 @@ export default {
2937
2981
  },
2938
2982
  // 段落设置
2939
2983
  paragraphSetting() {
2984
+ const selectionIndex = this.editor.state.selection.$anchor.path[1]
2985
+ const json = this.editor.getJSON()
2986
+ const titleId = json.content[selectionIndex].attrs.titleId
2940
2987
  this.editor.commands.setMargin(`${this.paragraph.top}px ${this.paragraph.right}px ${this.paragraph.bottom}px ${this.paragraph.left}px`)
2941
2988
  let child = ['1', '1.25', '1.5', '2', '2.5', '3']
2942
2989
  let index = this.paragraph?.distance ? child.indexOf(this.paragraph?.distance) + 1 : 2
2943
2990
  this.editor.commands.setLineHeightId(`ling-${index}`)
2991
+ if(!titleId===false){
2992
+ this.editor.commands.unsetTitleId()
2993
+ this.editor.commands.setTitleId(titleId)
2994
+ }
2944
2995
  this.showDragPopup = false
2945
2996
  },
2946
2997
  taggingMenuSubmit() {
@@ -3319,7 +3370,7 @@ export default {
3319
3370
  }
3320
3371
 
3321
3372
  :deep(p[data-signid="subject"]) {
3322
- padding-bottom: 20px;
3373
+ padding-bottom: 15px;
3323
3374
  }
3324
3375
 
3325
3376
  :deep(.author) {
@@ -3964,4 +4015,23 @@ li {
3964
4015
  flex-direction: row;
3965
4016
  justify-content: flex-end;
3966
4017
  }
4018
+
4019
+ .check-upload label{
4020
+ display: flex;
4021
+ flex-direction: row;
4022
+ align-items: center;
4023
+ line-height: 1;
4024
+ }
4025
+
4026
+ .check-upload span{
4027
+ padding-left: 10px;
4028
+ }
4029
+
4030
+ .upload-box{
4031
+ padding: 50px 40px;
4032
+ height: 100%;
4033
+ display: flex;
4034
+ flex-direction: column;
4035
+ justify-content: space-between;
4036
+ }
3967
4037
  </style>
package/src/index.js CHANGED
@@ -83,7 +83,7 @@ function install(app) {
83
83
  }
84
84
 
85
85
  export default {
86
- version: '1.33.353',
86
+ version: '1.33.354',
87
87
  install,
88
88
  Calendar,
89
89
  Message,