zydx-plus 1.32.263 → 1.32.265

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.32.263",
3
+ "version": "1.32.265",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -7,9 +7,9 @@
7
7
  <button v-if="item.key === 'but'" class="buts" @click="item.onClick(item,info)"
8
8
  :style="{color: (item.active)? '#00ff00' :'#000'}">{{ item.title }}
9
9
  </button>
10
- <button v-if="item.key === 'speech'" class="buts" @mousedown.stop="speechDown" @click="item.onClick(item)"
11
- :style="{color: (item.active)? '#00ff00' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
12
- </button>
10
+ <!-- <button v-else-if="item.key === 'speech'" class="buts" @mousedown.stop="speechDown" @click="item.onClick(item)"-->
11
+ <!-- :style="{color: (item.active)? '#00ff00' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}-->
12
+ <!-- </button>-->
13
13
  <label v-else-if="item.key === 'upImg' || item.key === 'uploadAtt'">
14
14
  <input type="file" @change="upload($event,item.key)"
15
15
  :accept="(item.key === 'upImg')?'image/*':'.docx,.pptx,.pdf,.xlsx,.mp3,.mp4'" style="display: none;">
@@ -17,6 +17,9 @@
17
17
  </label>
18
18
  <button v-else class="buts" @click="toolTap(item.key)">{{ item.title }}</button>
19
19
  </div>
20
+ <button v-if="voiceShow" class="buts" @mousedown.stop="speechDown" @click="voice()"
21
+ :style="{color: (voiceStatus)? '#00ff00' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
22
+ </button>
20
23
  </div>
21
24
  </div>
22
25
  <div class="ed-cont" :style="heightStyleCont">
@@ -24,7 +27,7 @@
24
27
  <editor-content @paste.native.capture.prevent="preventPaste" ref="editorRef" class="editor" :editor="editor"
25
28
  :style="heightStyleCont"/>
26
29
  </div>
27
- <div v-if="voiceStatus" class="speak"
30
+ <div v-if="voiceShows" class="speak"
28
31
  @mousedown.stop="mousedown"
29
32
  @mouseup.stop="mouseup"
30
33
  :style="{transform: `translate(${x}px, ${y}px)`}">
@@ -137,7 +140,9 @@ export default {
137
140
  isMove: false,
138
141
  x: 0,
139
142
  y: 0,
140
- speech: {}
143
+ speech: {},
144
+ limits: false,
145
+ voiceShows: false
141
146
  }
142
147
  },
143
148
  beforeUnmount() {
@@ -236,6 +241,10 @@ export default {
236
241
  placeholder: {
237
242
  type: String,
238
243
  default: '请输入内容'
244
+ },
245
+ voiceShow: {
246
+ type: Boolean,
247
+ default: true
239
248
  }
240
249
  },
241
250
  emits: ['see', 'del', 'complete', 'update:data', 'enclosureSuccess', 'download', 'updateData'],
@@ -256,22 +265,22 @@ export default {
256
265
  },
257
266
  deep: true
258
267
  },
259
- toolbar: {
260
- handler: function (e, oldVal) {
261
- e.map(x => {
262
- if (x.key === 'speech') {
263
- this.voiceStatus = x.active
264
- if(this.voiceStatus) {
265
- this.voice()
266
- }else {
267
- this.close()
268
- }
269
- }
270
- return x
271
- })
272
- },
273
- deep: true
274
- }
268
+ // toolbar: {
269
+ // handler: function (e, oldVal) {
270
+ // e.map(x => {
271
+ // if (x.key === 'speech') {
272
+ // this.voiceStatus = x.active
273
+ // if(this.voiceStatus) {
274
+ // this.voice()
275
+ // }else {
276
+ // this.close()
277
+ // }
278
+ // }
279
+ // return x
280
+ // })
281
+ // },
282
+ // deep: true
283
+ // }
275
284
  },
276
285
  mounted() {
277
286
  let _this = this
@@ -311,7 +320,15 @@ export default {
311
320
  html: html2json(editor.getHTML()).child,
312
321
  enclosure: this.uploadAttData
313
322
  })
314
- }
323
+ },
324
+ onBlur: ({editor}) => {
325
+ this.limits = false
326
+ this.close()
327
+ },
328
+ // 获取焦点
329
+ onFocus: ({editor}) => {
330
+ this.limits = true
331
+ },
315
332
  })
316
333
  document.addEventListener('keydown', function (e) {
317
334
  if (e.keyCode === 8 || e.keyCode === 46) {
@@ -335,9 +352,14 @@ export default {
335
352
  }
336
353
  document.addEventListener('mousemove', (event) => {
337
354
  if (!this.isMove) return
355
+ this.limits = true
338
356
  this.x = event.clientX - this.left;
339
357
  this.y = event.clientY - this.top;
340
358
  })
359
+ document.addEventListener('click', (event) => {
360
+ if(this.limits) return
361
+ this.close()
362
+ })
341
363
  },
342
364
  methods: {
343
365
  speechDown(e) {
@@ -355,6 +377,9 @@ export default {
355
377
  },
356
378
  mouseup() {
357
379
  this.isMove = false
380
+ setTimeout(() => {
381
+ this.limits = false
382
+ },10)
358
383
  },
359
384
  // 粘贴文本处理
360
385
  preventPaste(event) {
@@ -410,29 +435,37 @@ export default {
410
435
  scriptProcessor.connect(that.recorder.context.destination);
411
436
  },
412
437
  voice() {
413
- this.recorder.start().then(() => { // 开始录音
414
- this.audioData = []
415
- this.x = this.speech.x - 85
416
- const h = this.height.split('px')[0]
417
- this.y = this.speech.y + ((this.height === '100%') ? 40 : Number(h) - 10)
418
- this.appID()
419
- }, (error) => {
420
- this.$message({
421
- type: 'text',
422
- cancelShow: false,
423
- promptContent: '录音失败,请检查麦克风是否可用'
424
- })
425
- });
438
+ this.voiceStatus = !this.voiceStatus
439
+ this.limits = false
440
+ if(this.voiceStatus) {
441
+ this.recorder.start().then(() => { // 开始录音
442
+ this.audioData = []
443
+ this.x = this.speech.x - 85
444
+ const h = this.height.split('px')[0]
445
+ this.y = this.speech.y + ((this.height === '100%') ? 40 : Number(h) - 10)
446
+ this.voiceShows = this.voiceStatus
447
+ this.appID()
448
+ }, (error) => {
449
+ this.$message({
450
+ type: 'text',
451
+ cancelShow: false,
452
+ promptContent: '录音失败,请检查麦克风是否可用'
453
+ })
454
+ });
455
+ }else {
456
+ this.close()
457
+ }
426
458
  },
427
459
  close() {
428
460
  if(this.ws === null) return
429
- this.toolbar.map(x => {
430
- if (x.key === 'speech') {
431
- x.active = false
432
- }
433
- return x
434
- })
461
+ // this.toolbar.map(x => {
462
+ // if (x.key === 'speech') {
463
+ // x.active = false
464
+ // }
465
+ // return x
466
+ // })
435
467
  this.voiceStatus = false
468
+ this.voiceShows = this.voiceStatus
436
469
  this.ws?.send(JSON.stringify({"type":"CANCEL"}))
437
470
  this.ws?.close()
438
471
  this.ws = null
@@ -490,10 +523,10 @@ export default {
490
523
  token = sessionStorage.getItem('sessionId')
491
524
  }
492
525
  const xhr = new XMLHttpRequest()
493
- // xhr.open('GET', 'http://192.168.15.124:8888/zydx/voice/getDesKeyId')
494
- // xhr.setRequestHeader('Authorization', 'dd9fabcd-ca68-4f1a-97f0-21a66628207d')
495
- xhr.open('GET', '/zydx/voice/getDesKeyId')
496
- xhr.setRequestHeader('Authorization', token)
526
+ xhr.open('GET', 'http://192.168.15.124:8888/zydx/voice/getDesKeyId')
527
+ xhr.setRequestHeader('Authorization', '7a129186-7e51-431d-b965-735dfed8e459')
528
+ // xhr.open('GET', '/zydx/voice/getDesKeyId')
529
+ // xhr.setRequestHeader('Authorization', token)
497
530
  this.error = true
498
531
  xhr.onreadystatechange = () => {
499
532
  if (xhr.readyState === 4) {
@@ -820,7 +853,7 @@ export default {
820
853
  }
821
854
 
822
855
  .ed-head-but label span {
823
- line-height: 15px !important;
856
+ line-height: 16px !important;
824
857
  }
825
858
 
826
859
  .ed-title {
@@ -905,6 +938,7 @@ export default {
905
938
  display: inline-block;
906
939
  line-height: 16px;
907
940
  box-sizing: border-box;
941
+ font-family: Arial;
908
942
  }
909
943
 
910
944
  .but-f {
@@ -925,4 +959,12 @@ export default {
925
959
  transform: scale(.8);
926
960
  color: #fff;
927
961
  }
962
+ @-moz-document url-prefix() {
963
+ .buts {
964
+ line-height: 1px;
965
+ }
966
+ .ed-head-but label span {
967
+ line-height: 14px !important;
968
+ }
969
+ }
928
970
  </style>
@@ -114,7 +114,7 @@ export default {
114
114
  overflow: hidden;
115
115
  }
116
116
  .preface-input>input{
117
- width: 50px;
117
+ width: 55px;
118
118
  height: 29px;
119
119
  border: none;
120
120
  padding-left: 5px;
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  <div class="tip-img" v-if="type === 'input'">
37
37
  <div class="tip-input" v-for="(item,index) in inputArr" :key="index">
38
- <span v-if="item.name"><em>{{ item.name }}</em><i v-if="item.required">*</i></span>
38
+ <span v-if="item.name"><em>{{ item.name.replace(/:/g,"").replace(/:/g,"") }}</em><b>:</b><i v-if="item.required">*</i></span>
39
39
  <div v-if="item.type === 'file'" class="file-cont">
40
40
  <em>{{ fileName }}</em>
41
41
  <label>
@@ -92,7 +92,7 @@
92
92
  .tip-btnBox > div {
93
93
  width: 60px;
94
94
  height: 22px;
95
- line-height: 22px;
95
+ line-height: 20px;
96
96
  margin-right: 10px;
97
97
  border-radius: 3px;
98
98
  border: 1px solid #000000;
@@ -143,6 +143,8 @@
143
143
  min-width: 65px;
144
144
  display: inline-block;
145
145
  text-align-last: justify;
146
+ word-break: break-all;
147
+ text-justify: distribute;
146
148
  }
147
149
 
148
150
  .tip-input > span > i {
@@ -339,4 +341,4 @@
339
341
  top: 3px;
340
342
  left: 0;
341
343
  z-index: 1;
342
- }
344
+ }
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.263',
82
+ version: '1.32.265',
83
83
  install,
84
84
  Calendar,
85
85
  Message,