zydx-plus 1.32.264 → 1.32.266
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
|
@@ -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-else-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="
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
|
@@ -491,7 +524,7 @@ export default {
|
|
|
491
524
|
}
|
|
492
525
|
const xhr = new XMLHttpRequest()
|
|
493
526
|
// xhr.open('GET', 'http://192.168.15.124:8888/zydx/voice/getDesKeyId')
|
|
494
|
-
// xhr.setRequestHeader('Authorization', '
|
|
527
|
+
// xhr.setRequestHeader('Authorization', '7a129186-7e51-431d-b965-735dfed8e459')
|
|
495
528
|
xhr.open('GET', '/zydx/voice/getDesKeyId')
|
|
496
529
|
xhr.setRequestHeader('Authorization', token)
|
|
497
530
|
this.error = true
|
|
@@ -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:
|
|
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
|
+
}
|