Explorar o código

include 增加名称、别名、id的缓存,避免重新加载

unknown %!s(int64=5) %!d(string=hai) anos
pai
achega
42e731faf2

+ 13 - 1
o2web/source/o2_core/o2/xScript/CMSEnvironment.js

@@ -877,7 +877,19 @@ MWF.xScript.CMSEnvironment = function(ev){
 
                 //名称、别名、id
                 json.data.importedList.each( function ( flag ) {
-                    includedScripts.push( type + "-" + json.applicationName + "-" + flag );
+                    if( type === "portal" ){
+                        includedScripts.push( type + "-" + json.data.portal + "-" + flag );
+                        if( json.data.portalName )includedScripts.push( type + "-" + json.data.portalName + "-" + flag );
+                        if( json.data.portalAlias )includedScripts.push( type + "-" + json.data.portalAlias + "-" + flag );
+                    }else if( type === "cms" ){
+                        includedScripts.push( type + "-" + json.data.appId + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }else if( type === "process" ){
+                        includedScripts.push( type + "-" + json.data.application + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }
                 });
 
                 includedScripts = includedScripts.concat(json.data.importedList);

+ 13 - 1
o2web/source/o2_core/o2/xScript/Environment.js

@@ -929,7 +929,19 @@ debugger;
 
                 //名称、别名、id
                 json.data.importedList.each( function ( flag ) {
-                    includedScripts.push( type + "-" + json.applicationName + "-" + flag );
+                    if( type === "portal" ){
+                        includedScripts.push( type + "-" + json.data.portal + "-" + flag );
+                        if( json.data.portalName )includedScripts.push( type + "-" + json.data.portalName + "-" + flag );
+                        if( json.data.portalAlias )includedScripts.push( type + "-" + json.data.portalAlias + "-" + flag );
+                    }else if( type === "cms" ){
+                        includedScripts.push( type + "-" + json.data.appId + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }else if( type === "process" ){
+                        includedScripts.push( type + "-" + json.data.application + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }
                 });
                 includedScripts = includedScripts.concat(json.data.importedList);
 

+ 13 - 1
o2web/source/o2_core/o2/xScript/PageEnvironment.js

@@ -814,7 +814,19 @@ MWF.xScript.PageEnvironment = function (ev) {
 
                 //名称、别名、id
                 json.data.importedList.each( function ( flag ) {
-                    includedScripts.push( type + "-" + json.applicationName + "-" + flag );
+                    if( type === "portal" ){
+                        includedScripts.push( type + "-" + json.data.portal + "-" + flag );
+                        if( json.data.portalName )includedScripts.push( type + "-" + json.data.portalName + "-" + flag );
+                        if( json.data.portalAlias )includedScripts.push( type + "-" + json.data.portalAlias + "-" + flag );
+                    }else if( type === "cms" ){
+                        includedScripts.push( type + "-" + json.data.appId + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }else if( type === "process" ){
+                        includedScripts.push( type + "-" + json.data.application + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }
                 });
 
                 includedScripts = includedScripts.concat(json.data.importedList);

+ 13 - 1
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -730,7 +730,19 @@ MWF.xScript.ViewEnvironment = function (ev) {
 
                 //名称、别名、id
                 json.data.importedList.each( function ( flag ) {
-                    includedScripts.push( type + "-" + json.applicationName + "-" + flag );
+                    if( type === "portal" ){
+                        includedScripts.push( type + "-" + json.data.portal + "-" + flag );
+                        if( json.data.portalName )includedScripts.push( type + "-" + json.data.portalName + "-" + flag );
+                        if( json.data.portalAlias )includedScripts.push( type + "-" + json.data.portalAlias + "-" + flag );
+                    }else if( type === "cms" ){
+                        includedScripts.push( type + "-" + json.data.appId + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }else if( type === "process" ){
+                        includedScripts.push( type + "-" + json.data.application + "-" + flag );
+                        if( json.data.appName )includedScripts.push( type + "-" + json.data.appName + "-" + flag );
+                        if( json.data.appAlias )includedScripts.push( type + "-" + json.data.appAlias + "-" + flag );
+                    }
                 });
 
                 includedScripts = includedScripts.concat(json.data.importedList);