zydx-plus 1.35.597 → 1.35.598

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.597",
3
+ "version": "1.35.598",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -10,21 +10,22 @@
10
10
  <slot name='titleSuffix'></slot>
11
11
  </div>
12
12
  <div class="ed-but" v-if="readOnly">
13
+ <slot name='leftToolBtn'></slot>
13
14
  <div class="ed-head-but" v-for="(item,index) in toolbars" :key="index">
14
- <button v-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)"
15
- :style="{color: (item.active)? '#4B0C77' :'#000'}">{{ item.title }}
15
+ <button v-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)" :disabled="disabled"
16
+ :style="{color: (disabled) ? '#ccc' : (item.active)? '#4B0C77' :'#000'}">{{ item.title }}
16
17
  </button>
17
18
  <label v-else-if="item.key === 'upImg' || item.key === 'uploadAtt'">
18
- <input type="file" @change="upload($event,item.key)"
19
- :accept="(item.key === 'upImg')?'image/*':'.docx,.pptx,.pdf,.xlsx,.mp3,.mp4'" style="display: none;">
20
- <span class="buts">{{ item.title }}</span>
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 ? '关闭语音' : '语音输入' }}
19
+ <input type="file" @change="upload($event,item.key)" :disabled="disabled"
20
+ :accept="(item.key === 'upImg')?'image/*':'.docx,.pptx,.pdf,.xlsx,.mp3,.mp4'" style="display: none;"/>
21
+ <span class="buts" :style="{color: ( disabled) ? '#ccc':'#000'}">{{ item.title }}</span>
22
+ </label >
23
+ <button v-else-if="item.key === 'paint'" class="buts" @click="toolTap('paint')" :disabled="disabled">{{ item.title }}</button>
24
+ <button v-else-if="item.key === 'voice'" class="buts" @mousedown.stop="speechDown" :disabled="disabled" @click="voice()"
25
+ :style="{color: (disabled) ? '#ccc' : (voiceStatus)? '#4B0C77' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
25
26
  </button>
26
- <button v-else-if="item.key === 'ai'" class="buts" @click="showAi">AI助手</button>
27
- <button v-else class="buts" @click="toolTap(item.key)">{{ item.title }}</button>
27
+ <button v-else-if="item.key === 'ai'" class="buts" :disabled="disabled" @click="showAi">AI助手</button>
28
+ <button v-else class="buts" @click="toolTap(item.key)" :disabled="disabled">{{ item.title }}</button>
28
29
  </div>
29
30
  <slot name='toolBtn'></slot>
30
31
  <button v-if="butText !== '' && readOnly" class="buts" @click="complete">{{ butText }}</button>
@@ -104,9 +105,9 @@
104
105
  </div>
105
106
  <div class="enclosure-item en-but">
106
107
  <div style="display: inline-block; height: 21px;">
107
- <button class="buts but-f" v-if="!item.name" @click="see(index)">{{downName[0] || '查看附件'}}</button>
108
- <button class="buts but-f" v-if="!item.name&&downloadShow" @click="download(index)">{{downName[1] || '下载附件'}}</button>
109
- <button class="buts but-f" v-if="delShow" @click="del(index)">
108
+ <button class="buts but-f" v-if="!item.name" :disabled="disabled" @click="see(index)">{{downName[0] || '查看附件'}}</button>
109
+ <button class="buts but-f" v-if="!item.name&&downloadShow" :disabled="disabled" @click="download(index)">{{downName[1] || '下载附件'}}</button>
110
+ <button class="buts but-f" v-if="delShow" @click="del(index)" :disabled="disabled">
110
111
  <span v-if="item.active">{{downName[2] || '删除附件'}}</span>
111
112
  <svg v-else xmlns="http://www.w3.org/2000/svg"
112
113
  width="14"
@@ -141,7 +142,8 @@
141
142
  </g>
142
143
  </svg>
143
144
  </button>
144
- <button class="buts but-f" v-if="Object.keys(enclosureButton).length > 0" @click="enclosureButton.onClick(item,index)">{{ enclosureButton.name }}</button>
145
+ <button class="buts but-f" :disabled="disabled" v-if="Object.keys(enclosureButton).length > 0"
146
+ @click="enclosureButton.onClick(item,index)">{{ enclosureButton.name }}</button>
145
147
  </div>
146
148
  </div>
147
149
  </div>
@@ -346,6 +348,10 @@ export default {
346
348
  type: Boolean,
347
349
  default: false
348
350
  },
351
+ disabled: {
352
+ type: Boolean,
353
+ default: false
354
+ },
349
355
  enclosureButton: {
350
356
  type: Object,
351
357
  default: {}
@@ -393,13 +399,21 @@ export default {
393
399
  this.toolbars.push(x)
394
400
  }
395
401
  })
396
- if(this.isShowWhiteboarde) this.toolbars.push({key: 'paint', title: '插入手写'})
402
+ if(this.isShowWhiteboarde) this.toolbars.push({key: 'paint',disabled:true, title: '插入手写'})
397
403
  if(upload) this.toolbars.push(upload) // 上传附件
398
404
  if(this.voiceShow) this.toolbars.push({key: 'voice', title: '语音输入'})
399
405
  if(status) this.toolbars.push(status) // 之定义按钮
400
406
  if(this.isShowAiTool) this.toolbars.push({key: 'ai', title: 'AI助手'})
401
407
  },
402
408
  immediate: true
409
+ },
410
+ disabled: {
411
+ handler: function (e, oldVal) {
412
+ this.editor.setOptions({
413
+ editable: this.readOnly ?(!e):this.readOnly
414
+ })
415
+ },
416
+ deep: true
403
417
  }
404
418
  },
405
419
  mounted() {
@@ -410,7 +424,7 @@ export default {
410
424
  this.heightStyleCont = (this.height === '100%') ? {height: 'calc(100% - 44px)'} : {'min-height': `${height}px`}
411
425
  this.editor = new Editor({
412
426
  content: json2html({node: "root", child: this.dataChange(this.data).html }),
413
- editable: this.readOnly,
427
+ editable: this.readOnly ?(!this.disabled):this.readOnly ,
414
428
  enablePasteRules: true,
415
429
  extensions: [
416
430
  sid,
@@ -503,7 +517,6 @@ export default {
503
517
  const clientX = e.clientX
504
518
  const clientY = e.clientX
505
519
  this.lastSelectedText = selectedText
506
- console.log('selectedText', selectedText)
507
520
  },
508
521
  showAssets() {
509
522
  this.$emit('assets')