修复登录页面点击无效的BUG

修复CTRL开窗时会触发focus消息的BUG
This commit is contained in:
fangxiang 2022-02-10 09:51:59 +08:00
parent 1a1b09ca94
commit c45277cb8d
3 changed files with 63 additions and 42 deletions

View File

@ -462,6 +462,7 @@ export default defineComponent({
};
const flags = new _Flags();
let ctrl_press_flag = false;
return {
signal_source,
@ -475,6 +476,10 @@ export default defineComponent({
calc_is_audio_player_window,
onClick(evt: PointerEvent) {
if (ctrl_press_flag) {
ctrl_press_flag = false;
return;
}
if (!props.mouse_area_flag) {
evt.stopPropagation();
if (selected.value != true) {
@ -487,8 +492,10 @@ export default defineComponent({
}
},
onMouseDown(evt: MouseEvent) {
ctrl_press_flag = evt.ctrlKey;
if (!evt.ctrlKey) {
evt.stopPropagation();
if (props.disable) {
return;
}
@ -563,7 +570,7 @@ export default defineComponent({
cleanMouseDownFlag,
onMouseLeave(evt: MouseEvent) {
// console.log("leave", ctrl_flag);
ctrl_press_flag = false;
if (!props.mouse_area_flag) {
if (selected.value && mouse_down_flag) {
if (move_flag) {
@ -576,6 +583,7 @@ export default defineComponent({
onMouseUp(evt: MouseEvent) {
// console.log("up", ctrl_flag);
if (selected.value && mouse_down_flag) {
if (move_flag) {
emit("commit_geometry", props.window);

View File

@ -17,7 +17,6 @@
<q-input
:loading="data.loading"
:disable="data.loading"
filled
v-model="data.ip_address"
:label="$t('server ip address')"
:hint="$t('please input server ip address')"
@ -32,10 +31,11 @@
) ||
$t('Please input vaild ip address'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
$refs?.password_input?.focus();
$refs?.user_name?.focus();
}
}
"
@ -54,7 +54,6 @@
ref="user_name"
:loading="data.loading"
:disable="data.loading"
filled
v-model="data.user_name"
:label="$t('user name')"
:hint="$t('please input user name')"
@ -63,6 +62,7 @@
(val) =>
(val && val.length > 0) || $t('Please type something'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
@ -84,7 +84,6 @@
ref="password_input"
:loading="data.loading"
:disable="data.loading"
filled
:type="data.show_password ? '' : 'password'"
v-model="data.password"
:label="$t('password')"
@ -94,6 +93,7 @@
(val) =>
(val && val.length > 0) || $t('Please type something'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
@ -272,6 +272,11 @@ export default defineComponent({
data.user_name = null;
data.password = null;
},
focusElement(evt: any) {
try {
evt.toElement.focus();
} catch {}
},
};
},
});

View File

@ -261,6 +261,13 @@ export default defineComponent({
const wallMouseUp = (evt: MouseEvent) => {
if (area_open_window_flag.value && wall.value) {
evt.stopPropagation();
// 0
if (
area_open_window_rect.value.start_x !=
area_open_window_rect.value.end_x &&
area_open_window_rect.value.start_y !=
area_open_window_rect.value.end_y
) {
//
let left =
wall.value.offsetLeft + (wall.value.parentElement?.offsetLeft ?? 0);
@ -301,6 +308,7 @@ export default defineComponent({
)
);
}
}
area_open_window_flag.value = false;
area_open_window_rect.value.reset();
};