diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 4c9328ccc..dd8d9856b 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -778,12 +778,14 @@ export default { if (position.top > clientHeight / 2) { labelPosition = { left: `${position.left + position.width + leftOffSet}px`, - top: `${position.top - this.heightList - topOffSetView}px` + // top: `${position.top - this.heightList - topOffSetView}px` + top: `${position.top - this.heightList - topOffSetView + position.height / 2}px` } } else { labelPosition = { left: `${position.left + position.width + leftOffSet}px`, - top: `${position.top + topOffSet}px` + // top: `${position.top + topOffSet}px` + top: `${position.top + position.height / 2}px` } } if (position.left > clientWidth / 2) { diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue index a442666b8..9742ec499 100644 --- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue @@ -124,12 +124,14 @@ export default { if (position.top > windowHeight / 2) { return { left: `${position.left + position.width + leftOffSetView}px`, - top: `${position.top - boxHeight}px` + // top: `${position.top - boxHeight}px` + top: `${position.top + (position.height / 2) - boxHeight}px` } } else { return { left: `${position.left + position.width + leftOffSetView}px`, - top: `${position.top}px` + // top: `${position.top}px` + top: `${position.top + position.height / 2}px` } } }