diff --git a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue index 5326a833f..5555196fa 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue @@ -140,7 +140,7 @@ - @@ -284,6 +284,7 @@ export default { // this.$refs.editor.setContent(value) this.dropDownVisible = false this.$emit('change', value) + this.$forceUpdate(); }, metricKeyDown (val) { if (this.required) { @@ -330,12 +331,12 @@ export default { }) } else { this.dropDownVisible = false - if (!data.value) { - this.metricChange(data.expression) - return - } this.$get('/expression/tmpl/' + data.id).then(res => { if (res.code === 200) { + if (!res.data.vars || !res.data.vars.length) { + this.metricChange(data.expression) + return + } res.data.vars.forEach(item => { res.data[item] = '' const arr = item.split('.')