```
//重写附件控件
MWF.xApplication.process.Xform.AttachmentController.implement({
updateAttName : function(id,name){
var workid = this.module.form.businessData.work.id;
o2.Actions.load("x_processplatform_assemble_surface").AttachmentAction.updateContent(id,workid,{
"fileName" : name
},function( json ){
this.module.reload(true);
}.bind(this));
},
configAttachment: function(){
var att = this.selectedAttachments[0].data;
var node = new Element("textarea",{"style":"width:95%;","value":att.name.replace("." + att.extension,"")});
var options = Object.merge({
"title": "附件重命名",
"style": this.module.form.json.dialogStyle || "user",
"isResize": false,
"content": node,
"container": this.module.form.app.content,
"maskNode": this.module.form.app.content,
"buttonList": [
{
"type": "ok",
"text": MWF.LP.process.button.ok,
"action": function () {
this.updateAttName(att.id,node.get("value"));
dlg.close();
}.bind(this)
},
{
"type": "cancel",
"text": MWF.LP.process.button.cancel,
"action": function () { dlg.close(); }
}
]
}, (this.module.form.json.dialogOptions||{}));
if( layout.mobile ){
var size = $(document.body).getSize();
options.width = size.x;
options.height = size.y;
}
var dlg = o2.DL.open( options );
},
})
```
评论