From ea0d9443185b085f8af7ce81aa9fcf888c8a2d70 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 25 Aug 2020 16:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=B6=E9=97=B4=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=B0=8F=E6=97=B6=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/project/popData/chart.scss | 2 +- .../common/project/popData/totalChart.vue | 13 +++---- .../common/project/projectFacade.vue | 36 ++++++++++--------- nezha-fronted/src/store/index.js | 14 +++++++- 4 files changed, 41 insertions(+), 24 deletions(-) diff --git a/nezha-fronted/src/components/common/project/popData/chart.scss b/nezha-fronted/src/components/common/project/popData/chart.scss index 53104c9ab..32fc6b7a4 100644 --- a/nezha-fronted/src/components/common/project/popData/chart.scss +++ b/nezha-fronted/src/components/common/project/popData/chart.scss @@ -25,7 +25,7 @@ } .legend-container{ width: calc(100% - 30px); - max-height:80px; + max-height:40px; min-height:25px; font-size:12px; text-align:left; diff --git a/nezha-fronted/src/components/common/project/popData/totalChart.vue b/nezha-fronted/src/components/common/project/popData/totalChart.vue index 99886356c..0e3c1331d 100644 --- a/nezha-fronted/src/components/common/project/popData/totalChart.vue +++ b/nezha-fronted/src/components/common/project/popData/totalChart.vue @@ -60,7 +60,10 @@ arr.forEach(item1=>{ this.getData(item1, '', ''); }) - }) + }); + this.$set(this.filter, "start_time", bus.timeFormate(new Date().getTime()-60*60*1000, "yyyy-MM-dd hh:mm:ss")); + this.$set(this.filter, "end_time", bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss")); + this.$set(this.filter, "panelId", this.projectId); }, methods:{ //刷新图表 @@ -80,12 +83,10 @@ }, //获取图表数据 getData(chartInfo, pos, filterType){ - this.$set(this.filter, "start_time", bus.timeFormate(new Date().getTime()-24*60*60*1000, "yyyy-MM-dd hh:mm:ss")); - this.$set(this.filter, "end_time", bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss")); - this.$set(this.filter, "panelId", this.projectId); - let startTime = bus.timeFormate(new Date().getTime()-24*60*60*1000, "yyyy-MM-dd hh:mm:ss"); - let endTime = bus.timeFormate(new Date().getTime(), "yyyy-MM-dd hh:mm:ss"); + let startTime = this.filter.start_time + let endTime = this.filter.end_time; let step = bus.getStep(startTime, endTime); + chartInfo.loading=true; const chartItem = chartInfo; this.$nextTick(() => { const axiosArr = chartItem.elements.map((ele) => { diff --git a/nezha-fronted/src/components/common/project/projectFacade.vue b/nezha-fronted/src/components/common/project/projectFacade.vue index 21256eba4..1a05db935 100644 --- a/nezha-fronted/src/components/common/project/projectFacade.vue +++ b/nezha-fronted/src/components/common/project/projectFacade.vue @@ -1,18 +1,18 @@