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

View File

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