Просмотр исходного кода

草稿模式下,保存、继续流转优化

huqi 5 лет назад
Родитель
Сommit
bdb518fb78

+ 6 - 0
o2web/source/x_component_process_Work/Main.js

@@ -606,6 +606,12 @@ MWF.xApplication.process.Work.Main = new Class({
                         layout.appForm = this.appForm;
                         window.webkit.messageHandlers.appFormLoaded.postMessage(JSON.stringify(this.appForm.mobileTools));
                     }
+debugger;
+
+                    if (this.options.action=="processTask"){
+                        this.appForm.processWork();
+                        this.options.action = "";
+                    }
 
                     this.fireEvent("postLoadForm");
 

+ 3 - 3
o2web/source/x_component_process_Xform/Documenteditor.js

@@ -1519,7 +1519,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
             }
         }
 
-        if (this.json.canDoublePage!=="n" && !layout.mobile){
+        //if (this.json.canDoublePage!=="n" && !layout.mobile){
             this.doublePageAction = new Element("div", {"styles": this.css.doc_toolbar_doublePage, "text": MWF.xApplication.process.Xform.LP.doublePage}).inject(this.toolbarNode);
             this.doublePageAction.addEvent("click", function(){
                 if (this.options.pageShow!=="double"){
@@ -1530,8 +1530,8 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
                     //this._singlePage();
                 }
             }.bind(this));
-            //if (layout.mobile) this.doublePageAction.hide();
-        }
+            if (this.json.canDoublePage!=="n" && !layout.mobile) this.doublePageAction.hide();
+        //}
 
 
 

+ 4 - 1
o2web/source/x_component_process_Xform/Form.js

@@ -1291,6 +1291,8 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                     layout.desktop.apps[this.app.appId] = this.app;
 
                     if (callback) callback();
+
+                    if (!isstart) this.app.reload();
                 }
 
             }.bind(this));
@@ -1865,8 +1867,9 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({
                 }
                 if (layout.app && layout.app.inBrowser){
                     if (layout.app) layout.app.$openWithSelf = true;
-                    layout.desktop.openApplication(null, "process.Work", {"workId": this.app.options.workId});
+                    layout.desktop.openApplication(null, "process.Work", {"workId": this.app.options.workId, "action": "processTask"});
                 }
+                this.app.options.action = "processTask";
                 this.app.reload();
 
                 //this.app.notice(MWF.xApplication.process.Xform.LP.dataSaved, "success");

+ 16 - 10
o2web/source/x_desktop/js/base.js

@@ -225,18 +225,24 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
         var par = "app=" + encodeURIComponent(appNames) + "&status=" + encodeURIComponent((statusObj) ? JSON.encode(statusObj) : "") + "&option=" + encodeURIComponent((options) ? JSON.encode(options) : "");
         switch (appNames) {
             case "process.Work":
-                var url = "../x_desktop/work.html";
-                if (options.workId) {
-                    url += "?workid=" + options.workId;
-                    //window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
-                } else if (options.workCompletedId) {
-                    url += "?workcompletedid=" + options.workCompletedId;
-                    //window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
-                } else if (options.draftId){
-                    url += "?draftId=" + options.draftId;
-                } else if (options.draft) {
+                var url = "../x_desktop/work.html".toURI();
+                if (options.draft){
                     url = "../x_desktop/app.html?" + par;
+                }else{
+                    url = url.setData(options).toString();
                 }
+
+                // if (options.workId) {
+                //     url += "?workid=" + options.workId+"&"+par;
+                //     //window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
+                // } else if (options.workCompletedId) {
+                //     url += "?workcompletedid=" + options.workCompletedId+"&"+par;;
+                //     //window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
+                // } else if (options.draftId){
+                //     url += "?draftId=" + options.draftId+"&"+par;;
+                // } else if (options.draft) {
+                //     url = "../x_desktop/app.html?" + par;
+                // }
                 var job = (options.jobid || options.jobId || options.job);
                 if (job) url += ((url.indexOf("?")!=-1) ? "&" : "?") + "jobid="+job;
                 url +=((layout.debugger) ? "&debugger" : "");