diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index c81a1f89a..7a41cb76e 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -25,7 +25,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/chart-bar-statistics.vue b/nezha-fronted/src/components/charts/chart-bar-statistics.vue index d1c37ecdb..efd5a1dd1 100644 --- a/nezha-fronted/src/components/charts/chart-bar-statistics.vue +++ b/nezha-fronted/src/components/charts/chart-bar-statistics.vue @@ -25,7 +25,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/chart-group.vue b/nezha-fronted/src/components/charts/chart-group.vue index 71fe3999a..4c8fdbe4c 100644 --- a/nezha-fronted/src/components/charts/chart-group.vue +++ b/nezha-fronted/src/components/charts/chart-group.vue @@ -19,7 +19,7 @@ ({{chartData.children.length}} charts) - + @@ -226,6 +226,10 @@ export default { this.dropdownMenuShow = false this.$emit('on-remove-group-chart', chart) }, + // 删除group 下的该图表 + removeChartGroup (chart) { + this.$emit('on-remove-group-chart', chart) + }, addGroupItemChart () { this.$emit('on-add-group-item-chart', this.data.id) }, diff --git a/nezha-fronted/src/components/charts/chart-pie.vue b/nezha-fronted/src/components/charts/chart-pie.vue index c0b027a92..94dd2c393 100644 --- a/nezha-fronted/src/components/charts/chart-pie.vue +++ b/nezha-fronted/src/components/charts/chart-pie.vue @@ -25,7 +25,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/chart-single-stat.vue b/nezha-fronted/src/components/charts/chart-single-stat.vue index fd81e4961..43720c1ee 100644 --- a/nezha-fronted/src/components/charts/chart-single-stat.vue +++ b/nezha-fronted/src/components/charts/chart-single-stat.vue @@ -25,7 +25,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue index 5afe9434c..5b42138f7 100644 --- a/nezha-fronted/src/components/charts/chart-table.vue +++ b/nezha-fronted/src/components/charts/chart-table.vue @@ -26,7 +26,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/chart-url.vue b/nezha-fronted/src/components/charts/chart-url.vue index aa725b1d6..d1a160579 100644 --- a/nezha-fronted/src/components/charts/chart-url.vue +++ b/nezha-fronted/src/components/charts/chart-url.vue @@ -13,7 +13,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/charts/text-chart.vue b/nezha-fronted/src/components/charts/text-chart.vue index 5709fbf0e..7cb73c1ff 100644 --- a/nezha-fronted/src/components/charts/text-chart.vue +++ b/nezha-fronted/src/components/charts/text-chart.vue @@ -13,7 +13,7 @@ {{chartData.name}} - + diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 1835b30e5..d0e647ea7 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -874,7 +874,7 @@ export default { }); */ // panelPromise.then(()=>{ - console.log(this.editChart) + console.log(this.editChart,params) if (this.panelId) { const chartParams = params || this.editChart chartParams.panelId = this.panelId @@ -948,7 +948,8 @@ export default { param: { }, - sync: this.editChart.sync + sync: this.editChart.sync, + groupId: this.editChart.groupId } if (this.editChart.type === 'singleStat' || this.editChart.type === 'pie' || this.editChart.type === 'bar') { // params.param.statistics=this.statistics; @@ -1012,7 +1013,8 @@ export default { unit: this.editChart.unit, param: param, sync: this.editChart.sync, - remark: this.editChart.remark + remark: this.editChart.remark, + groupId: this.editChart.groupId, } if (valid) { if (opType === 'preview') { @@ -1080,7 +1082,8 @@ export default { url: this.editChart.param.url }, sync: this.editChart.sync, - remark: this.editChart.remark + remark: this.editChart.remark, + groupId: this.editChart.groupId, } if (valid) { @@ -1108,7 +1111,8 @@ export default { text: text }, sync: this.editChart.sync, - remark: this.editChart.remark + remark: this.editChart.remark, + groupId: this.editChart.groupId } if (valid) { @@ -1484,6 +1488,11 @@ export default { if (this.editChart.type != 'singleStat' && this.editChart.type != 'pie' && this.editChart.type != 'table') { delete params.param.statistics } + + if(this.editChart.type === 'bar' && this.editChart.param.statistics && this.editChart.param.statistics !== 'null'){ + params.param.statistics = this.editChart.param.statistics + } + 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') { diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 1e57e72c6..3289169f6 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -347,6 +347,9 @@ export default { if (chartList[i].id === data.id) { chartList.splice(i, 1) } + if (chartList[i].type === 'group') { + chartList[i].children = chartList[i].children.filter((item) => item.id !== data.id) + } // if(data.next != -1){ // if(chartList[i].id === data.next){ // nextChart = chartList[i]