From 6f365fd3ab61d46e9e620352b8bbaa812c30942d Mon Sep 17 00:00:00 2001 From: hyx Date: Fri, 8 May 2020 08:05:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=201=20=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/charts/chart-single-stat.vue | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-single-stat.vue b/nezha-fronted/src/components/charts/chart-single-stat.vue index c2ed6764b..0c499d46c 100644 --- a/nezha-fronted/src/components/charts/chart-single-stat.vue +++ b/nezha-fronted/src/components/charts/chart-single-stat.vue @@ -114,17 +114,12 @@ export default { }, panelIdInner: '', // 看板id=panelId,原写作chart,由set_data获取 firstLoad: false, // 是否第一次加载 - //showLoading:true, - //showLoadingScreen:false, - //showTable:true, - chartType: 'table', // 图表类型 screenModal: false, // 查询数据使用 filter: { start_time: '', end_time: '', }, - stableFilter: {}, // 保存数据使用,初始化起止时间,单图or多图等 firstShow: false, // 默认不显示操作按钮, caretShow:false, dragTitleShow:false, @@ -204,8 +199,8 @@ export default { chartBox[_this.chartIndex].style.width = (containerWidth+chartBoxPadding)+'px'; //chartBox[_this.chartIndex].style.height = `${containerHeight}px`; //表格的高度 - const tableBox = document.getElementById('chartContainer'+_this.chartIndex); - tableBox.style.height = `${containerHeight-_this.titleHeight}px`;//-75-32+25 + const chartSingleStatBox = document.getElementById('chartContainer'+_this.chartIndex); + chartSingleStatBox.style.height = `${containerHeight-_this.titleHeight}px`;//-75-32+25 } document.onmouseup=function(){ @@ -255,8 +250,8 @@ export default { chartBox[_this.chartIndex].style.width = (containerWidth+chartBoxPadding)+'px'; //chartBox[_this.chartIndex].style.height = `${containerHeight}px`; //表格的高度 - const tableBox = document.getElementById('chartContainer'+_this.chartIndex); - tableBox.style.height = `${containerHeight-_this.titleHeight}px`; + const chartSingleStatBox = document.getElementById('chartContainer'+_this.chartIndex); + chartSingleStatBox.style.height = `${containerHeight-_this.titleHeight}px`; const modifyParams = { id:_this.data.id, @@ -305,7 +300,6 @@ export default { clearData(){ }, showLoad(chartItem) { - //设置高度 chart-table this.$nextTick(() => { const chartBox = document.getElementById('chartSingleStatDiv'+this.chartIndex); let height = chartItem.height; @@ -374,7 +368,7 @@ export default { this.data = chartItem; this.unit = chartDataFormat.getUnit(this.data.unit); if(Number(seriesItem)){ - let singleStatTmp =parseFloat(Number(seriesItem).toFixed(2)); + let singleStatTmp =Number(seriesItem).toFixed(2); this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); }else { this.serieSingleStat =seriesItem; @@ -383,7 +377,6 @@ export default { this.searchTime[1] = filter.end_time; this.endLoading('screen'); }else{ - //设置高度 chart-table this.$nextTick(() => { const chartBox = document.getElementById('chartSingleStatDiv'+this.chartIndex); let height = chartItem.height; @@ -402,7 +395,7 @@ export default { this.data = chartItem; this.unit = chartDataFormat.getUnit(this.data.unit); if(Number(seriesItem)){ - let singleStatTmp =parseFloat(Number(seriesItem).toFixed(2)); + let singleStatTmp =Number(seriesItem).toFixed(2); this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2); }else { this.serieSingleStat =seriesItem;