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 () {