Prechádzať zdrojové kódy

手机蓝白样式修改

unknown 5 rokov pred
rodič
commit
99d1f5f13e

+ 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);