From 41e86f18656e274b4cb2b7fd5ad935eee73cfb45 Mon Sep 17 00:00:00 2001 From: "zhu.yawen" Date: Tue, 14 Nov 2023 13:57:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=B0=8F=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E4=BD=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/BigScreenDesign/SettingPanel.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/data-room-ui/packages/BigScreenDesign/SettingPanel.vue b/data-room-ui/packages/BigScreenDesign/SettingPanel.vue index 29cc77b5..285f7994 100644 --- a/data-room-ui/packages/BigScreenDesign/SettingPanel.vue +++ b/data-room-ui/packages/BigScreenDesign/SettingPanel.vue @@ -63,18 +63,28 @@ export default { }, data () { return { + count: 0, + right: 0 } }, watch: { rightVisiable (value) { + const leftElement = document.querySelector('.bs-left-panel') + const contentElement = document.querySelector('.grid-wrap-box') + // const rightElement = document.querySelector('.bs-right-panel-wrap') + const mapElement = document.querySelector('.minimap') if (value) { - const leftElement = document.querySelector('.bs-left-panel') - const contentElement = document.querySelector('.grid-wrap-box') - // const rightElement = document.querySelector('.bs-right-panel-wrap') - const mapElement = document.querySelector('.minimap') if (parseInt(window.getComputedStyle(mapElement).right) > parseInt(window.getComputedStyle(leftElement).width) + parseInt(window.getComputedStyle(contentElement).width) - 320 - parseInt(window.getComputedStyle(mapElement).width)) { + // 此时距离超出可视范围 + this.count = 1 + this.right = window.getComputedStyle(mapElement).right mapElement.style.right = parseInt(window.getComputedStyle(leftElement).width) + parseInt(window.getComputedStyle(contentElement).width) - 320 - parseInt(window.getComputedStyle(mapElement).width) + 'px' } + } else { + if (this.count === 1) { + mapElement.style.right = this.right + this.count-- + } } } },