From 9279bdf13e2b36764d36efd672e31a2093ca87e2 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 15 Oct 2020 18:20:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9alerrt=20tooltip?= =?UTF-8?q?=20=E9=9D=A0=E8=BF=91=E5=BA=95=E9=83=A8=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E5=90=91=E4=B8=8A=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/alert/alertLabel.vue | 231 +++++++++++------- .../common/alert/alertMessageTable.vue | 9 +- .../components/common/alert/alertRuleInfo.vue | 56 ++++- 3 files changed, 199 insertions(+), 97 deletions(-) diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index b2b9821b5..0f33a1e34 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -1,98 +1,98 @@ @@ -153,12 +153,36 @@ }, computed: { calcPosition() { + let self=this; return function(position) { - return { - left: `${position.left + position.width + 20}px`, - top: `${position.top - 20}px`, + let clientHeight = (document.body.clientHeightclientHeight){ + return { + left: `${position.left + position.width + 20}px`, + top: `${position.top -elHeight- 20}px`, + } + }else{ + return { + left: `${position.left + position.width + 20}px`, + top: `${position.top - 20}px`, + } } } + }, + calcHeight(){ + let self=this; + return function(position) { + let clientHeight = (document.body.clientHeightclientHeight){ + return 'alert-labelUp' + }else{ + return 'alert-label' + } + + } } }, methods:{ @@ -174,6 +198,7 @@ }, }, mounted(){ + console.log(this); if(this.type==='asset'){ this.$get('/asset/info?id='+this.id).then((res)=>{ if(res.msg==='success'){ @@ -218,6 +243,14 @@ border-radius: 4px; box-shadow: -1px 1px 9px -1px rgba(205,205,205,0.77); } + .alert-labelUp { + position: fixed; + background-color: white; + z-index: 3000; + padding: 10px; + border-radius: 4px; + box-shadow: -1px 1px 9px -1px rgba(205,205,205,0.77); + } .alert-label::after { content: ''; display: block; @@ -234,6 +267,22 @@ left: 0; transform: translate(-100%, -50%); } + .alert-labelUp::after { + content: ''; + display: block; + width:0; + height:0; + overflow: hidden; + font-size: 0; + line-height: 0; + border: 5px; + border-style: dashed solid dashed dashed; + border-color: transparent #fff transparent transparent; + position: absolute; + bottom: 20px; + left: 0; + transform: translate(-100%, -50%); + } .alert-label-info{ border: 1px solid #ebeef5; border-bottom: none; diff --git a/nezha-fronted/src/components/common/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/alert/alertMessageTable.vue index 41b1d37b3..c6deeeb42 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageTable.vue @@ -60,7 +60,10 @@