From 7e21a0476382a2a4e2fcb35242f79fd08fc47aff Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 1 Jul 2022 16:42:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?NEZ-1991=20feat=20:=20chart=20=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=20metric/log=20=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=BC=8F=20=E6=94=AF=E6=8C=81=20=E4=BF=AE=E6=94=B9=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE=E5=BC=8F=E6=98=AF=E5=90=A6=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bottomBox/tabs/panelTabNew.vue | 2 +- .../common/rightBox/chart/chartConfig.vue | 9 ++++++++- .../common/rightBox/chart/chartRightBox.vue | 4 ++-- .../common/rightBox/chart/publicConfig.js | 16 +++++++++++++--- .../page/config/template/chartTemp.vue | 2 +- .../page/dashboard/explore/exploreItem.vue | 4 ++-- .../src/components/page/dashboard/panel.vue | 2 +- 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index 3b7a19a08..d8a17da33 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -228,7 +228,7 @@ export default { thresholdShow: true, thresholds: [{ value: undefined, color: randomcolor() }] }, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }], panel: '', sync: 0, remark: '', diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index 1a8133afc..6783540b5 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -52,7 +52,14 @@
{{expressionsShow[index-1].error}}
- + + + + + + + + diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index b3e72839f..a86f6a43b 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -362,7 +362,7 @@ export default { type: 'line', min: 0, max: 100, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }], param: { stack: 0, nullType: 'null', @@ -389,7 +389,7 @@ export default { legend: true, valueMapping: false }, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }], param: { limit: 100, showHeader: this.editChart.param.showHeader diff --git a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js index 6d2b9667b..7bf8a6917 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js +++ b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js @@ -329,13 +329,21 @@ export default { if (this.expressions.length) { this.chartConfig.elements = [] this.expressions.forEach((expr, i) => { - this.chartConfig.elements.push({ id: this.expressionsShow[i].elementId, expression: expr, type: 'expert', legend: this.expressionsShow[i].legend, name: this.expressionName[i] }) + this.chartConfig.elements.push({ id: this.expressionsShow[i].elementId, expression: expr, type: 'expert', legend: this.expressionsShow[i].legend, name: this.expressionName[i], state: this.expressionsShow[i].state }) }) } else { this.chartConfig.elements = [] } this.change() }, + switchExpression (index, flag) { + if (flag === 1) { + this.$set(this.expressionsShow[index], 'state', 0) + } else { + this.$set(this.expressionsShow[index], 'state', 1) + } + this.expressionChange() + }, expressionNameChange (index) { if (this.expressionsShow[index].error) { this.expressionName[index] = this.expressionsShow[index].oldName @@ -383,7 +391,8 @@ export default { oldName: expressionName, error: '', legend: '', - elementId: '' + elementId: '', + state: 1 }) this.expressionChange() } else { @@ -396,7 +405,8 @@ export default { oldName: item.name, error: '', elementId: item.id, - legend: item.legend + legend: item.legend, + state: item.state } ) } diff --git a/nezha-fronted/src/components/page/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue index 7e01a95f4..fa531356a 100644 --- a/nezha-fronted/src/components/page/config/template/chartTemp.vue +++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue @@ -182,7 +182,7 @@ export default { thresholdShow: true, thresholds: [{ value: undefined, color: randomcolor() }] }, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }], panel: '', sync: 0, remark: '', diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 14333f5ad..fba1e53b6 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -989,7 +989,7 @@ export default { groupId: -1 } this.expressions.forEach((exp, index) => { - chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '', name: 'A' }) + chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '', name: 'A', state: 1 }) }) this.chartData = chart this.rightBox.show = true @@ -1026,7 +1026,7 @@ export default { remark: '' } this.expressions.forEach((exp, index) => { - chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '', name: 'A' }) + chart.elements.push({ expression: exp, legend: '', type: 'expert', id: '', name: 'A', state: 1 }) }) this.chartData = chart this.rightBox.show = true diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 0e36736cc..6eed7f54a 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -231,7 +231,7 @@ export default { thresholds: [{ value: undefined, color: randomcolor() }], showHeader: 1 }, - elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }], + elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }], panel: '', sync: 0, remark: '', From 8c731139f8c7c5dc957ced22bd69fcd7e0bfdbc6 Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 1 Jul 2022 17:08:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?NEZ-2000=20fix=20:=20=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=20=E5=9B=BE=E6=A0=87=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/css/components/common/timePicker.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nezha-fronted/src/assets/css/components/common/timePicker.scss b/nezha-fronted/src/assets/css/components/common/timePicker.scss index 0f02bd3de..b3ec8a5ed 100644 --- a/nezha-fronted/src/assets/css/components/common/timePicker.scss +++ b/nezha-fronted/src/assets/css/components/common/timePicker.scss @@ -311,6 +311,13 @@ } .el-date-range-picker.el-picker-panel__body__only { width: 324px; + .el-date-range-picker__header{ + .el-picker-panel__icon-btn.el-icon-arrow-right{ + font-size: 12px; + color: $--button-icon-color; + transform: scale(0.8); + } + } } .el-date-range-picker__content.el-date-range-picker__content__only{ width: 100%;