Bladeren bron

表单性能优化

huqi 5 jaren geleden
bovenliggende
commit
e4eff09afd

+ 4 - 0
gulpfile.js

@@ -516,6 +516,9 @@ function build_concat_basework() {
         'o2web/source/x_component_Selector/Person.js',
         'o2web/source/x_component_Selector/Identity.js',
         'o2web/source/x_component_Selector/Unit.js',
+        'o2web/source/x_component_Selector/IdentityWidthDuty.js',
+        'o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js',
+        'o2web/source/x_component_Selector/UnitWithType.js',
         'o2web/source/o2_core/o2/xScript/Actions/UnitActions.js',
         'o2web/source/o2_core/o2/xScript/Actions/ScriptActions.js',
         'o2web/source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
@@ -528,6 +531,7 @@ function build_concat_basework() {
         'o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
         'o2web/source/o2_core/o2/xAction/services/x_organization_assemble_control.js',
         'o2web/source/o2_core/o2/xAction/services/x_query_assemble_surface.js',
+        'o2web/source/o2_core/o2/xAction/services/x_organization_assemble_personal.js',
         'o2web/source/x_desktop/js/base_work_end.js',
         'o2web/source/x_desktop/js/base.js'
     ];

+ 4 - 0
o2web/gulpfile.js

@@ -379,6 +379,9 @@ function createBaseWorkConcatTask(path, isMin, thisOptions) {
             'source/x_component_Selector/Person.js',
             'source/x_component_Selector/Identity.js',
             'source/x_component_Selector/Unit.js',
+            'source/x_component_Selector/IdentityWidthDuty.js',
+            'source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js',
+            'source/x_component_Selector/UnitWithType.js',
             'source/o2_core/o2/xScript/Actions/UnitActions.js',
             'source/o2_core/o2/xScript/Actions/ScriptActions.js',
             'source/o2_core/o2/xScript/Actions/CMSScriptActions.js',
@@ -391,6 +394,7 @@ function createBaseWorkConcatTask(path, isMin, thisOptions) {
             'source/o2_core/o2/xAction/services/x_cms_assemble_control.js',
             'source/o2_core/o2/xAction/services/x_organization_assemble_control.js',
             'source/o2_core/o2/xAction/services/x_query_assemble_surface.js',
+            'source/o2_core/o2/xAction/services/x_organization_assemble_personal.js',
             'source/' + path + '/js/base_work_end.js',
             'source/' + path + '/js/base.js'
         ];

+ 71 - 17
o2web/source/o2_core/o2/xDesktop/UserData.js

@@ -4,47 +4,73 @@ MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
 
 MWF.xDesktop.UserData = MWF.UD = {
     getAction: function(){
-        this.action = new MWF.xDesktop.Actions.RestActions("/xDesktop/Actions/action.json", "x_organization_assemble_personal");
+        //this.action = new MWF.xDesktop.Actions.RestActions("/xDesktop/Actions/action.json", "x_organization_assemble_personal");
+        this.action = o2.Actions.get("x_organization_assemble_personal");
     },
     getData: function(name, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "getUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        this.action.getUserData(name, function(json){
             if (callback) callback(json);
-        }.bind(this)});
+        }, null, async)
+
+        // this.action.invoke({"name": "getUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        //     if (callback) callback(json);
+        // }.bind(this)});
     },
     getDataJson: function(name, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "getUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        this.action.getUserData(name, function(json){
             var returnJson = null;
             if (json.data) returnJson = JSON.decode(json.data);
             if (callback) callback(returnJson);
-        }.bind(this)});
+        }, null, async)
+
+        // this.action.invoke({"name": "getUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        //     var returnJson = null;
+        //     if (json.data) returnJson = JSON.decode(json.data);
+        //     if (callback) callback(returnJson);
+        // }.bind(this)});
     },
 
     putData: function(name, data, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "putUserData", "async": async, "data": data, "parameter": {"name": name}, "success": function(json){
+        this.action.putUserData(name, data, function(json){
             if (callback) callback(json);
-        }.bind(this)});
+        }, null, async)
+
+        // this.action.invoke({"name": "putUserData", "async": async, "data": data, "parameter": {"name": name}, "success": function(json){
+        //     if (callback) callback(json);
+        // }.bind(this)});
     },
     deleteData: function(name, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "deleteUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        this.action.deleteUserData(name, function(json){
             if (callback) callback(json);
-        }.bind(this)});
+        }, null, async)
+
+        // this.action.invoke({"name": "deleteUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        //     if (callback) callback(json);
+        // }.bind(this)});
     },
 
     getPublicData: function(name, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "getPublicUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        this.action.getPublicUserData(name, function(json){
             var returnJson = null;
             if (json.data) returnJson = JSON.decode(json.data);
             if (callback) callback(returnJson);
-        }.bind(this)});
+        }, null, async)
+
+        // this.action.invoke({"name": "getPublicUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        //     var returnJson = null;
+        //     if (json.data) returnJson = JSON.decode(json.data);
+        //     if (callback) callback(returnJson);
+        // }.bind(this)});
     },
     putPublicData: function(name, data, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "putPublicUserData", "async": async, "data": data, "parameter": {"name": name}, "success": function(json){
+
+        this.action.putPublicUserData(name, data, function(json){
             if (callback){
                 if (callback.success){
                     callback.success(json);
@@ -52,7 +78,7 @@ MWF.xDesktop.UserData = MWF.UD = {
                     callback(json);
                 }
             }
-        }.bind(this), "failure": function(xhr, text, error){
+        }, function(xhr, text, error){
             if (xhr.status!=0){
                 var errorText = error;
                 if (xhr){
@@ -66,12 +92,40 @@ MWF.xDesktop.UserData = MWF.UD = {
                 MWF.xDesktop.notice("error", {x: "right", y:"top"}, errorText);
             }
             if (callback) if (callback.failure) callback.failure(xhr, text, error);
-        }});
+        }, async);
+
+        // this.action.invoke({"name": "putPublicUserData", "async": async, "data": data, "parameter": {"name": name}, "success": function(json){
+        //     if (callback){
+        //         if (callback.success){
+        //             callback.success(json);
+        //         }else{
+        //             callback(json);
+        //         }
+        //     }
+        // }.bind(this), "failure": function(xhr, text, error){
+        //     if (xhr.status!=0){
+        //         var errorText = error;
+        //         if (xhr){
+        //             var json = JSON.decode(xhr.responseText);
+        //             if (json){
+        //                 errorText = json.message.trim() || "request json error";
+        //             }else{
+        //                 errorText = "request json error: "+xhr.responseText;
+        //             }
+        //         }
+        //         MWF.xDesktop.notice("error", {x: "right", y:"top"}, errorText);
+        //     }
+        //     if (callback) if (callback.failure) callback.failure(xhr, text, error);
+        // }});
     },
     deletePublicData: function(name, callback, async){
         if (!this.action) this.getAction();
-        this.action.invoke({"name": "deletePublicUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        this.action.deletePublicUserData(name, function(json){
             if (callback) callback(json);
-        }.bind(this)});
+        }, null, async);
+
+        // this.action.invoke({"name": "deletePublicUserData", "async": async, "parameter": {"name": name}, "success": function(json){
+        //     if (callback) callback(json);
+        // }.bind(this)});
     }
-};
+};

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

@@ -103,7 +103,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
         var control = this.getShowControl();
         this.json.fileup =  !!(control.signer);
 
-        if (this.json.css && this.json.css.code){
+        if (this.json.css && this.json.css.code && !this.styleNode){
             var cssText = this.form.parseCSS(this.json.css.code);
             cssText = cssText.replace(/documenteditor_table/g, 'documenteditor_table'+this.form.json.id+this.json.id)
 
@@ -134,7 +134,8 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
             var styleNode = document.createElement("style");
             styleNode.setAttribute("type", "text/css");
             styleNode.id="style"+this.json.id;
-            styleNode.inject(pageContentNode);
+            //styleNode.inject(pageContentNode);
+            styleNode.inject(this.node, "top");
 
             if(styleNode.styleSheet){
                 var setFunc = function(){
@@ -149,6 +150,7 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
                 var cssTextNode = document.createTextNode(cssText);
                 styleNode.appendChild(cssTextNode);
             }
+            this.styleNode = styleNode;
         }
 
         if (this.json.documentTempleteType=="cus"){
@@ -1522,7 +1524,9 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor =  new Cla
             if (this.options.pageShow!=="double"){
                 this._doublePage();
             }else{
-                this._singlePage();
+                this.options.pageShow="single";
+                this.reload();
+                //this._singlePage();
             }
         }.bind(this));
         if (layout.mobile) this.doublePageAction.hide();

File diff suppressed because it is too large
+ 0 - 0
o2web/source/x_desktop/js/base_work_begin.js


+ 2 - 0
o2web/source/x_desktop/js/base_work_end.js

@@ -12,5 +12,7 @@ o2.Actions.actions["x_query_assemble_surface"] = new o2.xAction.RestActions.Acti
 o2.xAction.RestActions.Action["x_program_center"] = new Class({Extends: o2.xAction.RestActions.Action});
 o2.Actions.actions["x_program_center"] = new o2.xAction.RestActions.Action["x_program_center"]("x_program_center", centerActins);
 
+o2.Actions.actions["x_organization_assemble_personal"] = new o2.xAction.RestActions.Action["x_organization_assemble_personal"]("x_organization_assemble_personal", personalActions);
+
 
 //});

Some files were not shown because too many files changed in this diff