From cf99ed6a6fe95a7900689ebd9f9bbb45019804e3 Mon Sep 17 00:00:00 2001 From: hyx Date: Wed, 1 Apr 2020 22:21:06 +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=20chart=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2metric?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BC=98=E5=8C=96:=E7=94=B1hover=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8B=E4=B8=80=E7=BA=A7=E6=94=B9=E4=B8=BA=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=98=BE=E7=A4=BA=E4=B8=8B=E4=B8=80=E7=BA=A7=EF=BC=9B?= =?UTF-8?q?label=E5=8F=8A=E5=AF=B9=E5=BA=94value=E5=9D=87=E4=BB=8E/api/vi/?= =?UTF-8?q?series/=E6=8E=A5=E5=8F=A3=E8=8E=B7=E5=8F=96=E6=95=B4=E5=90=88?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=98=BE=E7=A4=BA=EF=BC=9B=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=90=8E=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2=E7=9A=84metric?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=EF=BC=9Bpanel=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=82=B9=E5=87=BB=E8=8F=9C=E5=8D=95=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=97=E8=A1=A8=EF=BC=8C=E8=A1=A8=E5=A4=B4=E7=81=B0?= =?UTF-8?q?=E8=89=B2=E8=83=8C=E6=99=AF=E4=B8=8D=E6=B6=88=E5=A4=B1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 28 +- .../components/page/dashboard/chartMetric.vue | 269 +++++++++++++++--- 2 files changed, 241 insertions(+), 56 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 1735c1c67..354fa5e64 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -252,19 +252,21 @@ export default { prev:newItem.prev, next:newItem.next, } - this.$put('panel/'+ this.pagePanelId+'/charts/modify',modifyParams).then(response => { - if (response.code === 200) { - //let item = this.dataList.find(item => item.id === newItem.id); - }else { - if(response.msg){ - this.$message.error(response.msg); - }else if(response.error){ - this.$message.error(response.error); + if(this.dataList.length>1){ + this.$put('panel/'+ this.pagePanelId+'/charts/modify',modifyParams).then(response => { + if (response.code === 200) { + //let item = this.dataList.find(item => item.id === newItem.id); }else { - this.$message.error(response); + if(response.msg){ + this.$message.error(response.msg); + }else if(response.error){ + this.$message.error(response.error); + }else { + this.$message.error(response); + } } - } - }); + }); + } let chartTitle = item.querySelector('.chartTitle'); chartTitle.style.background = ''; @@ -284,8 +286,8 @@ export default { choose(event ){ console.log('choose', event); let chartTitle = event.item.querySelector('.chartTitle'); - console.log('choose-title',chartTitle); - chartTitle.style.background = '#d8dce1'; + //console.log('choose-title',chartTitle); + //chartTitle.style.background = '#d8dce1'; }, clone(event){ console.log('clone',event ); diff --git a/nezha-fronted/src/components/page/dashboard/chartMetric.vue b/nezha-fronted/src/components/page/dashboard/chartMetric.vue index 9d8b19e97..4ec47f866 100644 --- a/nezha-fronted/src/components/page/dashboard/chartMetric.vue +++ b/nezha-fronted/src/components/page/dashboard/chartMetric.vue @@ -141,13 +141,15 @@