彻底修复登陆页面无法点击输入框的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) => window.onresize = (evt: any) =>
EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt); EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt);
window.onmousedown = (evt: any) => window.onmousedown = (evt: MouseEvent) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseDown, evt); EventBus.getInstance().emit(EventNamesDefine.WindowMouseDown, evt);
window.onmousemove = (evt: any) => };
window.onmousemove = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseMove, evt); EventBus.getInstance().emit(EventNamesDefine.WindowMouseMove, evt);
window.onmouseup = (evt: any) => };
window.onmouseup = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseUp, evt); EventBus.getInstance().emit(EventNamesDefine.WindowMouseUp, evt);
window.onmouseout = (evt: any) => };
window.onmouseout = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.WindowMouseOut, evt); EventBus.getInstance().emit(EventNamesDefine.WindowMouseOut, evt);
};
window.document.body.onclick = (evt: any) => window.document.body.onclick = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt); EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
};
document.body.classList.add("overflow-hidden"); document.body.classList.add("overflow-hidden");

View File

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

View File

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