From 581dff59c2b4ea0f646fb398b8457bfff851093f Mon Sep 17 00:00:00 2001 From: likexuan Date: Tue, 5 Jul 2022 16:32:57 +0800 Subject: [PATCH] =?UTF-8?q?perf=20:=20=E5=BC=B9=E6=A1=86=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/alert/alertLabel.vue | 6 ++++-- nezha-fronted/src/components/common/alert/alertRuleInfo.vue | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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` } } }