Skip to content

Commit 38d9ec4

Browse files
committed
BUG修复
1 parent e7c275b commit 38d9ec4

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

client/src/views/SpeechControl.vue

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
name="getType"
1111
value="1"
1212
v-model="getType"
13+
:disabled="mouseDownFlag"
1314
@change="getTypeChange"
1415
/>
1516
自由捕获</label
@@ -21,6 +22,7 @@
2122
name="getType"
2223
value="2"
2324
v-model="getType"
25+
:disabled="mouseDownFlag"
2426
@change="getTypeChange"
2527
/>
2628
鼠标按住</label
@@ -32,6 +34,7 @@
3234
name="getType"
3335
value="3"
3436
v-model="getType"
37+
:disabled="mouseDownFlag"
3538
@change="getTypeChange"
3639
/>
3740
鼠标移入</label
@@ -43,6 +46,7 @@
4346
name="getType"
4447
value="4"
4548
v-model="getType"
49+
:disabled="mouseDownFlag"
4650
@change="getTypeChange"
4751
/>
4852
按住空格</label
@@ -54,6 +58,7 @@
5458
name="getType"
5559
value="0"
5660
v-model="getType"
61+
:disabled="mouseDownFlag"
5762
@change="getTypeChange"
5863
/>
5964
禁止捕获</label
@@ -80,8 +85,6 @@
8085
/>
8186
<Button
8287
label="按住空格说话"
83-
@mouseenter="speechStart"
84-
@mouseleave="speechStop"
8588
:class="{ 'p-button-help': mouseDownFlag }"
8689
v-show="getType === '4'"
8790
/>
@@ -140,13 +143,23 @@ export default {
140143
document.addEventListener('keyup', this.keyupSpeechStop)
141144
},
142145
keydownSpeechStart(event) {
143-
if (!this.keypressFlag && event.keyCode === 32 && !this.inputIsFocus) {
146+
if (
147+
!this.keypressFlag &&
148+
event.keyCode === 32 &&
149+
!this.inputIsFocus &&
150+
this.getType === '4'
151+
) {
144152
this.speechStart()
145153
this.keypressFlag = true
146154
}
147155
},
148156
keyupSpeechStop(event) {
149-
if (this.keypressFlag && event.keyCode === 32 && !this.inputIsFocus) {
157+
if (
158+
this.keypressFlag &&
159+
event.keyCode === 32 &&
160+
!this.inputIsFocus &&
161+
this.getType === '4'
162+
) {
150163
this.speechStop()
151164
this.keypressFlag = false
152165
}

0 commit comments

Comments
 (0)