fix : 实现下拉框选择值显示 、save提交正常 edit回显仍有问题

This commit is contained in:
zhangxiaolong
2022-04-21 10:58:53 +08:00
parent 2258d4c058
commit 5f0490ef6f
2 changed files with 16 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
display: flex; display: flex;
#editor{ #editor{
width: 100%; width: 100%;
border: 1px solid $--border-color-light;
} }
.no-resize{ .no-resize{
background: rgba(255,255,255,0); background: rgba(255,255,255,0);

View File

@@ -572,7 +572,7 @@ export default {
...completionKeymap, ...completionKeymap,
...lintKeymap ...lintKeymap
]), ]),
placeholder('Expression (press Shift+Enter for newlines)'), // placeholder('Expression (press Shift+Enter for newlines)'),
dynamicConfigCompartment.of(dynamicConfig), dynamicConfigCompartment.of(dynamicConfig),
// This keymap is added without precedence so that closing the autocomplete dropdown // This keymap is added without precedence so that closing the autocomplete dropdown
// via Escape works without blurring the editor. // via Escape works without blurring the editor.
@@ -618,9 +618,11 @@ export default {
self.newView = view self.newView = view
} else { } else {
console.log('viewIsOk') console.log('viewIsOk')
const { from, to } = self.newView.state.selection.ranges[0]
self.newView.dispatch( self.newView.dispatch(
self.newView.state.update({ self.newView.state.update({
effects: dynamicConfigCompartment.reconfigure(dynamicConfig) effects: dynamicConfigCompartment.reconfigure(dynamicConfig),
changes:{from,to,insert:self.codeMirrorValue}
}) })
) )
} }
@@ -777,6 +779,7 @@ export default {
this.codeMirrorValue = value this.codeMirrorValue = value
this.dropDownVisible = false this.dropDownVisible = false
this.$emit('change', value) this.$emit('change', value)
// this.initCodeMirror()
this.$forceUpdate() this.$forceUpdate()
this.cascaderValue = '' this.cascaderValue = ''
}, },
@@ -787,7 +790,6 @@ export default {
this.$emit('change', value) this.$emit('change', value)
this.$forceUpdate() this.$forceUpdate()
this.cascaderValue = '' this.cascaderValue = ''
this.initCodeMirror()
}, },
logLabelChange (value) { logLabelChange (value) {
if (!value || value.length === 0) return if (!value || value.length === 0) return
@@ -1079,7 +1081,16 @@ export default {
this.metricOptions = JSON.parse(JSON.stringify(n)) this.metricOptions = JSON.parse(JSON.stringify(n))
} }
} }
} },
// expressionList:{
// deep: true,
// immediate: true,
// handler (n, o) {
// console.log(n,n[this.index]);
// this.codeMirrorValue = n[this.index];
// this.initCodeMirror()
// }
// }
} }
} }
</script> </script>