NEZ-1924 fix:Explore保存Metrics时不显示表达式

This commit is contained in:
zhangyu
2022-06-13 18:55:11 +08:00
parent a9b350c542
commit 00b4d5d5d2
2 changed files with 16 additions and 8 deletions

View File

@@ -46,6 +46,7 @@
style="">
<promql-input
:from-father-data="true"
:isTopo="true"
:metricOptionsParent="metricOptions"
:id="index"
:key="index"
@@ -222,6 +223,7 @@
style="width: 100%; border-radius: 2px; padding-right: 60px;">
<promql-input
:from-father-data="true"
:isTopo="true"
:metricOptionsParent="metricOptions"
:id="index"
:pqid="'vm'"

View File

@@ -464,6 +464,10 @@ export default {
},
type: {
type: String // metric和log两种为空时视为metric
},
isTopo: {
type: Boolean,
default: false
}
// metricOptions: {type: Array},
// metricStore: {type: Array}
@@ -1098,14 +1102,16 @@ export default {
immediate: true,
handler (n, o) {
this.codeMirrorValue[this.index] = n[this.index]
// setTimeout(() => {
// const text = this.newView.state.doc.toString()
// this.newView.dispatch(
// this.newView.state.update({
// changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] }
// })
// )
// }, 200)
if (this.isTopo) {
setTimeout(() => {
const text = this.newView.state.doc.toString()
this.newView.dispatch(
this.newView.state.update({
changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] }
})
)
}, 200)
}
}
},