NEZ-2727 fix:Chart Metric 复制&预览异常
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
class="element-item form-row-item thresholds-from-item"
|
||||
style="margin-bottom: 10px !important"
|
||||
v-for="index of chartConfig.elements.length"
|
||||
:key="index"
|
||||
:key="expressionName[index-1] + index"
|
||||
>
|
||||
<div class="chart-title chart-title-config">
|
||||
<span class="chart-title-content el-form-item" :class="{
|
||||
|
||||
@@ -386,6 +386,7 @@ export default {
|
||||
if (this.expressions.length) {
|
||||
this.chartConfig.elements = []
|
||||
this.expressions.forEach((expr, i) => {
|
||||
if (this.expressionsShow[i]) {
|
||||
this.chartConfig.elements.push({
|
||||
id: this.expressionsShow[i].elementId,
|
||||
expression: expr,
|
||||
@@ -395,6 +396,7 @@ export default {
|
||||
state: this.expressionsShow[i].state,
|
||||
orderNum: i
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.chartConfig.elements = []
|
||||
@@ -500,14 +502,6 @@ export default {
|
||||
elementId: ''
|
||||
}
|
||||
)
|
||||
this.$nextTick(() => {
|
||||
this.expressions.forEach((ex, index) => {
|
||||
if (ex) {
|
||||
this.$refs[`promql-${index}`][0].metricChange(ex)
|
||||
this.$refs[`promql-${index}`][0].promqlInputChange(ex)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.expressionChange()
|
||||
},
|
||||
removeExpression (index) {
|
||||
@@ -518,14 +512,6 @@ export default {
|
||||
this.chartConfig.elements.forEach((item, index) => {
|
||||
this.$refs.chartForm.validateField('elements.' + index + '.expression')
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.expressions.forEach((ex, index) => {
|
||||
if (ex) {
|
||||
this.$refs[`promql-${index}`][0].metricChange(ex)
|
||||
this.$refs[`promql-${index}`][0].promqlInputChange(ex)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.expressionChange()
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user