unknown 5 жил өмнө
parent
commit
85c32fdad0

+ 8 - 2
o2web/source/x_component_process_Xform/Form.js

@@ -1681,9 +1681,9 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
         if (!this.businessData.work.startTime) {
             this.startDraftProcess();
         } else if( this.json.submitFormType === "select" ){
-
+            this.processWork_custom();
         } else if( this.json.submitFormType === "script" ){
-
+            this.processWork_custom();
         } else {
             if (this.json.mode == "Mobile") {
                 setTimeout(function () {
@@ -1710,6 +1710,12 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
             return false;
         }
 
+        if (!MWF["APPSubmitform"]) {
+            MWF.xDesktop.requireApp("process.Xform", "Subform", null, false);
+        }
+        var submitFormContainer = new Element("div").inject( layout.mobile ? $(document.body) : this.app.content );
+        var module = new MWF["APPSubmitform"]( submitFormContainer , this.json, this);
+        module.load();
 
     },
     processWork_pc: function(){

+ 22 - 0
o2web/source/x_component_process_Xform/Subform.js

@@ -184,6 +184,24 @@ MWF.xApplication.process.Xform.Subform = MWF.APPSubform =  new Class({
 
 MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
     Extends: MWF.APPSubform,
+    _loadUserInterface: function(){
+        // this.node.empty();
+        this.getSubform(function(){
+            this.loadSubform();
+        }.bind(this));
+    },
+    reload: function(){
+        // this.node.empty();
+        this.getSubform(function(){
+            this.loadSubform();
+        }.bind(this));
+    },
+    fireSubFormEvent : function( name ){
+        var events = this.subformData.json.events;
+        if( events && events[name] && events[name]["code"] ){
+            this.form.Macro.exec(events[name]["code"], this);
+        }
+    },
     loadSubform: function(){
         if (this.subformData){
             if( !this.checkSubformUnique( this.subformData.json.id ) ){ //如果提交表单已经嵌入到表单中,那么把这个表单弹出来
@@ -194,6 +212,7 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
             }else{
                 //this.form.addEvent("postLoad", function(){
 
+                this.fireSubFormEvent("queryLoad");
                 this.loadCss();
 
                 this.node.set("html", this.subformData.html);
@@ -222,6 +241,9 @@ MWF.xApplication.process.Xform.SubmitForm = MWF.APPSubmitform = new Class({
                 }.bind(this));
 
                 this.form.subformLoaded.push( this.subformData.json.id );
+                this.fireSubFormEvent("postLoad");
+                this.fireSubFormEvent("load");
+                this.fireSubFormEvent("afterLoad");
             }
         }
         // if( this.form.subformLoadedCount ){