From efb0996777de7e26dd6bace0ea1fbd5638290ec2 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Tue, 2 Nov 2021 10:17:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20alertLabel=E9=A1=B5=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=AD=EF=BC=8C=E5=8C=BA=E5=88=86alertMess?= =?UTF-8?q?age=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=92=8Cchart-alert-lis=E5=85=A8?= =?UTF-8?q?=E5=B1=8Ft=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/charts/chart-alert-list.vue | 1 + .../components/common/alert/alertLabel.vue | 23 +++++++++++-------- .../common/table/alert/alertMessageTable.vue | 5 ++-- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index 6b5086f82..4c25c88a9 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -103,6 +103,7 @@ :fromPath="'/alertList'" style="height: calc(100% - 50px)" :showOption="false" + :chart-alert-list="true" > diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 442ce28e6..8586fa098 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -257,7 +257,8 @@ export default { type: {}, // labelLoading:{}, that: {}, - detailList: Boolean + detailList: Boolean, + alertTableDialog: Boolean }, /* watch:{ labelLoading: { @@ -332,24 +333,28 @@ 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.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 - const topOffSet = this.detailList ? 70 : 0 + const leftOffSet = this.detailList ? -80 : 20 + const topOffSet = this.detailList ? 45 : 0 const elHeight = self.type === 'asset' ? 318 : (self.type === 'project' ? 70 : 70) if (position.top + elHeight > clientHeight) { + console.log(leftOffSet, topOffSet) return { left: `${position.left + position.width + leftOffSet}px`, top: `${position.top - elHeight + topOffSet}px` } - } else if (dialogHeight) { - return { - left: `${position.left + position.width + 10 - dialogHeight.x}px`, - top: `${position.top - dialogHeight.y}px` + } else if (this.alertTableDialog) { + const dialog = document.querySelector('#dialog-alert-massage .el-dialog') + const dialogHeight = dialog.getBoundingClientRect() + if (dialogHeight) { + return { + left: `${position.left + position.width + 10 - dialogHeight.x}px`, + top: `${position.top - dialogHeight.y}px` + } } } else { + console.log(leftOffSetView, topOffSetView) return { left: `${position.left + position.width + leftOffSetView}px`, top: `${position.top + topOffSetView}px` diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 49c811a5e..5cf94d0f0 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -94,7 +94,7 @@ :id="scope.row[item.label].id" :that="scope.row[item.label]" :type="item.label" - :alert-table-dialog="true" + :alert-table-dialog="chartAlertList" > @@ -163,7 +163,8 @@ export default { default: true }, alertMessageTabNew: Boolean, - loading: Boolean + loading: Boolean, + chartAlertList: Boolean }, mixins: [table, bus], data () {