Przeglądaj źródła

修复手机端草稿模式bug

huqi 5 lat temu
rodzic
commit
a373857b7a

+ 15 - 3
o2web/source/x_component_process_Work/Main.js

@@ -388,9 +388,21 @@ MWF.xApplication.process.Work.Main = new Class({
 
                 this.parseData(workData, control, json_form.data, [], [], []);
                 if (this.mask) this.mask.hide();
-                //if (layout.mobile) this.loadMobileActions();
-                this.openWork();
-                this.unLoading();
+
+                if (layout.session && layout.session.user){
+                    this.openWork();
+                    this.unLoading();
+                }else{
+                    if (layout.sessionPromise){
+                        layout.sessionPromise.then(function(){
+                            this.openWork();
+                            this.unLoading();
+                        }.bind(this), function(){});
+                    }
+                }
+
+                // this.openWork();
+                // this.unLoading();
 
             }
         }.bind(this), "failure": function(){}}, [work.form, work.application]);

+ 24 - 4
o2web/source/x_desktop/js/base.js

@@ -122,6 +122,18 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
         return false;
     };
     var _openWorkHTML = function (options) {
+        // var uri = new URI(window.location.href);
+        // var redirectlink = uri.getData("redirectlink");
+        // if (!redirectlink) {
+        //     redirectlink = encodeURIComponent(locate.pathname + locate.search);
+        // } else {
+        //     redirectlink = encodeURIComponent(redirectlink);
+        // }
+        // if (options.workId) {
+        //     window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
+        // } else if (options.workCompletedId) {
+        //     window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
+        // }
         var uri = new URI(window.location.href);
         var redirectlink = uri.getData("redirectlink");
         if (!redirectlink) {
@@ -129,11 +141,19 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) {
         } else {
             redirectlink = encodeURIComponent(redirectlink);
         }
-        if (options.workId) {
-            window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
-        } else if (options.workCompletedId) {
-            window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink);
+        var docurl = "../x_desktop/workmobilewithaction.html".toURI();
+        if (options.draft){
+            var par = "draft="+encodeURIComponent(JSON.stringify(options.draft));
+            docurl = "../x_desktop/workmobilewithaction.html?" + par;
+        }else{
+            docurl = docurl.setData(options).toString();
         }
+        var job = (options.jobid || options.jobId || options.job);
+        if (job) docurl += ((docurl.indexOf("?")!=-1) ? "&" : "?") + "jobid="+job;
+        docurl += ((redirectlink) ? "&redirectlink=" + redirectlink : "");
+        docurl +=((layout.debugger) ? "&debugger" : "");
+
+        window.location = o2.filterUrl(docurl);
     };
     var _openWork = function (options) {
         if (!_openWorkAndroid(options)) if (!_openWorkIOS(options)) _openWorkHTML(options);