From fa7741ec4722eb0e2f91d583ee68bb05ad38bfcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= Date: Sat, 25 Apr 2020 11:51:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddropdown=E5=86=85?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=8F=AF=E4=BB=A5=E6=97=A0=E9=99=90?= =?UTF-8?q?=E5=90=91=E4=B8=8B=E6=BB=9A=E5=8A=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/page/config/mibBrowser.vue | 18 ++++++++++++-- .../src/components/page/dashboard/panel.vue | 24 +++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/page/config/mibBrowser.vue b/nezha-fronted/src/components/page/config/mibBrowser.vue index e87f56782..b7d7634c5 100644 --- a/nezha-fronted/src/components/page/config/mibBrowser.vue +++ b/nezha-fronted/src/components/page/config/mibBrowser.vue @@ -135,8 +135,8 @@
SNMP MIBs - - {{$t("config.model.model") + " "}} + + {{$t("config.model.model") + " "}} {{item.name}} @@ -326,6 +326,19 @@ } }, methods: { + scrollbarHeightHandler() { + setTimeout(() => { + let top = ''; + document.querySelector("body>.el-dropdown-menu").addEventListener("ps-y-reach-end", () => { + let yDom = document.querySelector("body>.el-dropdown-menu>.ps__rail-y"); + if (top) { + yDom.style.top = top; + } else { + top = yDom.style.top; + } + }); + }, 100); + }, toFileTab() { this.$emit("toFileTab"); }, @@ -571,6 +584,7 @@ this.getWalkData(); this.getModelData(); this.getAssetData(); + } } diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index b1913528a..fcdad1568 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -13,7 +13,7 @@
- + {{showPanel.name}} @@ -356,7 +356,27 @@ this.$refs.addChartModal.show(true); this.$refs.addChartModal.createData(this.showPanel.id); //初始化创建图表需要的初始数据 }, - + scrollbarHeightHandler() { + console.info(1) + setTimeout(() => { + let top = ''; + let top2 = ''; + document.querySelector("body>.el-dropdown-menu").addEventListener("ps-y-reach-end", () => { + let yDom = document.querySelector("body>.el-dropdown-menu>.ps__rail-y"); + let yDom2 = document.querySelector("body>.el-dropdown-menu>.ps__rail-y>.ps__thumb-y"); + if (top) { + yDom.style.top = top; + } else { + top = yDom.style.top; + } + if (top2) { + yDom2.style.top = top2; + } else { + top2 = yDom2.style.top; + } + }); + }, 100); + }, // 编辑图表信息,打开编辑弹窗 editData(data) { this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.editChartTitle"));