zydx-plus 1.35.562 → 1.35.563

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.562",
3
+ "version": "1.35.563",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1937,6 +1937,8 @@ export default {
1937
1937
  },
1938
1938
  // 粘贴文本处理
1939
1939
  preventPaste(event) {
1940
+ // 删除选中的文本
1941
+ this.editor.chain().focus().deleteSelection().run()
1940
1942
  const text = event.clipboardData.getData('text/plain');
1941
1943
  const text2 = text.replace(/[\r\n]/g, '').replace(/\s*/g, '')
1942
1944
  this.editor.chain().focus().insertContentAt(this.selection(), text2).run()
@@ -10,7 +10,7 @@
10
10
  <slot name='titleSuffix'></slot>
11
11
  </div>
12
12
  <div class="ed-but" v-if="readOnly">
13
- <div class="ed-head-but" v-for="(item,index) in toolbar">
13
+ <div class="ed-head-but" v-for="(item,index) in toolbars" :key="index">
14
14
  <button v-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)"
15
15
  :style="{color: (item.active)? '#4B0C77' :'#000'}">{{ item.title }}
16
16
  </button>
@@ -19,13 +19,13 @@
19
19
  :accept="(item.key === 'upImg')?'image/*':'.docx,.pptx,.pdf,.xlsx,.mp3,.mp4'" style="display: none;">
20
20
  <span class="buts">{{ item.title }}</span>
21
21
  </label>
22
+ <button v-else-if="item.key === 'paint'" class="buts" @click="toolTap('paint')">{{ item.title }}</button>
23
+ <button v-else-if="item.key === 'voice'" class="buts" @mousedown.stop="speechDown" @click="voice()"
24
+ :style="{color: (voiceStatus)? '#4B0C77' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
25
+ </button>
26
+ <button v-else-if="item.key === 'ai'" class="buts" @click="showAi">AI助手</button>
22
27
  <button v-else class="buts" @click="toolTap(item.key)">{{ item.title }}</button>
23
28
  </div>
24
- <button v-if='isShowWhiteboarde' class="buts" @click="toolTap('paint')">手写记录</button>
25
- <button v-if="voiceShow" class="buts" @mousedown.stop="speechDown" @click="voice()"
26
- :style="{color: (voiceStatus)? '#4B0C77' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
27
- </button>
28
- <button v-if='isShowAiTool' class="buts" @click="showAi">AI助手</button>
29
29
  <slot name='toolBtn'></slot>
30
30
  <button v-if="butText !== '' && readOnly" class="buts" @click="complete">{{ butText }}</button>
31
31
  </div>
@@ -372,12 +372,27 @@ export default {
372
372
  })
373
373
  },
374
374
  deep: true
375
+ },
376
+ toolbar: {
377
+ handler: function (e, oldVal) {
378
+ let status = null
379
+ this.toolbars = []
380
+ e.forEach(x => {
381
+ if(x.key === 'but') {
382
+ status = x
383
+ }else {
384
+ this.toolbars.push(x)
385
+ }
386
+ })
387
+ if(this.isShowWhiteboarde) this.toolbars.push({key: 'paint', title: '插入手写'})
388
+ if(this.voiceShow) this.toolbars.push({key: 'voice', title: '语音输入'})
389
+ if(status) this.toolbars.push(status)
390
+ if(this.isShowAiTool) this.toolbars.push({key: 'ai', title: 'AI助手'})
391
+ },
392
+ immediate: true
375
393
  }
376
394
  },
377
395
  mounted() {
378
- // document.addEventListener('mouseup', this.getSelectedText)
379
-
380
-
381
396
  let _this = this
382
397
  this.uploadAttData = (this.data.enclosure === undefined || this.data.enclosure === null || this.data.enclosure === 'null') ? [] : this.enclosureAction(this.data.enclosure)
383
398
  this.heightStyle = (this.height === '100%') ? {height: '100%'} : {'min-height': this.height}
@@ -535,6 +550,8 @@ export default {
535
550
  },
536
551
  // 粘贴文本处理
537
552
  preventPaste(event) {
553
+ // 删除选中的文本
554
+ this.editor.chain().focus().deleteSelection().run()
538
555
  const text = event.clipboardData.getData('text/plain');
539
556
  const text2 = text.replace(/[\r\n]/g, '').replace(/\s*/g, '')
540
557
  this.editor.chain().focus().insertContentAt(this.selection(), text2).run()
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.562',
92
+ version: '1.35.563',
93
93
  install,
94
94
  Calendar,
95
95
  Message,