From 85a35de8d0e14e0ed95ea8911bb2aa069d21c6e0 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 29 Nov 2021 15:37:08 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1369=20fix=EF=BC=9Achart=20box=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9B=BE=E8=A1=A8=E8=A1=A8=E8=BE=BE=E5=BC=8F=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E4=BB=BB=E6=84=8F=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E9=80=80=E5=87=BA=EF=BC=8C=E4=B8=8D=E4=BC=9A=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/page/dashboard/chartBox.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index ae611235f..dda14c349 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -394,6 +394,7 @@ :expression-list="expressions" :id="promqlKeys[index-1]" :index="index-1" + :required = 'true' :type="promqlType" :key="promqlKeys[index-1]" :plugins="['metric-selector', 'metric-input', 'remove']" @@ -791,7 +792,14 @@ export default { this.$set(this.editChart, 'unit', Number.parseInt(unit)) }, expressionChange: function () { - + if (this.expressions[0]) { + this.editChart.elements = [] + this.expressions.forEach((expr, i) => { + this.editChart.elements.push({ id: this.elementIds[i], expression: expr, type: 'expert', legend: this.legends[i] }) + }) + } else { + this.editChart.elements = [] + } }, addExpression () { this.expressions.push('')