From b26afb9c0d6683bb5c0b4915acf983560b568a88 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 26 Oct 2020 16:25:00 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Achart=20type=E4=B8=BAtable?= =?UTF-8?q?=E6=97=B6=20=E5=A2=9E=E5=8A=A0nullValue=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 3 ++- nezha-fronted/src/components/page/dashboard/chartBox.vue | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index a8df07f62..30a6606ff 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -229,6 +229,7 @@ }, end (event) { //console.info("end event:", event) + if(this.dataList.length===1){return}//解决当元素只有一个移动会报错的问题 let item = event.item; let oldIndex = event.oldIndex; let newIndex = event.newIndex; @@ -866,7 +867,7 @@ const axiosArr = chartItem.elements.map((ele) => { const filterItem = ele; let query = encodeURIComponent(filterItem.expression); - if((chartInfo.type==='line'||chartInfo.type==='bar'||chartInfo.type==='stackArea')&&chartInfo.param){//如果是这三个 默认给connected + if((chartInfo.type==='line'||chartInfo.type==='bar'||chartInfo.type==='stackArea'||chartInfo.type==='table')&&chartInfo.param){//如果是这三个 默认给connected chartInfo.param.nullType=chartInfo.param.nullType||'connected'; query+='&nullType='+chartInfo.param.nullType; } diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 9a863dbdf..d1bb50631 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -151,7 +151,7 @@ - + @@ -1249,8 +1249,11 @@ } else { delete params.param.statistics; } - if(this.editChart.type==='line'||this.editChart.type==='bar'||this.editChart.type==='stackArea'){ + if(this.editChart.type==='line'||this.editChart.type==='bar'||this.editChart.type==='stackArea'||this.editChart.type==='table'){ params.param.threshold=this.editChart.param.threshold; + if(this.editChart.type==='table'){ + delete params.param.threshold; + } params.param.nullType=this.editChart.param.nullType; params.param.legendValue=this.editChart.param.legendValue; } else {