彻底修复登陆页面无法点击输入框的BUG

This commit is contained in:
fangxiang 2022-02-10 10:22:05 +08:00
parent c45277cb8d
commit 129ece6bc0
3 changed files with 51 additions and 53 deletions

View File

@ -22,17 +22,22 @@ export default defineComponent({
window.onresize = (evt: any) =>
EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt);
window.onmousedown = (evt: any) =>
window.onmousedown = (evt: MouseEvent) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseDown, evt);
window.onmousemove = (evt: any) =>
};
window.onmousemove = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseMove, evt);
window.onmouseup = (evt: any) =>
};
window.onmouseup = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseUp, evt);
window.onmouseout = (evt: any) =>
};
window.onmouseout = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseOut, evt);
};
window.document.body.onclick = (evt: any) =>
window.document.body.onclick = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
};
document.body.classList.add("overflow-hidden");

View File

@ -31,7 +31,6 @@
) ||
$t('Please input vaild ip address'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
@ -62,7 +61,6 @@
(val) =>
(val && val.length > 0) || $t('Please type something'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
@ -93,7 +91,6 @@
(val) =>
(val && val.length > 0) || $t('Please type something'),
]"
@mousedown="(evt) => focusElement(evt)"
@keydown="
(evt) => {
if (evt.keyCode == 13) {
@ -272,11 +269,6 @@ export default defineComponent({
data.user_name = null;
data.password = null;
},
focusElement(evt: any) {
try {
evt.toElement.focus();
} catch {}
},
};
},
});

View File

@ -9,6 +9,7 @@
style="background-color: #bce0f0"
>
<div id="windows" style="position: absolute">
<div v-for="(item, index) in windows" :key="index">
<window
@reset_geometry_offset="resetGeometryOffset"
@commit_geometry="commitGeometry"
@ -24,9 +25,7 @@
@polling_setting="polling_setting"
:ref="'window_' + item.window_id"
:id="'window_' + item.window_id"
v-for="(item, index) in windows"
:uuid="item.uuid"
:key="index"
:disable="plan_running"
class="window"
:mouse_area_flag="area_open_window_flag"
@ -34,7 +33,8 @@
:window="item"
:style="{
top:
(item.y * $store.state.device_screen_height) / wall_height_scaler +
(item.y * $store.state.device_screen_height) /
wall_height_scaler +
'px',
left:
(item.x * $store.state.device_screen_width) / wall_width_scaler +
@ -50,6 +50,7 @@
}"
/>
</div>
</div>
<div ref="wall_grids" @click="onWallGridsClick">
<div
v-for="row in wall_rows"