彻底修复登陆页面无法点击输入框的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,46 +9,47 @@
style="background-color: #bce0f0" style="background-color: #bce0f0"
> >
<div id="windows" style="position: absolute"> <div id="windows" style="position: absolute">
<window <div v-for="(item, index) in windows" :key="index">
@reset_geometry_offset="resetGeometryOffset" <window
@commit_geometry="commitGeometry" @reset_geometry_offset="resetGeometryOffset"
@close_this_window="closeWindow" @commit_geometry="commitGeometry"
@close_other_windows="closeOtherWindows" @close_this_window="closeWindow"
@close_all_windows="closeAllWindows" @close_other_windows="closeOtherWindows"
@window_fouse_in="windowFocusIn" @close_all_windows="closeAllWindows"
@dblclick="(evt) => windowDBClick(item.window_id)" @window_fouse_in="windowFocusIn"
@edit_volume="edit_volume" @dblclick="(evt) => windowDBClick(item.window_id)"
@mute_unmute="mute_unmute" @edit_volume="edit_volume"
@start_polling="start_polling" @mute_unmute="mute_unmute"
@stop_polling="stop_polling" @start_polling="start_polling"
@polling_setting="polling_setting" @stop_polling="stop_polling"
:ref="'window_' + item.window_id" @polling_setting="polling_setting"
:id="'window_' + item.window_id" :ref="'window_' + item.window_id"
v-for="(item, index) in windows" :id="'window_' + item.window_id"
: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" :signal_source_table_uuid="item.signal_source_table_uuid"
:signal_source_table_uuid="item.signal_source_table_uuid" :window="item"
:window="item" :style="{
:style="{ top:
top: (item.y * $store.state.device_screen_height) /
(item.y * $store.state.device_screen_height) / wall_height_scaler + 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 +
'px', 'px',
width: width:
(item.width * $store.state.device_screen_width) / (item.width * $store.state.device_screen_width) /
wall_width_scaler + wall_width_scaler +
'px', 'px',
height: height:
(item.height * $store.state.device_screen_height) / (item.height * $store.state.device_screen_height) /
wall_height_scaler + wall_height_scaler +
'px', 'px',
}" }"
/> />
</div>
</div> </div>
<div ref="wall_grids" @click="onWallGridsClick"> <div ref="wall_grids" @click="onWallGridsClick">
<div <div