diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js index 8e1e8b9f4..3592fb71e 100644 --- a/nezha-fronted/src/components/charts/chartDataFormat.js +++ b/nezha-fronted/src/components/charts/chartDataFormat.js @@ -372,6 +372,9 @@ function asciiCompute2(num,ascii,units,dot=2,unitIndex=0){ * unit:设置的单位 * */ function timeCompute(value,unit,dot=0){ + if(Number.isInteger(value)) { + dot=0; + } if(unit == 'year'){ return `${value.toFixed(dot)} ${unit}`; } diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index bc4646346..6b025013e 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -508,6 +508,7 @@ toolbox:{ show:false, top:'0', + right:'18', showTitle:true, feature:{ dataZoom:{ diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index b2b9821b5..019aacba1 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:{ @@ -185,10 +209,10 @@ }) } if(this.type==='project'){ - this.$get('/project/info?id='+this.id).then((res)=>{ + this.$get('/project?id='+this.id).then((res)=>{ if(res.msg==='success'){ this.loading=false; - this.alertLabelData=res.data.basic; + this.alertLabelData=res.data.list[0]; } else{ this.$message.error(res.msg); } @@ -218,6 +242,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 +266,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 @@