diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss index 841a30b60..6dda37943 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss @@ -53,6 +53,11 @@ line-height: 32px; } } + .chart-system-top-box { + .el-form-item__content { + line-height: 32px; + } + } .chart-title-config { border: 1px solid $--border-color-light; border-radius: 2px; diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index 91c2b7134..971c65d56 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -110,7 +110,7 @@ export default { legend = chartInfo.elements[expressionIndex].expression } // 处理legend别名 - alias = chartInfo.datasource === 'system' ? '' : (alias + this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend)) + alias = alias + this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend) if (!alias) { alias = legend } diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index ee7181489..ce17e71fb 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -244,6 +244,7 @@ export default { break } case 'system': { + this.chartInfo.elements = this.chartInfo.param.datasource if (this.chartInfo.type === 'assetInfo') { this.$get('asset/asset/' + this.chartDetailInfo.id).then(res => { this.chartData = res.data diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index 7cf1a244b..77869ea23 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -354,7 +354,8 @@ export default { group: '', select: '', limit: 100, - sort: 'desc' + sort: 'desc', + legend: '' } ], valueMapping: [] @@ -439,6 +440,9 @@ export default { if (this.editChart.param.enable.legend && !this.editChart.param.legend) { this.editChart.param.legend = { placement: 'bottom', values: [], show: true } } + if (this.editChart.param.datasource && !this.editChart.param.datasource[0].legend) { + this.editChart.param.datasource[0].legend = '' + } } } }, diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index 7be1a2509..354f730ad 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -7,8 +7,10 @@ label-position= "top" label-width="120px" > -