zydx-plus 1.35.608 → 1.35.610

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.608",
3
+ "version": "1.35.610",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -12,7 +12,14 @@
12
12
  <div class="ed-but" v-if="readOnly">
13
13
  <slot name='leftToolBtn'></slot>
14
14
  <div class="ed-head-but" v-for="(item,index) in toolbars" :key="index">
15
- <button v-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)" :disabled="disabled"
15
+ <div class="but-relative" v-if="item.key === 'h'">
16
+ <span>标题</span>
17
+ <div class="but-absolute">
18
+ <button class="buts" @click="toolTap('h2')">一级标题</button>
19
+ <button class="buts" @click="toolTap('h3')">二级标题</button>
20
+ </div>
21
+ </div>
22
+ <button v-else-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)" :disabled="disabled"
16
23
  :style="{color: (disabled) ? '#ccc' : (item.active)? '#4B0C77' :'#000'}">{{ item.title }}
17
24
  </button>
18
25
  <label v-else-if="item.key === 'upImg'">
@@ -93,12 +100,9 @@
93
100
  <svg style="cursor: pointer" @click="close" t="1698630749910" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4415" width="20" height="20"><path d="M726.976 274.432a16 16 0 0 0-22.656 0L512 466.752l-192.32-192.32a16 16 0 0 0-22.624 0l-22.656 22.624a16 16 0 0 0 0 22.624l192.32 192.32-192.32 192.32a16 16 0 0 0 0 22.656l22.656 22.624a16 16 0 0 0 22.624 0l192.32-192.32 192.32 192.32a16 16 0 0 0 22.656 0l22.624-22.624a16 16 0 0 0 0-22.624L557.28 512l192.32-192.352a16 16 0 0 0 0-22.624l-22.624-22.624z" fill="#fff" p-id="4416"></path></svg>
94
101
  </div>
95
102
  </div>
96
- <!-- <div class="editor-but" v-if="butText !== '' && readOnly">-->
97
- <!-- <button class="buts" @click="complete">{{ butText }}</button>-->
98
- <!-- </div>-->
99
103
  <div class="enclosure" v-if="uploadAttData.length > 0 && enclosureShow">
100
104
  <p :style="enclosureStyle">{{ enclosureText }}</p>
101
- <div class="enclosure-list" v-for="(item,index) in uploadAttData">
105
+ <div class="enclosure-list" v-for="(item,index) in uploadAttData" :key="index">
102
106
  <div class="enclosure-item" v-if="uploadAttData.length <= 1">
103
107
  <span v-if="item.name">{{ item.name }}</span>
104
108
  <span v-if="item.annexName">{{ item.annexName }}</span>
@@ -263,7 +267,7 @@ export default {
263
267
  },
264
268
  toolbar: {
265
269
  type: Array,
266
- default: []
270
+ default: () => []
267
271
  },
268
272
  title: {
269
273
  type: String,
@@ -304,11 +308,11 @@ export default {
304
308
  },
305
309
  uploadImage: {
306
310
  type: Object,
307
- default: {}
311
+ default: () => {}
308
312
  },
309
313
  uploadAttachment: {
310
314
  type: Object,
311
- default: {}
315
+ default: () => {}
312
316
  },
313
317
  delShow: {
314
318
  type: Boolean,
@@ -360,7 +364,7 @@ export default {
360
364
  },
361
365
  enclosureButton: {
362
366
  type: Object,
363
- default: {}
367
+ default: () => {}
364
368
  },
365
369
  updateStatus: {
366
370
  type: Boolean,
@@ -368,14 +372,14 @@ export default {
368
372
  },
369
373
  downName: {
370
374
  type: Array,
371
- default: []
375
+ default: () => []
372
376
  }
373
377
  },
374
378
  emits: ['see', 'del', 'complete', 'update:data', 'enclosureSuccess', 'download', 'updateData', 'syncDel','assets'],
375
379
  watch: {
376
380
  // 强制监听data变化
377
381
  data: {
378
- handler: function (e, oldVal) {
382
+ handler: function (e) {
379
383
  if(this.updateInit) return
380
384
  if(this.updateStatus) this.updateInit = true
381
385
  this.editor?.commands.setContent(json2html({node: "root", child: this.dataChange(e).html}))
@@ -384,7 +388,7 @@ export default {
384
388
  deep: true
385
389
  },
386
390
  readOnly: {
387
- handler: function (e, oldVal) {
391
+ handler: function (e) {
388
392
  this.editor.setOptions({
389
393
  editable: e
390
394
  })
@@ -395,26 +399,31 @@ export default {
395
399
  handler: function (e) {
396
400
  let status = null
397
401
  let upload = null
402
+ let title = null
398
403
  this.toolbars = []
399
404
  e.forEach(x => {
400
405
  if(x.key === 'but') {
401
406
  status = x
402
407
  } else if (x.key === 'uploadAtt') {
403
408
  upload = x
409
+ }else if(['h1','h2','h3','h4','h5','h6'].includes(x.key)) {
410
+ title = {key: 'h', title: '标题'}
404
411
  }else {
405
412
  this.toolbars.push(x)
406
413
  }
407
414
  })
415
+ if(title) this.toolbars.unshift(title) // 标题
408
416
  if(this.isShowWhiteboarde) this.toolbars.push({key: 'paint', title: '插入手写'})
409
417
  if(upload) this.toolbars.push(upload) // 上传附件
410
418
  if(this.voiceShow) this.toolbars.push({key: 'voice', title: '语音输入'})
411
419
  if(status) this.toolbars.push(status) // 之定义按钮
412
420
  if(this.isShowAiTool) this.toolbars.push({key: 'ai', title: 'AI助手'})
421
+ console.log(this.toolbars)
413
422
  },
414
423
  immediate: true
415
424
  },
416
425
  disabled: {
417
- handler: function (e, oldVal) {
426
+ handler: function (e) {
418
427
  this.editor.setOptions({
419
428
  editable: this.readOnly ?(!e):this.readOnly
420
429
  })
@@ -474,7 +483,7 @@ export default {
474
483
  _this.close()
475
484
  },
476
485
  // 获取焦点
477
- onFocus: (e) => {
486
+ onFocus: () => {
478
487
  this.limits = true
479
488
  },
480
489
  })
@@ -520,8 +529,6 @@ export default {
520
529
  const selection = window.getSelection();
521
530
  const selectedText = selection.toString()
522
531
  if (!selectedText || this.lastSelectedText === selectedText) return
523
- const clientX = e.clientX
524
- const clientY = e.clientX
525
532
  this.lastSelectedText = selectedText
526
533
  },
527
534
  showAssets() {
@@ -552,6 +559,7 @@ export default {
552
559
  this.imgSizeVal = 100
553
560
  this.editor.chain().setImageWidth('100%').focus().run()
554
561
  } else if(parseInt(e.target.value) < 10) {
562
+
555
563
  } else {
556
564
  if(this.lock) {
557
565
  this.lock = false
@@ -595,6 +603,7 @@ export default {
595
603
  },
596
604
  // 粘贴文本处理
597
605
  preventPaste(event) {
606
+ if(!this.readOnly) return
598
607
  // 删除选中的文本
599
608
  this.editor.chain().focus().deleteSelection().run()
600
609
  const text = event.clipboardData.getData('text/plain');
@@ -1368,4 +1377,37 @@ export default {
1368
1377
  color: #666;
1369
1378
  line-height: 30px;
1370
1379
  }
1380
+ .but-relative{
1381
+ position: relative;
1382
+ margin-left: 1px;
1383
+ font-size: 12px;
1384
+ background-color: transparent;
1385
+ border: 1px solid #000;
1386
+ border-radius: 3px;
1387
+ padding: 2px 5px;
1388
+ cursor: pointer;
1389
+ min-width: 60px;
1390
+ height: 21px;
1391
+ display: inline-block;
1392
+ line-height: 14px;
1393
+ box-sizing: border-box;
1394
+ -moz-text-align-last: justify;
1395
+ text-align-last: justify;
1396
+ word-break: break-all;
1397
+ text-justify: distribute;
1398
+ }
1399
+ .but-relative:hover .but-absolute{
1400
+ display: block;
1401
+ }
1402
+ .but-absolute{
1403
+ position: absolute;
1404
+ top: 20px;
1405
+ left: -2px;
1406
+ background: #fff;
1407
+ z-index: 1;
1408
+ display: none;
1409
+ }
1410
+ .but-absolute>button{
1411
+ margin-top: 1px;
1412
+ }
1371
1413
  </style>
@@ -8,6 +8,7 @@
8
8
  :placeholder="placeholder"
9
9
  :readonly="true"
10
10
  @click.stop="toggleDropDown"
11
+ :class="{'select-css-focus': isOpen}"
11
12
  class="select-css" />
12
13
 
13
14
  <span class="custom-select-icons" v-if="!readonly" @click.stop="toggleDropDown">
@@ -25,13 +26,19 @@
25
26
  <template v-if="!readonly">
26
27
  <template v-if="options.length">
27
28
  <ul v-if="isOpen"
29
+ @mouseleave="mouseleave"
28
30
  class="custom-select-options scroll"
29
31
  ref="dropdown"
30
32
  :style="{position: 'fixed', 'z-index': '30000', left: x + 'px', top: y + 'px', width: width + 'px', maxHeight: height + 'px'}">
31
33
  <li v-for="(option, idx) in options"
32
34
  :key="idx"
33
35
  :class="option.disable ? 'disable': ''"
34
- @click.stop="handleClick(option)">{{ option.label }}</li>
36
+ @click.stop="handleClick(option)">
37
+ <div class="countersign-image" v-if="multiple">
38
+ <img v-if="option.active" :src="countersign" alt=""/>
39
+ </div>
40
+ <span>{{ option.label }}</span>
41
+ </li>
35
42
  </ul>
36
43
  </template>
37
44
  </template>
@@ -59,6 +66,10 @@ export default defineComponent({
59
66
  type: String,
60
67
  default: ''
61
68
  },
69
+ multiple: {
70
+ type: Boolean,
71
+ default: false
72
+ },
62
73
  placeholder: {
63
74
  type: String,
64
75
  default: ''
@@ -87,11 +98,16 @@ export default defineComponent({
87
98
  x: 0,
88
99
  y: 0,
89
100
  width: 0,
90
- height: 300
101
+ height: 300,
102
+ countersign: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACQ9JREFUeF7tnX1SGzkQRzXevUfITZyTZEhtUtxi4RYspMzcBG6yzkFiL1/ZfIEttbo1mu6X/1KWWur361eDwQVD4h8EIPAqgQE2EIDA6wQQhOmAwAECCMJ4QABBmAEIyAjwBJFxY1cQAggSJGjalBFAEBk3dgUhgCBBgqZNGQEEkXFjVxACCBIkaNqUEUAQGTd2BSGAIEGCpk0ZAQSRcWNXEAIIEiRo2pQRQBAZN3YFIYAgQYKmTRkBBJFxY1cQAggSJGjalBFAEBk3dgUhgCBBgqZNGQEEkXFjVxACCBIkaNqUEUAQGTd2BSGAIEGCpk0ZAQSRcWNXEAIIEiRo2pQRQBAZN3YFIYAgQYKmTRkBBJFxY1cQAggSJGjalBFAEBk3dgUhgCBBgqZNGQEEkXFjVxACCBIkaNqUEUAQGTd2BSGAIEGCpk0ZAQSRcWNXEAIIEiRo2pQRQBAZN3Z1RGAcz07S6us6peFNSvsvafXHdvp8eadxRQTRoEiNWQiMf52t0253+8rh25TSNG2uLmouhyA19Ng7G4Hxw6e/7w8/P36BYUq74WKaLh+EKf6HIMXI2DA3gfH0420ahnX+PYZp2vxzmr/++0oEkVBjz2wEyuX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EEMRBiLRgRwBB7NhS2QEBBHEQIi3YEUAQO7ZUdkAAQRyESAt2BBDEji2VHRBAEAch0oIdAQSxY0tlBwQQxEGItGBHAEHs2FLZAQEEcRAiLdgRQBA7tlR2QABBHIRIC3YEEMSOLZUdEEAQByHSgh0BBLFjS2UHBBDEQYi0YEcAQezYUtkBAQRxECIt2BFAEDu2VHZAAEEchEgLdgQQxI4tlR0QQBAHIdKCHQEEsWNLZQcEEMRBiLRgRwBB7NhS2QEBBHEQIi3YEUAQO7ZUdkAAQRyESAt2BBDEji2VHRBAEAch0oIdAQSxY0tlBwQQxEGItGBH4D+fO44FzoWiMAAAAABJRU5ErkJggg=='
91
103
  }
92
104
  },
93
105
  emits: ['update:value', 'select'],
94
106
  methods: {
107
+ mouseleave() {
108
+ this.isOpen = false
109
+ window.removeEventListener('scroll', this.handler)
110
+ },
95
111
  toggleDropDown: function () {
96
112
  const winHeight = window.innerHeight
97
113
  const { x, y, width, height } = this.$refs.selectRef.getBoundingClientRect()
@@ -108,10 +124,19 @@ export default defineComponent({
108
124
  },
109
125
  handleClick: function (option) {
110
126
  if(option.disable) return
111
- this.$emit('update:value', option.value)
112
- this.$emit('select', option)
113
- this.selected = option.label
114
- this.isOpen = false
127
+ if(this.multiple) {
128
+ option.active = !option.active
129
+ let value = ''
130
+ this.options.forEach(x => {
131
+ if(x.active) value += `${x.value},`
132
+ })
133
+ this.$emit('update:value', value.slice(0, -1))
134
+ this.$emit('select', option)
135
+ }else {
136
+ this.$emit('update:value', option.value)
137
+ this.$emit('select', option)
138
+ this.isOpen = false
139
+ }
115
140
  },
116
141
  handler: function () {
117
142
  if (this.isOpen) {
@@ -136,8 +161,17 @@ export default defineComponent({
136
161
  this.selected = ''
137
162
  return
138
163
  }
139
- const { label } = this.options.find(option => option.value === v) || { label: '' }
140
- this.selected = label
164
+ const data = this.multiple? v.split(',') : v.split(',')[0]
165
+ let label = ''
166
+ this.options.forEach(x => {
167
+ if(data.includes(x.value)) {
168
+ x.active = true
169
+ label += `${x.label}、`
170
+ }else {
171
+ x.active = false
172
+ }
173
+ })
174
+ this.selected = label.slice(0, -1)
141
175
  },
142
176
  immediate: true,
143
177
  deep: true
@@ -169,6 +203,19 @@ export default defineComponent({
169
203
  margin-bottom: 1em;
170
204
  }
171
205
 
206
+ .countersign-image{
207
+ width: 14px;
208
+ height: 14px;
209
+ margin-right: 5px;
210
+ position: relative;
211
+ top: 2px;
212
+ display: inline-block;
213
+ }
214
+ .countersign-image>img{
215
+ width: 100%;
216
+ height: 100%;
217
+ }
218
+
172
219
  .custom-select {
173
220
  position: relative;
174
221
  }
@@ -213,7 +260,7 @@ export default defineComponent({
213
260
  border-color: #888;
214
261
  }
215
262
 
216
- .select-css:focus {
263
+ .select-css-focus {
217
264
  border-color: v-bind(hover);
218
265
  }
219
266
 
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div class="tagging" @click="leftClick">
3
3
  <div id="htmlText"></div>
4
- <div class="link" v-for="item in linkData"
4
+ <div class="link" v-for="(item,index) in linkData"
5
+ :key="index"
5
6
  :style="{width: item.width + 'px',
6
7
  top: item.leftY + 'px',
7
8
  left: item.leftX + 'px',
@@ -30,7 +31,7 @@
30
31
  <div class="tagging-right">
31
32
  <div class="tagging-title">批注指导</div>
32
33
  <div class="annotation" ref="scrollBox">
33
- <div class="annotation-list" @click="guidance(item.id,index)" :id="item.id" v-for="(item, index) in annotationsArr">
34
+ <div class="annotation-list" @click="guidance(item.id,index)" :id="item.id" v-for="(item, index) in annotationsArr" :key="index">
34
35
  <div class="list-title">
35
36
  <div class="list-left">
36
37
  <span>{{ teacher }}</span>
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.608',
90
+ version: '1.35.610',
91
91
  install,
92
92
  Calendar,
93
93
  Message,