NEZ-1555 fix:悬浮弹窗位置错误的问题

This commit is contained in:
zhangyu
2022-02-14 14:13:49 +08:00
parent e9a11fab2e
commit 7ff1dac646
7 changed files with 17 additions and 19 deletions

View File

@@ -65,6 +65,7 @@ export default {
props: {
id: {},
messageLoad: {},
detailList: Boolean,
that: {},
severityData: Array
},
@@ -91,14 +92,15 @@ export default {
// const windowWidth = window.innerWidth
const boxHeight = this.$refs.alertLabels ? this.$refs.alertLabels.offsetHeight : 231
const windowHeight = window.innerHeight
const leftOffSetView = this.detailList ? -80 : 10
if (position.top > windowHeight / 2) {
return {
left: `${position.left + position.width + 10}px`,
left: `${position.left + position.width + leftOffSetView}px`,
top: `${position.top - boxHeight}px`
}
} else {
return {
left: `${position.left + position.width + 10}px`,
left: `${position.left + position.width + leftOffSetView}px`,
top: `${position.top}px`
}
}