Browse Source

Merge branch 'cherry-pick-afa8dd01' into 'develop'

Merge branch 'fix/Proces_o2_identity_execption' into 'develop'

See merge request o2oa/o2oa!1275
蔡祥熠 5 years ago
parent
commit
10ac78fb64

+ 8 - 0
o2web/source/o2_core/o2/widget/AttachmentController.js

@@ -71,6 +71,14 @@ o2.widget.AttachmentController = o2.widget.ATTER  = new Class({
             }
         }
         this.checkActions();
+    },
+    getAttachmentById: function(attId){
+        for( var i=0; i<this.attachments.length; i++ ){
+            if( this.attachments[i].data.id === attId ){
+                return this.attachments[i];
+            }
+        }
+        return null;
     },
 	loadMax: function(){
         if (!this.node) this.node = new Element("div", {"styles": this.css.container});

+ 1 - 1
o2web/source/o2_core/o2/widget/O2Identity.js

@@ -8,7 +8,7 @@ o2.widget.O2Identity = new Class({
 	options: {
 		"style": "default",
         "canRemove": false,
-        "lazy": true,
+        "lazy": false,
         "disableInfor" : false
 	},
 	initialize: function(data, container, options){

+ 18 - 2
o2web/source/x_component_process_Xform/Attachment.js

@@ -495,7 +495,7 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
 
         if (!att.data.person && att.data.creatorUid) att.data.person = att.data.creatorUid;
 
-        if ((!att.data.control.allowControl || !att.data.control.allowEdit) && att.data.person !== user) {
+        if ((!att.data.control.allowControl) && att.data.person !== user) { //|| !att.data.control.allowEdit
             flag = false;
         }
         return flag;
@@ -749,7 +749,23 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
                 att.data.controllerUnitList = controllerUnitList;
                 att.data.controllerIdentityList = controllerIdentityList;
 
-                o2.Actions.get("x_processplatform_assemble_surface").configAttachment(att.data.id, this.module.form.businessData.work.id, att.data);
+                o2.Actions.get("x_processplatform_assemble_surface").configAttachment(att.data.id, this.module.form.businessData.work.id, att.data, function () {
+                    //刷新附件权限,以后要加一个刷新附件的功能
+                    o2.Actions.load("x_processplatform_assemble_surface").AttachmentAction.getWithWorkOrWorkCompleted(att.data.id, this.module.form.businessData.work.id, function (json) {
+                        var attachment = this.getAttachmentById( att.data.id );
+                        if( attachment ){
+                            attachment.data = json.data;
+
+                            if( attachment.deleteAction && !this.isAttDeleteAvailable(attachment) ){
+                                attachment.deleteAction.setStyle("display","none");
+                            }
+
+                            if( attachment.configAction && !this.isAttConfigAvailable(attachment) ){
+                                attachment.configAction.setStyle("display","none");
+                            }
+                        }
+                    }.bind(this))
+                }.bind(this));
             }.bind(this));
         }
     },