NEZ-1369 fix:chart box 修改图表表达式时,点击任意位置退出,不会弹出提示框

This commit is contained in:
zhangyu
2021-11-29 15:37:08 +08:00
parent 8f12539996
commit 85a35de8d0

View File

@@ -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('')