From aba633242fe365950a30f9fb17315eeee76d55b5 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 24 Dec 2021 16:06:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20chart=E6=B7=BB=E5=8A=A0link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chartHeader.vue | 8 +++++++ .../common/rightBox/chart/chartConfig.vue | 4 ++++ .../common/rightBox/chart/chartRightBox.vue | 22 ++++++++++++++----- .../rightBox/chart/otherChartConfig.vue | 4 ++++ .../rightBox/chart/systemChartConfig.vue | 2 ++ 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartHeader.vue b/nezha-fronted/src/components/chart/chartHeader.vue index 6051ff878..f65ded190 100644 --- a/nezha-fronted/src/components/chart/chartHeader.vue +++ b/nezha-fronted/src/components/chart/chartHeader.vue @@ -32,6 +32,9 @@ {{chartInfo.name}}
+ + + @@ -80,5 +83,10 @@ import chartHeaderMixin from '@/components/chart/chartHeaderMixin' export default { name: 'chartHeader', mixins: [chartHeaderMixin], + methods: { + openUrl () { + window.open(this.chartInfo.param.link) + } + } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index a63cd43c0..c3cf325bb 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -786,6 +786,7 @@ export default { } this.chartConfig.param = { stack: 0, + link: this.chartConfig.param.link, nullType: this.chartConfig.param.nullType, legend: { placement: 'bottom', values: [], show: true }, thresholdShow: true, @@ -810,6 +811,7 @@ export default { } this.chartConfig.param = { nullType: this.chartConfig.param.nullType, + link: this.chartConfig.param.link, statistics: 'last', text: 'value', valueMapping: [], @@ -828,6 +830,7 @@ export default { } this.chartConfig.param = { nullType: this.chartConfig.param.nullType, + link: this.chartConfig.param.link, statistics: 'last', columns: [], tags: [], @@ -845,6 +848,7 @@ export default { break } this.chartConfig.param = { + link: this.chartConfig.param.link, limit: 100 } break diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index a4e63d55f..5ddd599a8 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -52,6 +52,10 @@ + + + +
@@ -161,7 +165,8 @@ export default { previewShow: false, editChart: { name: '', - remark: '' + remark: '', + link: '' }, panel: { id: '', @@ -421,11 +426,16 @@ export default { if (this.editChart.groupId === -1) { this.editChart.groupId = '' } - if (!this.editChart.param.min) { - this.editChart.param.min = 0 - } - if (!this.editChart.param.max) { - this.editChart.param.max = 100 + if (this.editChart.param) { + if (!this.editChart.param.min) { + this.editChart.param.min = 0 + } + if (!this.editChart.param.max) { + this.editChart.param.max = 100 + } + if (!this.editChart.param.link) { + this.$set(this.editChart.param, 'link', '') + } } } }, diff --git a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue index 2d09b51a9..e240eb4b9 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue @@ -191,21 +191,25 @@ export default { case 'group': this.chartConfig.span = 12 this.chartConfig.param = { + link: this.chartConfig.param.link, collapse: true } break case 'text': this.chartConfig.param = { + link: this.chartConfig.param.link, text: '' } break case 'diagram': this.chartConfig.param = { + link: this.chartConfig.param.link, topo: '' } break case 'url': this.chartConfig.param = { + link: this.chartConfig.param.link, url: '' } break diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index 08edca506..ffc2f01c4 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -598,6 +598,7 @@ export default { break } this.chartConfig.param = { + link: this.chartConfig.param.link, refer: 1, nullType: 'null', statistics: 'last', @@ -625,6 +626,7 @@ export default { break case 'table': this.chartConfig.param = { + link: this.chartConfig.param.link, refer: 1, system: '', indexs: '',