From 853807fafd9dffad1fd8d04683af54d51bfc1727 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Mon, 1 Nov 2021 17:59:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcahrt-alert-list?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=85=A8=E5=B1=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-alert-list.vue | 2 +- .../src/components/common/alert/alertLabel.vue | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 3901689fd..6b5086f82 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -78,7 +78,7 @@ - +
{{data.name}}
diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 312b94c69..442ce28e6 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -257,8 +257,7 @@ export default { type: {}, // labelLoading:{}, that: {}, - detailList: Boolean, - alertTableDialog: Boolean + detailList: Boolean }, /* watch:{ labelLoading: { @@ -333,8 +332,8 @@ export default { const self = this return function (position) { const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight - const dialog = document.getElementsByClassName('el-dialog')[2] // 获取元素类名为 el-dialog的元素数组第二个 - const dialogHeight = dialog.clientHeight // 获取元素窗口 + const dialog = document.querySelector('#dialog-alert-massage .el-dialog') + const dialogHeight = dialog.getBoundingClientRect() const leftOffSetView = this.detailList ? -80 : 10 const topOffSetView = this.detailList ? 0 : 0 const leftOffSet = this.detailList ? -80 : 10 @@ -345,10 +344,10 @@ export default { left: `${position.left + position.width + leftOffSet}px`, top: `${position.top - elHeight + topOffSet}px` } - } else if (dialogHeight && this.alertTableDialog) { // dialogHeight 为获取的元素窗口,this.alertTableDialog // 为了判断是alertMessageTable页面使用的组件 + } else if (dialogHeight) { return { - left: `${position.left + position.width - 40}px`, - top: `${position.top - 95}px` + left: `${position.left + position.width + 10 - dialogHeight.x}px`, + top: `${position.top - dialogHeight.y}px` } } else { return {