提交 7939df9e 编写于 作者: NoSubject's avatar NoSubject 提交者: NoSubject

修复$input的load事件


(cherry picked from commit 3a43b2ab)
上级 33a62229
...@@ -25,8 +25,8 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class( ...@@ -25,8 +25,8 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class(
this._loadNodeEdit(); this._loadNodeEdit();
}, },
_appendVueData: function(){ _appendVueData: function(){
this.form.Macro.environment.data.check(this.json.id); // this.form.Macro.environment.data.check(this.json.id);
this.json[this.json.id] = this._getBusinessData(); // this.json[this.json.id] = this._getBusinessData();
if (!this.json.clearable) this.json.clearable = false; if (!this.json.clearable) this.json.clearable = false;
if (!this.json.size) this.json.size = ""; if (!this.json.size) this.json.size = "";
...@@ -47,7 +47,7 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class( ...@@ -47,7 +47,7 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class(
this._loadOptions(); this._loadOptions();
if (this.json.multiple===true) if (!this.json[this.json.id] || !this.json[this.json.id].length) this.json[this.json.id] = []; if (this.json.multiple===true) if (!this.json[this.json.$id] || !this.json[this.json.$id].length) this.json[this.json.$id] = [];
}, },
appendVueMethods: function(methods){ appendVueMethods: function(methods){
if (this.json.filterMethod && this.json.filterMethod.code){ if (this.json.filterMethod && this.json.filterMethod.code){
...@@ -69,13 +69,25 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class( ...@@ -69,13 +69,25 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class(
if (v.then){ if (v.then){
v.then(function(o){ v.then(function(o){
if (o2.typeOf(o)==="array"){ if (o2.typeOf(o)==="array"){
this.json.options = o; this.json.options = o.map(function(item){
this.json.$options = o; if (o2.typeOf(item)!=="object"){
var value = item.toString();
return {"value": value, "label": value};
}
return item;
});
this.json.$options = Array.clone(this.json.options);
} }
}.bind(this)); }.bind(this));
}else if (o2.typeOf(v)==="array"){ }else if (o2.typeOf(v)==="array"){
this.json.options = v; this.json.options = v.map(function(item){
this.json.$options = v; if (o2.typeOf(item)!=="object"){
var value = item.toString();
return {"value": value, "label": value};
}
return item;
});
this.json.$options = Array.clone(this.json.options);
} }
}, },
_loadOptions: function(){ _loadOptions: function(){
...@@ -103,7 +115,7 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class( ...@@ -103,7 +115,7 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class(
_createElementHtml: function(){ _createElementHtml: function(){
debugger; debugger;
var html = "<el-select"; var html = "<el-select";
html += " v-model=\""+this.json.id+"\""; html += " v-model=\""+this.json.$id+"\"";
html += " :clearable=\"clearable\""; html += " :clearable=\"clearable\"";
html += " :size=\"size\""; html += " :size=\"size\"";
html += " :filterable=\"filterable\""; html += " :filterable=\"filterable\"";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册