Sfoglia il codice sorgente

Merge branch 'fix/Process.mobile_blue_flat' into 'develop'

Merge of fix/【流程管理】流程表单移动端蓝白界面修改 to develop

See merge request o2oa/o2oa!845
蔡祥熠 5 anni fa
parent
commit
01d17bcdb9

+ 2 - 2
o2web/source/o2_core/o2/widget/$Dialog/mobile_blue_flat/dialog.html

@@ -5,7 +5,7 @@
     </div>
     <div class="MWF_dialod_content" style="text-align: left; padding: 0px; line-height:20px;background:#f5f5f5;overflow:auto;"></div>
     <div class="MWF_dialod_button" style="height: 64px; margin: 0px 0px;background: #ffffff;border-top:1px solid #F0F0F0;">
-        <input type="button" class="MWF_dialod_cancel_button" style="display: none;"/>
-        <input type="button" class="MWF_dialod_ok_button" style="display: none;"/>
+        <div class="MWF_dialod_cancel_button" style="display: none;"></div>
+        <div class="MWF_dialod_ok_button" style="display: none;"></div>
     </div>
 </div>

+ 29 - 12
o2web/source/o2_core/o2/xDesktop/Dialog.js

@@ -134,19 +134,36 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
                     button = this.cancelButton;
                     button.show();
                 }else{
-                    button = new Element("input", {
-                        "type": "button"
-                    }).inject(this.button);
-                }
-                button.set({
-                    "value": bt.text,
-                    "title": bt.title,
-                    "styles": styles,
-                    "class": (bt.type!=="cancel") ? "mainColor_bg" : "",
-                    "events": {
-                        "click": function(e){bt.action.call(this, this, e)}.bind(this)
+                    if( !bt.tag ){
+                        button = new Element("input", {
+                            "type": "button"
+                        }).inject(this.button);
+                    }else{
+                        button = new Element( bt.tag, {}).inject(this.button);
                     }
-                })
+                }
+                debugger;
+                if( button.get("type") === "button" ){
+                    button.set({
+                        "value": bt.text,
+                        "title": bt.title,
+                        "styles": styles,
+                        "class": (bt.type!=="cancel") ? "mainColor_bg" : "",
+                        "events": {
+                            "click": function(e){bt.action.call(this, this, e)}.bind(this)
+                        }
+                    })
+                }else{
+                    button.set({
+                        "text": bt.text,
+                        "title": bt.title,
+                        "styles": styles,
+                        "class": (bt.type!=="cancel") ? "mainColor_bg" : "",
+                        "events": {
+                            "click": function(e){bt.action.call(this, this, e)}.bind(this)
+                        }
+                    })
+                }
             }.bind(this));
         }
     },

+ 16 - 0
o2web/source/x_component_process_FormDesigner/Module/Attachment/template.json

@@ -20,6 +20,22 @@
       "code": "",
       "html": ""
     },
+    "queryDownload": {
+      "code": "",
+      "html": ""
+    },
+    "download": {
+      "code": "",
+      "html": ""
+    },
+    "queryOpen": {
+      "code": "",
+      "html": ""
+    },
+    "open": {
+      "code": "",
+      "html": ""
+    },
     "click": {
       "code": "",
       "html": ""

+ 3 - 3
o2web/source/x_component_process_FormDesigner/Module/Form/skin/styles_mobile-blue-flat.json

@@ -148,8 +148,8 @@
     "styles": {
       "margin-bottom": "10px",
       "margin-top": "10px",
-      "margin-left": "15px",
-      "margin-right": "15px",
+      "margin-left": "7px",
+      "margin-right": "7px",
       "border" : "0px",
       "table-layout" : "fixed"
     },
@@ -485,7 +485,7 @@
   "select": {
     "styles": {
       "font-size": "15px",
-      "padding-right" : "2px",
+//      "padding-right" : "2px",
       "border-bottom": "0px solid #999",
       "border-top": "0px",
       "border-left": "0px",

+ 34 - 1
o2web/source/x_component_process_Xform/Attachment.js

@@ -1018,7 +1018,7 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
 MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
     Extends: MWF.APP$Module,
     options: {
-        "moduleEvents": ["upload", "delete", "afterDelete", "load", "change"]
+        "moduleEvents": ["upload", "delete", "afterDelete", "load", "change","download","open"]
     },
 
     initialize: function (node, json, form, options) {
@@ -1089,6 +1089,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
     },
 
     _loadEvents: function (editorConfig) {
+        debugger;
         Object.each(this.json.events, function (e, key) {
             if (e.code) {
                 if (this.options.moduleEvents.indexOf(key) !== -1) {
@@ -1409,9 +1410,34 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
         // }
         // this.fileReplaceNode.click();
     },
+    queryDownload : function( att ){
+        if( this.json.events && this.json.events.queryDownload && this.json.events.queryDownload.code ){
+            var flag = this.form.Macro.exec(this.json.events.queryDownload.code, att );
+            if( flag === false ){
+                return false
+            }else{
+                return true;
+            }
+        }else{
+            return true;
+        }
+    },
+    queryOpen : function( att ){
+        if( this.json.events && this.json.events.queryOpen && this.json.events.queryOpen.code ){
+            var flag = this.form.Macro.exec(this.json.events.queryOpen.code, att );
+            if( flag === false ){
+                return false
+            }else{
+                return true;
+            }
+        }else{
+            return true;
+        }
+    },
     downloadAttachment: function (e, node, attachments) {
         if (this.form.businessData.work && !this.form.businessData.work.completedTime) {
             attachments.each(function (att) {
+                if( !this.queryDownload( att ) )return;
                 if (window.o2android && window.o2android.downloadAttachment) {
                     window.o2android.downloadAttachment(att.data.id);
                 } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
@@ -1427,9 +1453,11 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
                         this.form.workAction.getAttachmentStream(att.data.id, this.form.businessData.work.id);
                     }
                 }
+                this.fireEvent("download",[att])
             }.bind(this));
         } else {
             attachments.each(function (att) {
+                if( !this.queryDownload( att ) )return;
                 if (window.o2android && window.o2android.downloadAttachment) {
                     window.o2android.downloadAttachment(att.data.id);
                 } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
@@ -1445,12 +1473,14 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
                         this.form.workAction.getWorkcompletedAttachmentStream(att.data.id, this.form.businessData.workCompleted.id);
                     }
                 }
+                this.fireEvent("download",[att])
             }.bind(this));
         }
     },
     openAttachment: function (e, node, attachments) {
         if (this.form.businessData.work && !this.form.businessData.work.completedTime) {
             attachments.each(function (att) {
+                if( !this.queryOpen( att ) )return;
                 if (window.o2android && window.o2android.downloadAttachment) {
                     window.o2android.downloadAttachment(att.data.id);
                 } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
@@ -1467,9 +1497,11 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
                     }
 
                 }
+                this.fireEvent("open",[att])
             }.bind(this));
         } else {
             attachments.each(function (att) {
+                if( !this.queryOpen( att ) )return;
                 if (window.o2android && window.o2android.downloadAttachment) {
                     window.o2android.downloadAttachment(att.data.id);
                 } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.downloadAttachment) {
@@ -1486,6 +1518,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class({
                         this.form.workAction.getWorkcompletedAttachmentData(att.data.id, ((this.form.businessData.workCompleted) ? this.form.businessData.workCompleted.id : this.form.businessData.work.id));
                     }
                 }
+                this.fireEvent("open",[att])
             }.bind(this));
         }
         //this.downloadAttachment(e, node, attachment);