From 2ca8bd373e393ac8f31356a8e3e19a390e20f394 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 3 Dec 2021 16:13:45 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA=20=E4=BB=A5=E5=8F=8A=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BAinput=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chart/chartHexagon.vue | 1 - nezha-fronted/src/components/chart/panelChart.vue | 1 - .../components/common/honeycomb/hexagonFigureSvg.vue | 1 - .../components/common/rightBox/chart/chartConfig.vue | 8 +++++--- .../components/common/rightBox/chart/publicConfig.js | 12 ++++++++---- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/chartHexagon.vue b/nezha-fronted/src/components/chart/chart/chartHexagon.vue index 553cfc036..f9d1b803c 100644 --- a/nezha-fronted/src/components/chart/chart/chartHexagon.vue +++ b/nezha-fronted/src/components/chart/chart/chartHexagon.vue @@ -63,7 +63,6 @@ export default { immediate: true, deep: true, handler () { - console.log(this.chartData) } }, chartInfo: { diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 8d9731d4d..fa3958779 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -152,7 +152,6 @@ export default { !severityData.P3 && (severityData.P3 = 0) moduleStateData.push({ ...alertTopModules[i], alert: [severityData] }) }) - console.log(moduleStateData) resolve(moduleStateData) }) } diff --git a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue index 46fafacf3..0db2e3c7f 100644 --- a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue +++ b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue @@ -173,7 +173,6 @@ export default { deep: true, handler (n) { this.init() - console.log(n) } }, col: { // 列数 diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index d021acc94..1d4f134c5 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -41,11 +41,13 @@ }">
{{expressionsShow[index-1].error}}
@@ -796,13 +798,13 @@ export default { }, end (event) { this.expressions = [] - this.expressionsShow = [] this.expressionName = [] if (!this.chartConfig.elements.length) { this.addExpression() } else { this.chartConfig.elements.forEach(item => { - this.addExpression(item) + this.expressions.push(item.expression) + this.expressionName.push(item.name) }) } this.change() diff --git a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js index 023cda341..fdb1d72ba 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js +++ b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js @@ -162,10 +162,11 @@ export default { if (this.expressionsShow[index].error) { this.expressionName[index] = this.expressionsShow[index].oldName this.expressionsShow[index].error = '' + } else if (!this.expressionName[index]) { + this.expressionName[index] = this.expressionsShow[index].oldName } else { this.expressionsShow[index].oldName = this.expressionName[index] } - this.expressionsShow[index].hideInput = true this.$refs.chartForm.clearValidate('elements.' + (index - 1) + '.expression') this.expressionChange() }, @@ -173,13 +174,15 @@ export default { const findIndex = this.expressionName.indexOf(val) const lastIndex = this.expressionName.lastIndexOf(val) if (findIndex !== -1 && lastIndex != -1 && lastIndex !== findIndex) { - this.expressionsShow[index].error = 'The name duplicate' + this.expressionsShow[index].error = this.$t('error.nameDuplicate') + } else if (!val) { + this.expressionsShow[index].error = this.$t('validate.required') } else { this.expressionsShow[index].error = '' } }, - showInput (index) { - this.expressionsShow[index].hideInput = false + showInput (index, flag) { + this.expressionsShow[index].hideInput = flag }, transformNumToLetter (num) { // 相当于26进制 获取id const self = this @@ -220,6 +223,7 @@ export default { ) } }, + getExpressionName () { let name = '' for (let i = 0; i <= this.expressionName.length; i++) {