fix: 修复dropdown内滚动条可以无限向下滚动bug
This commit is contained in:
@@ -135,8 +135,8 @@
|
|||||||
<div class="mib-browser-left">
|
<div class="mib-browser-left">
|
||||||
<div class="mib-browser-tree-title">
|
<div class="mib-browser-tree-title">
|
||||||
<span>SNMP MIBs</span>
|
<span>SNMP MIBs</span>
|
||||||
<el-dropdown trigger="click" v-scrollBar:el-dropdown="'small'" :hide-on-click="false" @command="selectModel">
|
<el-dropdown trigger="click" v-scrollBar:el-dropdown="'small'" :hide-on-click="false" @command="selectModel" ref="modelDropdown">
|
||||||
<span class="mib-browser-table-op">{{$t("config.model.model") + " "}}<i class="nz-icon nz-icon-funnel"></i></span>
|
<span class="mib-browser-table-op" @click="scrollbarHeightHandler">{{$t("config.model.model") + " "}}<i class="nz-icon nz-icon-funnel"></i></span>
|
||||||
<el-dropdown-menu slot="dropdown" class="mib-browser-model-dropdown">
|
<el-dropdown-menu slot="dropdown" class="mib-browser-model-dropdown">
|
||||||
<el-dropdown-item :class="{'mib-browser-model-dropdown-item-active': walkParam.models.indexOf(item.id) > -1}" :command="item" v-for="item, index in modelData" :key="index">{{item.name}}</el-dropdown-item>
|
<el-dropdown-item :class="{'mib-browser-model-dropdown-item-active': walkParam.models.indexOf(item.id) > -1}" :command="item" v-for="item, index in modelData" :key="index">{{item.name}}</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -326,6 +326,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
toFileTab() {
|
||||||
this.$emit("toFileTab");
|
this.$emit("toFileTab");
|
||||||
},
|
},
|
||||||
@@ -571,6 +584,7 @@
|
|||||||
this.getWalkData();
|
this.getWalkData();
|
||||||
this.getModelData();
|
this.getModelData();
|
||||||
this.getAssetData();
|
this.getAssetData();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="top-tools">
|
<div class="top-tools">
|
||||||
<div class="top-tool-main-left">
|
<div class="top-tool-main-left">
|
||||||
<el-dropdown @command="panelChange" class="panel-dropdown-title" trigger="click" placement="bottom-start" v-scrollBar:el-dropdown>
|
<el-dropdown @command="panelChange" class="panel-dropdown-title" trigger="click" placement="bottom-start" v-scrollBar:el-dropdown>
|
||||||
<el-row :gutter="10" class="el-dropdown-link" style="">
|
<el-row @click.native="scrollbarHeightHandler" :gutter="10" class="el-dropdown-link" style="">
|
||||||
<el-col :span="21" class="panel-list-title" :title="showPanel.name">{{showPanel.name}}</el-col>
|
<el-col :span="21" class="panel-list-title" :title="showPanel.name">{{showPanel.name}}</el-col>
|
||||||
<el-col :span="3" style="padding-left:0px !important;"><i class="el-icon-arrow-down el-icon--right"></i></el-col>
|
<el-col :span="3" style="padding-left:0px !important;"><i class="el-icon-arrow-down el-icon--right"></i></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -356,7 +356,27 @@
|
|||||||
this.$refs.addChartModal.show(true);
|
this.$refs.addChartModal.show(true);
|
||||||
this.$refs.addChartModal.createData(this.showPanel.id); //初始化创建图表需要的初始数据
|
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) {
|
editData(data) {
|
||||||
this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.editChartTitle"));
|
this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.editChartTitle"));
|
||||||
|
|||||||
Reference in New Issue
Block a user