From a1e3d88b963091178aeaaeea7bda44f35355d2fc Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Tue, 25 Jan 2022 19:58:46 +0800 Subject: [PATCH] =?UTF-8?q?fix::=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=9C=AA=E5=8A=A8=E6=80=81=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/charts/PanelChart.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/charts/PanelChart.vue b/src/views/charts/PanelChart.vue index 5293bb8d..4d4ab5cf 100644 --- a/src/views/charts/PanelChart.vue +++ b/src/views/charts/PanelChart.vue @@ -184,10 +184,18 @@ export default { } if (this.isSingleValue) { if (chartParams && chartParams.dataKey) { - get('/interface/entity/detail/ip/serviceOverview', this.queryParams).then(response =>{ - if (response.data.result && (response.data.result[chartParams.dataKey] || response.data.result[chartParams.dataKey] === 0)) { - this.chartData = response.data.result[chartParams.dataKey] - this.loading = false + get(replaceUrlPlaceholder(chartParams.url), this.queryParams).then(response =>{ + console.log(response) + if (response.code === 200) { + if (response.data.result && (response.data.result[chartParams.dataKey] || response.data.result[chartParams.dataKey] === 0)) { + this.chartData = response.data.result[chartParams.dataKey] + } else { + this.chartData = '' + } + } else { + this.isError = true + this.noData = true + this.errorInfo = response.msg || response.message || 'Unknown' } }) }