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

将elementui组件加入到数据表格中-elinput,elcheckbox,elselect

上级 9246673e
...@@ -21,7 +21,8 @@ MWF.xApplication.process.FormDesigner.Module.Datatable$Data = MWF.FCDatatable$Da ...@@ -21,7 +21,8 @@ MWF.xApplication.process.FormDesigner.Module.Datatable$Data = MWF.FCDatatable$Da
"title": MWF.LP.process.formAction.deleteCol "title": MWF.LP.process.formAction.deleteCol
} }
], ],
"allowModules": ["textfield", "number", "personfield", "orgfield", "org", "calendar", "textarea", "select", "radio", "checkbox", "combox", "image", "label", "htmleditor", "tinymceeditor", "button","imageclipper", "address", "attachment"] "allowModules": ["textfield", "number", "personfield", "orgfield", "org", "calendar", "textarea", "select", "radio", "checkbox", "combox", "image", "label",
"htmleditor", "tinymceeditor", "button","imageclipper", "address", "attachment", "elinput", "elcheckbox", "elselect"]
}, },
initialize: function(form, options){ initialize: function(form, options){
......
...@@ -69,6 +69,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class( ...@@ -69,6 +69,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
}, },
_loadNode: function(){ _loadNode: function(){
debugger
if (this.isReadonly()){ if (this.isReadonly()){
this._loadNodeRead(); this._loadNodeRead();
}else{ }else{
......
...@@ -71,6 +71,28 @@ MWF.xApplication.process.Xform.Elcheckbox = MWF.APPElcheckbox = new Class( ...@@ -71,6 +71,28 @@ MWF.xApplication.process.Xform.Elcheckbox = MWF.APPElcheckbox = new Class(
this._loadNodeEdit(); this._loadNodeEdit();
} }
}, },
_loadNodeRead: function(){
this.node.empty();
this.node.set({
"nodeId": this.json.id,
"MWFType": this.json.type
});
var radioValues = this.getOptions();
var value = this.getValue();
if (value){
var texts = [];
radioValues.each(function(item){
var tmps = item.split("|");
var t = tmps[0];
var v = tmps[1] || t;
if (value.indexOf(v)!=-1){
texts.push(t);
}
});
this.node.set("text", texts.join(", "));
}
},
_resetNodeEdit: function(){ _resetNodeEdit: function(){
var div = new Element("div"); var div = new Element("div");
div.inject(this.node, "after"); div.inject(this.node, "after");
......
...@@ -216,5 +216,32 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class( ...@@ -216,5 +216,32 @@ MWF.xApplication.process.Xform.Elselect = MWF.APPElselect = new Class(
html += "</el-select>"; html += "</el-select>";
return html; return html;
}, },
_afterLoaded: function(){
if (this.isReadonly()){
this.node.hide();
window.setTimeout(function(){
var text = "";
var nodes = this.node.getElements(".el-select__tags-text");
if (nodes && nodes.length){
nodes.forEach(function(n){
text += ((text) ? ", " : "")+n.get("text");
});
}
var node = new Element("div").inject(this.node, "before");
this.node.destroy();
this.node = node;
this.node.set({
"nodeId": this.json.id,
"MWFType": this.json.type
});
this._loadDomEvents();
//this.node.removeEvents("click");
//this.node.empty();
this.node.set("text", text);
//this.node.show();
}.bind(this), 20);
}
},
__setReadonly: function(data){} __setReadonly: function(data){}
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册