This commit is contained in:
yumoqing 2024-02-21 14:20:28 +08:00
parent 1f19465f65
commit f92a8a3f23

View File

@ -504,6 +504,7 @@ bricks.UiText =class extends bricks.UiType {
this.value = this.dom_element.innerText; this.value = this.dom_element.innerText;
} }
resultValue(){ resultValue(){
this.value = this.dom_element.innerText;
return this.value; return this.value;
} }
setValue(v){ setValue(v){
@ -572,12 +573,17 @@ bricks.UiCode =class extends bricks.UiType {
e.replaceChildren(); e.replaceChildren();
var v = this.opts.value || this.opts.defaultvalue; var v = this.opts.value || this.opts.defaultvalue;
this.value = v; this.value = v;
e.value = v;
this.option_widgets = {}; this.option_widgets = {};
for (var i=0; i<data.length; i++){ for (var i=0; i<data.length; i++){
var o = document.createElement('option'); var o = document.createElement('option');
o.value = data[i][this.opts.valueField||'value']; o.value = data[i][this.opts.valueField||'value'];
o.innerText = bricks.app.i18n._(data[i][this.opts.textField||'text']); o.innerText = bricks.app.i18n._(data[i][this.opts.textField||'text']);
this.option_widgets[o.value] = o; this.option_widgets[o.value] = o;
if (!v && i == 0){
v = o.value;
e.value = o.value;
}
if (o.value == v){ if (o.value == v){
o.selected = true; o.selected = true;
} }