zydx-plus 1.33.355 → 1.33.357

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.355",
3
+ "version": "1.33.357",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -40,7 +40,7 @@ export function butJson(editor, data) {
40
40
  name: '文章题目',
41
41
  key: 'subjectMenu',
42
42
  menuKeys: [],
43
- 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>`
43
+ html: `<p data-signId="subject" style="text-align: center;padding-bottom: 10px;"><span style="color: rgb(0, 0, 0);font-size: 24px;font-family: SimHei;font-weight: 700;">${menusData(data, 'subjectMenu').text}</span></p>`
44
44
  }, {
45
45
  name: '作&nbsp;&nbsp;&nbsp;者',
46
46
  key: 'authorMenu',
@@ -57,17 +57,17 @@ export function butJson(editor, data) {
57
57
  name: '摘&nbsp;&nbsp;&nbsp;要',
58
58
  key: 'abstractMenu',
59
59
  menuKeys: [],
60
- html: `<p class="abstract" data-signId="abstract"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">摘要:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi"> 摘要内容...</span></p>`
60
+ html: `<p class="abstract" data-signId="abstract"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">摘要:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: FangSong"> 摘要内容...</span></p>`
61
61
  }, {
62
62
  name: '关键词',
63
63
  key: 'keywordMenu',
64
64
  menuKeys: [],
65
- html: `<p class="keyword" data-signId="keyword"><span contenteditable="false" style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">关键词:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi"> 关键词内容...</span></p>`
65
+ html: `<p class="keyword" data-signId="keyword"><span contenteditable="false" style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">关键词:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: FangSong"> 关键词内容...</span></p>`
66
66
  }, {
67
67
  name: '标&nbsp;&nbsp;&nbsp;题',
68
68
  key: 'paragraphTitle',
69
69
  menuKeys: [],
70
- html: `<p data-signId="title" class="indent"><span style="color: rgb(0, 0, 0);font-size: 16px;font-weight: 700;">标题名称</span></p>`
70
+ html: `<p data-signId="title" class="indent"><span style="color: rgb(0, 0, 0);font-size: 22px;font-weight: 700;">标题名称</span></p>`
71
71
  }, {
72
72
  name: '正&nbsp;&nbsp;&nbsp;文',
73
73
  key: 'paragraphBody',
@@ -108,17 +108,8 @@ export function butJson(editor, data) {
108
108
  name: '段落设置',
109
109
  key: 'paragraph',
110
110
  menuKeys: [
111
- // {name: '缩 进', key: 'indent'},
112
- // {name: '行间距', key: 'LineSpace',
113
- /*childMenuKeys: [
114
- {name: '1倍', key: '1'},
115
- {name: '1.25倍', key: '1.25'},
116
- {name: '1.5倍', key: '1.5'},
117
- {name: '2倍', key: '2'},
118
- {name: '2.5倍', key: '2.5'},
119
- {name: '3倍', key: '3'}
120
- ]*/
121
- // },
111
+ {name: '缩进设置', key: 'Retraction'},
112
+ {name: '间距设置', key: 'LineSpace'}
122
113
  ],
123
114
  },
124
115
  alignmentMode: {
@@ -220,7 +211,7 @@ export function butJson(editor, data) {
220
211
  name: '上传附件',
221
212
  key: 'group-upload',
222
213
  menuKeys: [],
223
- html: `<p contenteditable="false" data-signId="enclosure"><span style="font-weight: 700;font-size: 16px;">附件列表:</span></p>`
214
+ html: `<p data-signId="enclosure"><span style="font-weight: 700;font-size: 16px;">附件列表:</span></p>`
224
215
  },
225
216
  'group-image': {
226
217
  name: '插入图片',
@@ -17,7 +17,8 @@
17
17
  <ul v-for="(item2,index2) in item.menuKeys" style="position: relative">
18
18
  <li v-if="uploadTypeArr.indexOf(item2.key) !== -1">
19
19
  <label>
20
- <input :accept="acceptType[item2.key]" style="display: none;" type="file" @change="upload($event,item2.key)">
20
+ <input :accept="acceptType[item2.key]" style="display: none;" type="file"
21
+ @change="upload($event,item2.key)">
21
22
  <span v-html="item2.name"></span>
22
23
  </label>
23
24
  </li>
@@ -30,7 +31,8 @@
30
31
  <li v-for="(childItem,childIndex) in item2.childMenuKeys" @click="butTap(item,item2,childItem)">
31
32
  <!-- childItem.key === 'uploadImage'-->
32
33
  <label v-if=" uploadTypeArr.indexOf(childItem.key) !== -1 ">
33
- <input :accept="acceptType[childItem.key]" style="display: none;" type="file" @change="upload($event,childItem.key)">
34
+ <input :accept="acceptType[childItem.key]" style="display: none;" type="file"
35
+ @change="upload($event,childItem.key)">
34
36
  <span v-html="item2.name"></span>
35
37
  </label>
36
38
  <span v-else v-html="childItem.name"></span>
@@ -107,12 +109,14 @@
107
109
  </div>
108
110
  </div>
109
111
 
110
- <div v-if="page&&readOnly" :style="{width: (wit + 20) + 'px'}" class="read-only">
112
+ <div v-if="page&&readOnly" class="read-only">
113
+ <!-- :style="{width: (wit + 20) + 'px'}"-->
111
114
  <div v-if="signMenuShow" class="editing-header">
112
115
  <img :src="menusData('signMenu')?.ico" alt=""/>
113
116
  <span>{{ menusData('signMenu')?.text }}</span>
114
117
  </div>
115
- <div v-for="(item,index) in htmlArr" :key="index" :style="{height: wit * 1.6 + 'px',width: wit + 'px'}"
118
+ <!-- ,width: wit + 'px'-->
119
+ <div v-for="(item,index) in htmlArr" :key="index" :style="{height: wit * 1.6 + 'px'}"
116
120
  class="read-only-page" @click="menusTap">
117
121
  <div class="read-only-p" v-html="item"></div>
118
122
  <div class="read-only-a">{{ index + 1 }}/{{ htmlArr.length }}</div>
@@ -169,40 +173,47 @@
169
173
  </div>
170
174
  </div>
171
175
  <!-- 段落设置-->
172
- <zydx-drag-popup v-if="showDragPopup" :dragStatus="false" :enlargeShow="false" :minimize="false"
173
- :minimizeCir="false" height="450" @close="closeDragPopup">
176
+ <zydx-drag-popup
177
+ v-if="showRetractionPopup" :dragStatus="false" :enlargeShow="false" :minimize="false"
178
+ :minimizeCir="false" height="290" @close="closeDragPopup">
174
179
  <template #content>
175
180
  <div class="p-popup">
176
- <div class="p-popup-title">段落设置</div>
181
+ <div class="p-popup-title">缩进设置</div>
177
182
  <div class="p-popup-retraction">
178
- <h3>缩进:</h3>
179
- <div>
180
- <div class="p-popup-setting">
181
- <div class="name">左侧缩进</div>
182
- :<input v-model="paragraph.left" type="number"/>
183
- <p>px</p></div>
184
- <div class="p-popup-setting">
185
- <div class="name">右侧缩进</div>
186
- :<input v-model="paragraph.right" type="number"/>
187
- <p>px</p></div>
188
- </div>
183
+ <div class="p-popup-setting">
184
+ <div class="name">左侧缩进</div>
185
+ :<input v-model="paragraph.left" type="number" min="0" @input="checkNum"/>
186
+ <p>px</p></div>
187
+ <div class="p-popup-setting">
188
+ <div class="name">右侧缩进</div>
189
+ :<input v-model="paragraph.right" type="number" min="0" @input="checkNum"/>
190
+ <p>px</p></div>
191
+ </div>
192
+ <div class="tip-btnBox">
193
+ <div @click="paragraphSetting" v-html="`确定`"></div>
194
+ <div @click="closeDragPopup" v-html="`关闭`"></div>
189
195
  </div>
196
+ </div>
197
+ </template>
198
+ </zydx-drag-popup>
199
+ <zydx-drag-popup
200
+ v-if="showSpacingPopup" :dragStatus="false" :enlargeShow="false" :minimize="false"
201
+ :minimizeCir="false" height="320" @close="closeDragPopup">
202
+ <template #content>
203
+ <div class="p-popup">
204
+ <div class="p-popup-title">间距设置</div>
190
205
  <div class="p-popup-spacing">
191
- <h3>间距:</h3>
192
- <div>
193
- <div class="p-popup-setting">
194
- <div class="name">段前间距</div>
195
- :<input v-model="paragraph.top" type="number"/>
196
- <p>px</p></div>
197
- <div class="p-popup-setting">
198
- <div class="name">段后间距</div>
199
- :<input v-model="paragraph.bottom" type="number"/>
200
- <p>px</p></div>
201
- <div class="p-popup-setting">
202
- <div class="name">行距</div>
203
-
204
- <zydx-select v-model:value="paragraph.distance" :options="options" style="width: 300px"></zydx-select>
205
- </div>
206
+ <div class="p-popup-setting">
207
+ <div class="name">段前间距</div>:
208
+ <input v-model="paragraph.top" type="number" min="0" @input="checkNum"/>
209
+ <p>px</p></div>
210
+ <div class="p-popup-setting">
211
+ <div class="name">段后间距</div>:
212
+ <input v-model="paragraph.bottom" type="number" min="0" @input="checkNum"/>
213
+ <p>px</p></div>
214
+ <div class="p-popup-setting">
215
+ <div class="name">行距</div>:
216
+ <zydx-select v-model:value="paragraph.distance" :options="options" style="width: 300px"></zydx-select>
206
217
  </div>
207
218
  </div>
208
219
  <div class="tip-btnBox">
@@ -301,8 +312,8 @@
301
312
 
302
313
  <!-- 展示弹窗 -->
303
314
  <div v-for="(item,index) in interpositionData" :key="index">
304
- <zydx-drag-popup v-if="item.isShow" :minWidth="640" :minHeight="183"
305
- :enlargeShow="false" :minimize="false" :minimizeCir="false"
315
+ <zydx-drag-popup v-if="item.isShow" :enlargeShow="false" :minHeight="183"
316
+ :minWidth="640" :minimize="false" :minimizeCir="false"
306
317
  :title="titleDragPopup[item.type]?titleDragPopup[item.type]:'参考文献'" height="auto"
307
318
  width="auto" @close="closeDataShowPopup(item)">
308
319
  <template #content>
@@ -367,7 +378,7 @@
367
378
  v-html="'删除'"></div>
368
379
  </div>
369
380
  </div>
370
- <div style="min-width:600px;width: 600px" class="tip-box">
381
+ <div class="tip-box" style="min-width:600px;width: 600px">
371
382
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
372
383
  <div class="tip-boxContent">
373
384
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -386,7 +397,7 @@
386
397
  v-html="'删除'"></div>
387
398
  </div>
388
399
  </div>
389
- <div style="min-width:600px;width: 600px" class="tip-box">
400
+ <div class="tip-box" style="min-width:600px;width: 600px">
390
401
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
391
402
  <div class="tip-boxContent">
392
403
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -405,7 +416,7 @@
405
416
  v-html="'删除'"></div>
406
417
  </div>
407
418
  </div>
408
- <div style="min-width:600px;width: 600px" class="tip-box">
419
+ <div class="tip-box" style="min-width:600px;width: 600px">
409
420
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
410
421
  <div class="tip-boxContent">
411
422
  <zydx-read :url="item.url" style="height: 100%"></zydx-read>
@@ -424,7 +435,7 @@
424
435
  v-html="'删除'"></div>
425
436
  </div>
426
437
  </div>
427
- <div style="min-width:600px;width: 600px" class="tip-box">
438
+ <div class="tip-box" style="min-width:600px;width: 600px">
428
439
  <div class="tip-title" v-html="`${item.exegesis}`"></div>
429
440
  <div class="tip-boxContent">
430
441
  <iframe v-if="item.type === 'linkCourseware'" :src="item.url" frameborder="no" height="590"
@@ -461,26 +472,26 @@
461
472
 
462
473
 
463
474
  <!-- 链接注释-->
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>
475
+ <!-- <zydx-drag-popup v-if="isShowUpload" :dragStatus="false" :width="400"
476
+ :enlargeShow="false" :minimize="false" :height="200"
477
+ :minimizeCir="false" :title="'上传附件'" @close="isShowUpload=false">
478
+ <template #content>
479
+ <div class="upload-box">
480
+ <div class="check-upload">
481
+ <label>
482
+ <input type="checkbox" v-model="checkboxObj.value" :checked="checkboxObj.checked" @change="checkboxTao(checkboxObj)"/>
483
+ <span>{{ checkboxObj.label }}</span>
484
+ </label>
485
+ </div>
486
+ <div >
487
+ <label style="border:1px solid #000;border-radius: 3px;padding:2px 5px;">
488
+ <input :accept="acceptType['group-upload']" style="display: none;" type="file" @change="upload($event,'group-upload')">
489
+ <span v-html="'上传附件'"></span>
490
+ </label>
491
+ </div>
492
+ </div>
493
+ </template>
494
+ </zydx-drag-popup>-->
484
495
 
485
496
  </div>
486
497
  </template>
@@ -488,7 +499,6 @@
488
499
  <script>
489
500
  import exportWord from 'js-export-word'
490
501
  import mammoth from './mammoth.browser.min'
491
- import {html2json, json2html} from '../../utils/html2json.js'
492
502
  import {butJson} from './butJson'
493
503
  import {Editor, EditorContent} from '@tiptap/vue-3'
494
504
  import StarterKit from '@tiptap/starter-kit'
@@ -520,12 +530,13 @@ import viewSvg from "./view-svg.vue";
520
530
  import Recorder from 'js-audio-recorder'
521
531
  import zydxColoring from '../../coloring'
522
532
  import Message from '../../../components/tipBox/index';
523
- import Upload from '../../../components/upload' //上传文件
524
533
  import zydxTextarea from '../../textarea'
525
534
  import zydxRead from '../../read'
526
535
  import zydxDragPopup from '../../dragPopup'
527
536
  import zydxSelect from '../../select'
528
537
  import {exegesisId} from "./extend/exegesis-id";
538
+ import {html2json, json2html} from '../../utils/html2json.js'
539
+ import Upload from '../../../components/upload' //上传文件
529
540
 
530
541
  const img = require('./image/annotation.png')
531
542
  export default {
@@ -549,8 +560,8 @@ export default {
549
560
  },
550
561
  data() {
551
562
  return {
552
- checkboxObj:{value: '1', label: '是否开启缩进', checked: false},
553
- checkbox:false,
563
+ checkboxObj: {value: '1', label: '是否开启缩进', checked: false},
564
+ checkbox: false,
554
565
  titleDragPopup: {
555
566
  nounExplain: '链接名词',
556
567
  taggingMenu: '注释',
@@ -586,7 +597,7 @@ export default {
586
597
  uploadImage: 'image/*',
587
598
  },
588
599
  uploadTypeArr: [
589
- // 'group-upload',
600
+ 'group-upload',
590
601
  'importArticles',
591
602
  'importWorks',
592
603
  'videoLink',
@@ -637,7 +648,8 @@ export default {
637
648
  'textMenu', 'color', 'interposition'],
638
649
  bubbleData: {},
639
650
  htmlJson: [],
640
- showDragPopup: false,
651
+ showRetractionPopup: false,
652
+ showSpacingPopup: false,
641
653
  showTaggingMenu: false,
642
654
  titlePopup: '',
643
655
  options: [
@@ -918,7 +930,7 @@ export default {
918
930
  _this.encIndex = state.selection.$from.parent.attrs
919
931
  if (_this.encIndex && _this.encIndex.titleId) {
920
932
  let titleIdArr = state.selection.$from.parent.attrs.titleId.split(' ')
921
- return state.selection.$from.parent.attrs.titleId === 'mu' || titleIdArr.indexOf('mu')!==-1
933
+ return state.selection.$from.parent.attrs.titleId === 'mu' || titleIdArr.indexOf('mu') !== -1
922
934
  } else {
923
935
  return false
924
936
  }
@@ -1107,7 +1119,7 @@ export default {
1107
1119
  },
1108
1120
  emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee'],
1109
1121
  methods: {
1110
- checkboxTao(checkboxObj){
1122
+ checkboxTao(checkboxObj) {
1111
1123
  this.checkbox = checkboxObj.value
1112
1124
  },
1113
1125
  closeDataShowPopup(item) {
@@ -2021,18 +2033,19 @@ export default {
2021
2033
  // const b = await this.signIdData('paragraph')
2022
2034
  const t = await this.signIdData('enclosure')
2023
2035
  const r = await this.signIdData('reference')
2036
+ console.log('menusText', this.menusText)
2024
2037
  const html = butJson(this.editor, this.menusText)[v].html
2025
- if(r===-1){
2038
+ if (r === -1) {
2026
2039
  const last = this.editor.state.selection.$anchor.path[0].content.size
2027
2040
  if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
2028
2041
  const num = this.upSort(this.editor, 'enclosure')
2029
2042
  const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
2030
2043
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
2031
- const json = this.editor.getJSON()
2044
+ const json = this.editor.getJSON()
2032
2045
  for (let i = 0; i < json.content.length; i++) {
2033
2046
  const item = json.content[i]
2034
- if( item.attrs.signId === 'enclosure'&&item.content[0].text==='附件列表:'){
2035
- item.attrs.titleId = this.checkbox? 'indent' : null
2047
+ if (item.attrs.signId === 'enclosure' && item.content[0].text === '附件列表:') {
2048
+ item.attrs.titleId = this.checkbox ? 'indent' : null
2036
2049
  }
2037
2050
  }
2038
2051
  this.editor.chain().setContent(<p></p>).run()
@@ -2041,15 +2054,15 @@ export default {
2041
2054
  return
2042
2055
  }
2043
2056
  const num1 = this.upSort(this.editor, 'reference')
2044
- if (t === -1) this.editor.chain().focus().insertContentAt(num1.len-7, html).run()
2057
+ if (t === -1) this.editor.chain().focus().insertContentAt(num1.len - 7, html).run()
2045
2058
  const num = this.upSort(this.editor, 'enclosure')
2046
2059
  const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
2047
2060
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
2048
- const json = this.editor.getJSON()
2061
+ const json = this.editor.getJSON()
2049
2062
  for (let i = 0; i < json.content.length; i++) {
2050
2063
  const item = json.content[i]
2051
- if( item.attrs.signId === 'enclosure'&&item.content[0].text==='附件列表:'){
2052
- item.attrs.titleId = this.checkbox? 'indent' : null
2064
+ if (item.attrs.signId === 'enclosure' && item.content[0].text === '附件列表:') {
2065
+ item.attrs.titleId = this.checkbox ? 'indent' : null
2053
2066
  }
2054
2067
  }
2055
2068
  this.editor.chain().setContent(<p></p>).run()
@@ -2428,8 +2441,8 @@ export default {
2428
2441
  const n = await this.signIdData('enclosure')//附件
2429
2442
  const a = await this.signIdData('reference')//参考文献
2430
2443
  if (b === -1) {
2431
- if(n===-1){
2432
- if(a===-1){
2444
+ if (n === -1) {
2445
+ if (a === -1) {
2433
2446
  if (r === -1) this.editor.chain().focus().insertContentAt(last, html).run()
2434
2447
  return
2435
2448
  }
@@ -2451,8 +2464,8 @@ export default {
2451
2464
  const r = await this.signIdData('ack')
2452
2465
  const b = await this.signIdData('enclosure')//附件
2453
2466
  const a = await this.signIdData('reference')//参考文献
2454
- if(b===-1){
2455
- if(a===-1){
2467
+ if (b === -1) {
2468
+ if (a === -1) {
2456
2469
  if (r === -1) {
2457
2470
  this.editor.chain().focus().insertContentAt(last, html[0]).run()
2458
2471
  this.editor.chain().focus().insertContentAt(last + 3, html[1]).run()
@@ -2462,13 +2475,13 @@ export default {
2462
2475
  const num = this.upSort(this.editor, 'reference')
2463
2476
  if (r === -1) {
2464
2477
  this.editor.chain().focus().insertContentAt(num.len - 7, html[0]).run()
2465
- this.editor.chain().focus().insertContentAt(num.len-3, html[1]).run()
2478
+ this.editor.chain().focus().insertContentAt(num.len - 3, html[1]).run()
2466
2479
  }
2467
2480
  return
2468
2481
  }
2469
2482
  const num = this.selectionPath('enclosure')
2470
2483
  if (r === -1) {
2471
- this.editor.chain().focus().insertContentAt(num-7, html[0]).run()
2484
+ this.editor.chain().focus().insertContentAt(num - 7, html[0]).run()
2472
2485
  const ackNum = this.selectionPath('ack')
2473
2486
  this.editor.chain().focus().insertContentAt(ackNum, html[1]).run()
2474
2487
  }
@@ -2509,33 +2522,29 @@ export default {
2509
2522
  // 段落
2510
2523
  if (data.key === 'paragraph') {
2511
2524
  this.menuStast = 'paragraph'
2512
- // if (key.key === 'indent') {
2513
- // let titleId = this.editor.getAttributes('paragraph').titleId
2514
- // if (titleId === 'indent') {
2515
- // this.editor.commands.unsetTitleId()
2516
- // return
2517
- // }
2518
- // this.editor.commands.setTitleId('indent')
2519
- // }
2520
- // if (key.key === 'LineSpace') {
2521
- // }
2522
- this.showDragPopup = true
2523
2525
  const index = this.editor.state.selection.$anchor.path[1]
2524
2526
  const json = this.editor.getJSON()
2525
2527
  const margin = json.content[index].attrs.margin
2526
- console.log('attrs',json.content[index].attrs)
2528
+ console.log('attrs', json.content[index].attrs)
2527
2529
  const lineHeight = json.content[index].attrs.lineHeightId
2528
- if (!margin === false) {
2529
- const marginArr = margin.split(' ').map(item => item.replace('px', ''))
2530
- this.paragraph.top = marginArr[0]
2531
- this.paragraph.right = marginArr[1]
2532
- this.paragraph.bottom = marginArr[2]
2533
- this.paragraph.left = marginArr[3]
2530
+ if (key.key === 'Retraction') {
2531
+ this.showRetractionPopup = true
2532
+ if (!margin === false) {
2533
+ let marginArr = margin.split(' ').map(item => item.replace('px', ''))
2534
+ this.paragraph.right = marginArr[1]
2535
+ this.paragraph.left = marginArr[3]
2536
+ }
2534
2537
  }
2535
- if (!lineHeight === false) {
2536
- let child = ['1', '1.25', '1.5', '2', '2.5', '3']
2537
- const index = lineHeight.split('-')[1]
2538
- this.paragraph.distance = child[index - 1]
2538
+ if (key.key === 'LineSpace') {
2539
+ this.showSpacingPopup = true
2540
+ if (!lineHeight === false) {
2541
+ let marginArr = margin.split(' ').map(item => item.replace('px', ''))
2542
+ this.paragraph.top = marginArr[0]
2543
+ this.paragraph.bottom = marginArr[2]
2544
+ let child = ['1', '1.25', '1.5', '2', '2.5', '3']
2545
+ const index = lineHeight.split('-')[1]
2546
+ this.paragraph.distance = child[index - 1]
2547
+ }
2539
2548
  }
2540
2549
  }
2541
2550
  // 字体
@@ -2606,7 +2615,7 @@ export default {
2606
2615
  }
2607
2616
  // 插入
2608
2617
  if (data.key === 'interposition') {
2609
- if(key.key === 'group-upload'){
2618
+ if (key.key === 'group-upload') {
2610
2619
  this.isShowUpload = true
2611
2620
  }
2612
2621
  // 添加图片
@@ -2983,16 +2992,31 @@ export default {
2983
2992
  paragraphSetting() {
2984
2993
  const selectionIndex = this.editor.state.selection.$anchor.path[1]
2985
2994
  const json = this.editor.getJSON()
2995
+ const textAlign = json.content[selectionIndex].attrs.textAlign
2996
+ const lineHeightId = json.content[selectionIndex].attrs.lineHeightId
2997
+ const signId = json.content[selectionIndex].attrs.signId
2986
2998
  const titleId = json.content[selectionIndex].attrs.titleId
2987
2999
  this.editor.commands.setMargin(`${this.paragraph.top}px ${this.paragraph.right}px ${this.paragraph.bottom}px ${this.paragraph.left}px`)
2988
3000
  let child = ['1', '1.25', '1.5', '2', '2.5', '3']
2989
3001
  let index = this.paragraph?.distance ? child.indexOf(this.paragraph?.distance) + 1 : 2
2990
3002
  this.editor.commands.setLineHeightId(`ling-${index}`)
2991
- if(!titleId===false){
3003
+ if (!textAlign === false) {
3004
+ this.editor.commands.unsetTextAlign()
3005
+ this.editor.commands.setTextAlign(textAlign)
3006
+ }
3007
+ if(!lineHeightId === false){
3008
+ this.editor.commands.unsetLineHeightId()
3009
+ this.editor.commands.setLineHeightId(lineHeightId)
3010
+ }
3011
+ if(!signId === false){
3012
+ this.editor.commands.unsetSignId()
3013
+ this.editor.commands.setSignId(signId)
3014
+ }
3015
+ if(!titleId === false){
2992
3016
  this.editor.commands.unsetTitleId()
2993
3017
  this.editor.commands.setTitleId(titleId)
2994
3018
  }
2995
- this.showDragPopup = false
3019
+ this.closeDragPopup()
2996
3020
  },
2997
3021
  taggingMenuSubmit() {
2998
3022
  this.taggingText = this.$refs.textarea.getContent()
@@ -3000,7 +3024,7 @@ export default {
3000
3024
  Message({type: 'text', promptContent: '注释描述不能为空'})
3001
3025
  return
3002
3026
  }
3003
- const {from, to} = this.editor.state.selection
3027
+ const {to} = this.editor.state.selection
3004
3028
  let dataInfo = {
3005
3029
  id: `${new Date().getTime()}`,
3006
3030
  type: 'taggingMenu',
@@ -3075,7 +3099,8 @@ export default {
3075
3099
  },
3076
3100
 
3077
3101
  closeDragPopup() {
3078
- this.showDragPopup = false
3102
+ this.showSpacingPopup = false
3103
+ this.showRetractionPopup = false
3079
3104
  },
3080
3105
 
3081
3106
  close() {
@@ -3303,6 +3328,26 @@ export default {
3303
3328
  this.editor?.commands.setContent(json)
3304
3329
  }
3305
3330
  },
3331
+ checkNum(element) {
3332
+ var val= element.target.value;
3333
+ //匹配非数字
3334
+ var reg = new RegExp("([^0-9]*)","g");
3335
+ var ma = val.match(reg);
3336
+ //如果有非数字,替换成""
3337
+ if(ma.length>0){
3338
+ for(var k in ma){
3339
+ if(ma[k]!==""){
3340
+ val = val.replace(ma[k],"");
3341
+ }
3342
+ }
3343
+ }
3344
+ //可以为0,但不能以0开头
3345
+ if(val.startsWith("0")&&val.length>1){
3346
+ val = val.substring(1,val.length);
3347
+ }
3348
+ //赋值,这样实现的效果就是用户按下非数字不会有任何反应
3349
+ element.target.value = val;
3350
+ }
3306
3351
  }
3307
3352
  }
3308
3353
  </script>
@@ -3370,7 +3415,7 @@ export default {
3370
3415
  }
3371
3416
 
3372
3417
  :deep(p[data-signid="subject"]) {
3373
- padding-bottom: 15px;
3418
+ //padding-bottom: 15px;
3374
3419
  }
3375
3420
 
3376
3421
  :deep(.author) {
@@ -4016,18 +4061,18 @@ li {
4016
4061
  justify-content: flex-end;
4017
4062
  }
4018
4063
 
4019
- .check-upload label{
4064
+ .check-upload label {
4020
4065
  display: flex;
4021
4066
  flex-direction: row;
4022
4067
  align-items: center;
4023
4068
  line-height: 1;
4024
4069
  }
4025
4070
 
4026
- .check-upload span{
4071
+ .check-upload span {
4027
4072
  padding-left: 10px;
4028
4073
  }
4029
4074
 
4030
- .upload-box{
4075
+ .upload-box {
4031
4076
  padding: 50px 40px;
4032
4077
  height: 100%;
4033
4078
  display: flex;
@@ -100,6 +100,9 @@ export default {
100
100
  document.documentElement.scrollTop = 0
101
101
  }, 0)
102
102
  },
103
+ setOpacityForNextShapes(opacity){
104
+ this.editor.setOpacityForNextShapes(opacity)
105
+ },
103
106
  // 清空
104
107
  clear() {
105
108
  this.editor.store.loadSnapshot(clearJson)
@@ -139,12 +142,25 @@ export default {
139
142
  this.editor.setCurrentTool('arrow')
140
143
  },
141
144
  text(v) {
142
- this.styleProps('arrow', 'color').defaultValue = v?.color ?? 'black'
143
- this.styleProps('arrow', 'size').defaultValue = v?.size ?? 'm'
144
- this.styleProps('arrow', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
145
- this.styleProps('arrow', 'align').defaultValue = v?.align ?? 'start'
145
+ this.styleProps('text', 'color').defaultValue = v?.color ?? 'black'
146
+ this.styleProps('text', 'size').defaultValue = v?.size ?? 'm'
147
+ this.styleProps('text', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
148
+ this.styleProps('text', 'align').defaultValue = v?.align ?? 'start'
146
149
  this.editor.setCurrentTool('text')
147
150
  },
151
+ note(v) {
152
+ let verticalAlign = ['middle-legacy', 'start-legacy', 'end-legacy']
153
+ if(verticalAlign.indexOf(v?.align) !== -1){
154
+ let align = ['middle', 'start', 'end']
155
+ this.styleProps('note', 'verticalAlign').defaultValue = align[verticalAlign.indexOf(v?.align)] ?? 'middle'
156
+ }else {
157
+ this.styleProps('note', 'align').defaultValue = v?.align ?? 'start'
158
+ }
159
+ this.styleProps('note', 'color').defaultValue = v?.color ?? 'black'
160
+ this.styleProps('note', 'size').defaultValue = v?.size ?? 'm'
161
+ this.styleProps('note', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
162
+ this.editor.setCurrentTool('note')
163
+ },
148
164
  line(v) {
149
165
  this.styleProps('arrow', 'color').defaultValue = v?.color ?? 'black'
150
166
  this.styleProps('arrow', 'size').defaultValue = v?.size ?? 'm'
package/src/index.js CHANGED
@@ -83,7 +83,7 @@ function install(app) {
83
83
  }
84
84
 
85
85
  export default {
86
- version: '1.33.355',
86
+ version: '1.33.357',
87
87
  install,
88
88
  Calendar,
89
89
  Message,