diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index 1d4f134c5..1300e1ead 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -177,10 +177,10 @@ :label="$t('dashboard.panel.chartForm.limit')" class="form-item--half-width" prop="param.limit"> - @@ -389,11 +389,11 @@ :color-val="item.color" @colorChange="(color,key)=>{colorChange(color,key,index)}" /> - - + > - + > - + > @@ -535,7 +535,7 @@
Display
- + @@ -581,7 +581,7 @@
Title
- +
@@ -600,7 +600,7 @@
Display
- + diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index 4333b1f4f..a16d329ba 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -187,6 +187,7 @@ export default { }, selectPanel (panel) { this.panelName = panel.name + this.editChart.panelName = panel.name this.panelId = panel.id this.editChart.groupId = '' this.$get('visual/panel/chart?panelId=' + this.panelId + '&pageSize=-1').then(response => { diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index 786a2dd81..b2e62aefe 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -67,7 +67,7 @@ class="form-item--half-width" prop="param.limit" > - +
@@ -252,12 +252,12 @@ :rules="{ required: true, message: $t('validate.required'), trigger: 'change'}" class="thresholds-from-item" > - + >
- + > - + > - + @@ -307,12 +307,14 @@ import { getUUID } from '../../../common/js/common' import chartDataFormat from '../../../charts/chartDataFormat' import logTab from './logTab' import promqlInputMixin from '@/components/common/mixin/promqlInput' +import chartRightBox from '@/components/common/rightBox/chart/chartRightBox' export default { name: 'exploreItem', components: { 'promql-input': promqlInput, 'chart-box': chartBox, + chartRightBox, chart, logTab }, @@ -911,23 +913,29 @@ export default { }, saveChart () { const chart = { + id: '', name: '', + panelName: '', type: 'line', - span: 12, - height: '400', - unit: this.chartUnit, + span: 4, + datasource: '1', + height: 4, + unit: 2, param: { - url: '', - threshold: '' + stack: 0, + nullType: 'null', + legend: { placement: 'bottom', values: [], show: true }, + thresholdShow: true, + thresholds: [{ value: undefined, color: '#eeeeeeff' }] }, elements: [], panel: '', sync: 0, - groupId: '', - remark: '' + remark: '', + groupId: -1 } - this.expressions.forEach((exp) => { - chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '' }) + this.expressions.forEach((exp, index) => { + chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '', name: 'A' }) }) this.chart = chart this.rightBox.show = true