From c2c090059b45c01e8d072afd5d96e02cc5d48fcb Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Mon, 30 Mar 2020 22:10:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9BUG=20dashboard=E6=A8=A1?= =?UTF-8?q?=E5=9D=97:1=20=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=BF=9B=E8=A1=8C=E9=A2=84=E8=A7=88=EF=BC=8C=E9=81=AE?= =?UTF-8?q?=E7=BD=A9=E5=B1=82=E6=98=BE=E7=A4=BA=E5=9C=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=95=8C=E9=9D=A2=E4=B9=8B=E4=B8=8B=202=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=95=8C=E9=9D=A2=E9=A2=84=E8=A7=88echart=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=97=B6tooltip=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E9=9A=8F=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=8A=A8=203=20Metric=20Pr?= =?UTF-8?q?eview=E4=BF=AE=E6=94=B9=E4=B8=BAExplore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chartPreview.vue | 53 +++++-------------- .../src/components/common/language/cn.js | 2 +- .../src/components/common/language/en.js | 2 +- 3 files changed, 14 insertions(+), 43 deletions(-) diff --git a/nezha-fronted/src/components/charts/chartPreview.vue b/nezha-fronted/src/components/charts/chartPreview.vue index 0007daf63..96045e117 100644 --- a/nezha-fronted/src/components/charts/chartPreview.vue +++ b/nezha-fronted/src/components/charts/chartPreview.vue @@ -232,8 +232,7 @@ methods: { // 全屏查看 show(chartInfo) { - this.searchTime[0] = new Date().setHours(new Date().getHours()-1); - this.searchTime[1] =new Date(); + this.searchTime = [new Date().setHours(new Date().getHours()-1),new Date()]; this.chart=chartInfo; let chartType= chartInfo.type; let chartContainerId = 'chartEchartPreview' @@ -267,7 +266,7 @@ chartDiv.style.height = `${height-this.chartSpaceHeight-this.titleHeight}px`; const addChartBox = document.querySelector('.right-box-add-chart'); //this.oldChartBoxCss = addChartBox.style.cssText; - addChartBox.style.cssText = 'z-index:2003 !important'; + addChartBox.style.cssText = 'z-index:1500 !important'; if(chartType==='table'){ const tableBox = document.getElementById('tableContainer'); tableBox.style.height = `${height-this.titleHeight-this.pageHeight}px`;//-75-32+25 @@ -579,45 +578,17 @@ //提示框大小 var boxWidth = size.contentSize[0]; var boxHeight = size.contentSize[1]; - if (chartSite === 'local') { // 本地显示 - let chartDom = document.getElementById(chartInfo.title+"_"+chartInfo.id); - if(chartDom){ - let parTop = document.getElementById(chartInfo.title+"_"+chartInfo.id).offsetTop; - let parleft = document.getElementById(chartInfo.title+"_"+chartInfo.id).offsetLeft; - - let parent = document.getElementById('tableList'); - let parClientHeight = parent.clientHeight;//可视高度 - let parClientWidth = parent.clientWidth;//可视宽度 - let parScrollTop = parent.scrollTop; - if((parClientWidth-pointX-parleft-20)>=boxWidth){//说明鼠标在左边放不下提示框 - x=pointX+10; - }else{ - x = pointX - boxWidth; - } - if((parClientHeight-pointY-(parTop-parScrollTop)-20)>=boxHeight){//说明鼠标上面放不下提示框 - y = pointY+10; - }else { - y = pointY-boxHeight; - } - return [x,y]; - }else {//preview page - x = pointX - boxWidth; - y = pointY+10; - return [x,y]; - } - }else { - if(pointX<(viewWidth/2)){//说明鼠标在左边放不下提示框 - x=pointX+10; - }else{ - x = pointX - boxWidth; - } - if(pointY<(viewHeight/2)){//说明鼠标上面放不下提示框 - y = pointY+10; - }else { - y = pointY-boxHeight; - } - return [x,y]; + if(pointX<(viewWidth/2)){//说明鼠标在左边放不下提示框 + x=pointX+10; + }else{ + x = pointX - boxWidth; } + if(pointY<(viewHeight/2)){//说明鼠标上面放不下提示框 + y = pointY+10; + }else { + y = pointY-boxHeight; + } + return [x,y]; }, formatter:function(params){ //display:inline-block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis; diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 514817a68..ed45dd116 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -139,7 +139,7 @@ const cn = { saveChartToPanel:"保存图表到看板" }, metricPreview:{ - title:'指标预览', + title:'探索', }, refresh:'刷新', edit:'编辑', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index f5548a67d..fa33047db 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -178,7 +178,7 @@ const en = { saveChartToPanel:"Save chart to panel"//Save chart to panel. }, metricPreview:{ - title:'Metric preview',//'指标预览' + title:'Explore', }, refresh:'Refresh',//'刷新' edit:'Edit',//'编辑'