Kaynağa Gözat

修复手机端草稿模式bug
修复脚本编辑器自动完成显示
修复

huqi 5 yıl önce
ebeveyn
işleme
01d9481e09

+ 4 - 0
o2web/source/o2_core/o2/widget/JavascriptEditor.js

@@ -251,6 +251,7 @@ o2.widget.JavascriptEditor = new Class({
         var macro = o2.widget.JavascriptEditor.runtimeEnvironment[runtime];
         var o = null;
         if (macro){
+            prefix = ["(", "{", ""];
             code = "try {return "+textPrefix+";}catch(e){return null;}";
             o = macro.exec(code);
         }
@@ -261,8 +262,11 @@ o2.widget.JavascriptEditor = new Class({
             monaco.languages.registerCompletionItemProvider('javascript', {
                 "triggerCharacters": ["."],
                 provideCompletionItems: function (model, position, context, token) {
+                    debugger;
                     var textUntilPosition = model.getValueInRange({ startLineNumber: position.lineNumber, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column });
                     var textPrefix = textUntilPosition.substr(0, textUntilPosition.lastIndexOf("."));
+
+
                     var o = this.getCompletionObject(textPrefix, model.o2Editor.options.runtime);
 
                     var word = model.getWordUntilPosition(position);

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

@@ -164,7 +164,7 @@ MWF.xApplication.process.Work.Main = new Class({
                             layout.sessionPromise.then(function(){
                                 this.openWork();
                                 this.unLoading();
-                            }.bind(this));
+                            }.bind(this), function(){});
                         }
                     }
                 } else{
@@ -376,8 +376,19 @@ 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]);
@@ -672,9 +683,9 @@ MWF.xApplication.process.Work.Main = new Class({
             this.formNode.setStyles(this.css.formNode);
             var uri = window.location.href;
             //var cl = (uri.indexOf("$all")!=-1) ? "$all" : "Form";
-           // var cl = "$all";
+            var cl = "$all";
            // MWF.xDesktop.requireApp("process.Xform", cl, function(){
-            //MWF.xDesktop.requireApp("process.Xform", "Form", function(){
+            MWF.xDesktop.requireApp("process.Xform", "Form", function(){
                 this.appForm = new MWF.APPForm(this.formNode, this.form, {});
                 this.appForm.businessData = {
                     "data": this.data,
@@ -722,7 +733,7 @@ MWF.xApplication.process.Work.Main = new Class({
                     }
                     this.fireEvent("postLoadForm");
                 }.bind(this));
-            //}.bind(this));
+            }.bind(this));
         }
     },
 

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

@@ -129,11 +129,30 @@ 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);
+
+        // 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);
+        // }else if(options.draft){
+        //     var par = "draft="+encodeURIComponent(JSON.stringify(options.draft));
+        //     docurl = "../x_desktop/workmobilewithaction.html?" + par;
+        // }
+
+        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);