From f07d1431edba8a258bc7d82d15eb394226fe207a Mon Sep 17 00:00:00 2001 From: v_yutyi Date: Tue, 28 Dec 2021 11:44:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=8C=E7=BA=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=20#158?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/src/views/organization/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/src/views/organization/index.vue b/src/pages/src/views/organization/index.vue index 4bad1d570..3d32f1b0a 100644 --- a/src/pages/src/views/organization/index.vue +++ b/src/pages/src/views/organization/index.vue @@ -1274,13 +1274,14 @@ export default { this.$set(item, 'showBackground', true); this.$nextTick(() => { const calculateDistance = this.calculate(event.target); - const differ = document.querySelector('body').offsetHeight - calculateDistance.getOffsetTop; const next = event.target.nextElementSibling; next.style.left = `${calculateDistance.getOffsetLeft + 20}px`; next.style.top = `${calculateDistance.getOffsetTop + 30}px`; - if (differ <= 178) { - next.style.top = 'auto'; - next.style.bottom = `${differ + 7}px`; + const bottomHeight = window.innerHeight - (next.offsetTop - window.pageYOffset) - next.offsetHeight; + if ((bottomHeight < 0) && (next.offsetHeight === 146)) { + next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`; + } else if ((bottomHeight < 0) && (next.offsetHeight === 254)) { + next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`; } }); },