提交 52d21702 编写于 作者: 蔡祥熠

Merge branch 'feature/Query.statement_export_type' into 'wrdp'

Merge of feature/Query.statement_export_type 查询语句视图导出列增加数字类型,前台脚本this.include增加内容管理匿名访问的部分 to wrdp

See merge request o2oa/o2oa!6071
......@@ -1073,12 +1073,12 @@ MWF.xScript.CMSEnvironment = function(ev){
"lookupV1": function(view, callback){
getLookupAction(function(){
lookupAction.invoke({"name": "lookup","async": true, "parameter": {"view": view.view, "application": view.application},"success": function(json){
var data = {
"grid": json.data.grid,
"groupGrid": json.data.groupGrid
};
if (callback) callback(data);
}.bind(this)});
var data = {
"grid": json.data.grid,
"groupGrid": json.data.groupGrid
};
if (callback) callback(data);
}.bind(this)});
}.bind(this));
},
"select": function(view, callback, options){
......@@ -1459,7 +1459,7 @@ MWF.xScript.CMSEnvironment = function(ev){
// var includedScripts = window.includedScripts;
// }
var includedScripts = [];
this.include = function( optionsOrName , callback ){
var _includeSingle = function( optionsOrName , callback , async){
var options = optionsOrName;
if( typeOf( options ) == "string" ){
options = { name : options };
......@@ -1476,61 +1476,101 @@ MWF.xScript.CMSEnvironment = function(ev){
// if (callback) callback.apply(this);
// return;
//}
var scriptAction;
switch ( type ){
case "portal" :
if( this.scriptActionPortal ){
scriptAction = this.scriptActionPortal;
}else{
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
break;
case "process" :
if( this.scriptActionProcess ){
scriptAction = this.scriptActionProcess;
if( options.enableAnonymous && type === "cms" ){
o2.Actions.load("x_cms_assemble_control").ScriptAnonymousAction.getWithAppWithName( application, name, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
( json.data.importedList || [] ).each( function ( flag ) {
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 );
});
includedScripts = includedScripts.concat(json.data.importedList || []);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
if (callback) callback.apply(this);
}
break;
case "cms" :
if( this.scriptActionCMS ){
scriptAction = this.scriptActionCMS;
}.bind(this), null, false);
}else{
var scriptAction;
switch ( type ){
case "portal" :
if( this.scriptActionPortal ){
scriptAction = this.scriptActionPortal;
}else{
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
break;
case "process" :
if( this.scriptActionProcess ){
scriptAction = this.scriptActionProcess;
}else{
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms" :
if( this.scriptActionCMS ){
scriptAction = this.scriptActionCMS;
}else{
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
scriptAction.getScriptByName( application, name, includedScripts, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
json.data.importedList.each( function ( 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);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
if (callback) callback.apply(this);
}
break;
}.bind(this), null, !!async);
}
scriptAction.getScriptByName( application, name, includedScripts, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
json.data.importedList.each( function ( 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 );
}
});
};
this.include = function( optionsOrName , callback, async){
if (o2.typeOf(optionsOrName)=="array"){
if (!!async){
var count = optionsOrName.length;
var loaded = 0;
optionsOrName.each(function(option){
_includeSingle.apply(this, [option, function(){
loaded++;
if (loaded>=count) if (callback) callback.apply(this);
}.bind(this), true]);
}.bind(this));
includedScripts = includedScripts.concat(json.data.importedList);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
optionsOrName.each(function(option){
_includeSingle.apply(this, [option]);
}.bind(this));
if (callback) callback.apply(this);
}
}.bind(this), null, false);
}else{
_includeSingle.apply(this, [optionsOrName , callback, async])
}
};
//var includedScripts = [];
//this.include = function(name, callback){
......
......@@ -1968,63 +1968,82 @@ MWF.xScript.Environment = function(ev){
// if (callback) callback.apply(this);
// return;
//}
var scriptAction;
switch ( type ){
case "portal" :
if( this.scriptActionPortal ){
scriptAction = this.scriptActionPortal;
}else{
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
break;
case "process" :
if( this.scriptActionProcess ){
scriptAction = this.scriptActionProcess;
}else{
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms" :
if( this.scriptActionCMS ){
scriptAction = this.scriptActionCMS;
}else{
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
scriptAction.getScriptByName( application, name, includedScripts, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
json.data.importedList.each( function ( 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" ){
if( options.enableAnonymous && type === "cms" ){
o2.Actions.load("x_cms_assemble_control").ScriptAnonymousAction.getWithAppWithName( application, name, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
( json.data.importedList || [] ).each( function ( flag ) {
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 || []);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
if (callback) callback.apply(this);
}
}.bind(this), null, false);
}else {
var scriptAction;
switch (type) {
case "portal" :
if (this.scriptActionPortal) {
scriptAction = this.scriptActionPortal;
} else {
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
});
includedScripts = includedScripts.concat(json.data.importedList);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
if (callback) callback.apply(this);
break;
case "process" :
if (this.scriptActionProcess) {
scriptAction = this.scriptActionProcess;
} else {
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms" :
if (this.scriptActionCMS) {
scriptAction = this.scriptActionCMS;
} else {
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
}.bind(this), null, !!async);
}
scriptAction.getScriptByName(application, name, includedScripts, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
json.data.importedList.each(function (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);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
if (callback) callback.apply(this);
}
}.bind(this), null, !!async);
}
};
this.include = function( optionsOrName , callback, async){
if (o2.typeOf(optionsOrName)=="array"){
if (!!async){
......@@ -2033,7 +2052,7 @@ MWF.xScript.Environment = function(ev){
optionsOrName.each(function(option){
_includeSingle.apply(this, [option, function(){
loaded++;
if (loaded>=count) if (callback) callback.apply(this);;
if (loaded>=count) if (callback) callback.apply(this);
}.bind(this), true]);
}.bind(this));
......
......@@ -1461,62 +1461,81 @@ if (!MWF.xScript || !MWF.xScript.PageEnvironment) {
// if (callback) callback.apply(this);
// return;
//}
var scriptAction;
switch (type) {
case "portal" :
if (this.scriptActionPortal) {
scriptAction = this.scriptActionPortal;
} else {
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
break;
case "process" :
if (this.scriptActionProcess) {
scriptAction = this.scriptActionProcess;
} else {
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms" :
if (this.scriptActionCMS) {
scriptAction = this.scriptActionCMS;
} else {
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
scriptAction.getScriptByName(application, name, includedScripts, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
json.data.importedList.each(function (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") {
if (options.enableAnonymous && type === "cms") {
o2.Actions.load("x_cms_assemble_control").ScriptAnonymousAction.getWithAppWithName(application, name, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
(json.data.importedList || []).each(function (flag) {
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 || []);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
if (callback) callback.apply(this);
}
}.bind(this), null, false);
} else {
var scriptAction;
switch (type) {
case "portal" :
if (this.scriptActionPortal) {
scriptAction = this.scriptActionPortal;
} else {
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
});
includedScripts = includedScripts.concat(json.data.importedList);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
if (callback) callback.apply(this);
break;
case "process" :
if (this.scriptActionProcess) {
scriptAction = this.scriptActionProcess;
} else {
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms" :
if (this.scriptActionCMS) {
scriptAction = this.scriptActionCMS;
} else {
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
}.bind(this), null, !!async);
}
scriptAction.getScriptByName(application, name, includedScripts, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
json.data.importedList.each(function (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);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
if (callback) callback.apply(this);
}
}.bind(this), null, !!async);
}
};
this.include = function (optionsOrName, callback, async) {
if (o2.typeOf(optionsOrName) == "array") {
if (!!async) {
......@@ -1526,15 +1545,14 @@ if (!MWF.xScript || !MWF.xScript.PageEnvironment) {
_includeSingle.apply(this, [option, function () {
loaded++;
if (loaded >= count) if (callback) callback.apply(this);
;
}.bind(this), true]);
}.bind(this));
} else {
optionsOrName.each(function (option) {
_includeSingle.apply(this, [option]);
if (callback) callback.apply(this);
}.bind(this));
if (callback) callback.apply(this);
}
} else {
_includeSingle.apply(this, [optionsOrName, callback, async])
......
......@@ -3438,7 +3438,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
// var includedScripts = window.includedScripts;
// }
var includedScripts = [];
this.include = function (optionsOrName, callback) {
var _includeSingle = function (optionsOrName, callback, async) {
var options = optionsOrName;
if (typeOf(options) == "string") {
options = { name: options };
......@@ -3455,61 +3455,102 @@ MWF.xScript.ViewEnvironment = function (ev) {
// if (callback) callback.apply(this);
// return;
//}
var scriptAction;
switch (type) {
case "portal":
if (this.scriptActionPortal) {
scriptAction = this.scriptActionPortal;
} else {
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
break;
case "process":
if (this.scriptActionProcess) {
scriptAction = this.scriptActionProcess;
} else {
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms":
if (this.scriptActionCMS) {
scriptAction = this.scriptActionCMS;
} else {
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
scriptAction.getScriptByName(application, name, includedScripts, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
json.data.importedList.each( function ( 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" ){
if( options.enableAnonymous && type === "cms" ){
o2.Actions.load("x_cms_assemble_control").ScriptAnonymousAction.getWithAppWithName( application, name, function(json){
if (json.data){
includedScripts.push( key );
//名称、别名、id
( json.data.importedList || [] ).each( function ( flag ) {
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 || []);
MWF.CMSMacro.exec(json.data.text, this);
if (callback) callback.apply(this);
}else{
if (callback) callback.apply(this);
}
}.bind(this), null, false);
}else {
var scriptAction;
switch (type) {
case "portal":
if (this.scriptActionPortal) {
scriptAction = this.scriptActionPortal;
} else {
MWF.require("MWF.xScript.Actions.PortalScriptActions", null, false);
scriptAction = this.scriptActionPortal = new MWF.xScript.Actions.PortalScriptActions();
}
});
break;
case "process":
if (this.scriptActionProcess) {
scriptAction = this.scriptActionProcess;
} else {
MWF.require("MWF.xScript.Actions.ScriptActions", null, false);
scriptAction = this.scriptActionProcess = new MWF.xScript.Actions.ScriptActions();
}
break;
case "cms":
if (this.scriptActionCMS) {
scriptAction = this.scriptActionCMS;
} else {
MWF.require("MWF.xScript.Actions.CMSScriptActions", null, false);
scriptAction = this.scriptActionCMS = new MWF.xScript.Actions.CMSScriptActions();
}
break;
}
scriptAction.getScriptByName(application, name, includedScripts, function (json) {
if (json.data) {
includedScripts.push(key);
//名称、别名、id
json.data.importedList.each( function ( 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);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
includedScripts = includedScripts.concat(json.data.importedList);
MWF.Macro.exec(json.data.text, this);
if (callback) callback.apply(this);
} else {
if (callback) callback.apply(this);
}
}.bind(this), null, !!async);
}
};
this.include = function( optionsOrName , callback, async){
if (o2.typeOf(optionsOrName)=="array"){
if (!!async){
var count = optionsOrName.length;
var loaded = 0;
optionsOrName.each(function(option){
_includeSingle.apply(this, [option, function(){
loaded++;
if (loaded>=count) if (callback) callback.apply(this);
}.bind(this), true]);
}.bind(this));
}else{
optionsOrName.each(function(option){
_includeSingle.apply(this, [option]);
}.bind(this));
if (callback) callback.apply(this);
}
}.bind(this), null, false);
}else{
_includeSingle.apply(this, [optionsOrName , callback, async])
}
};
this.define = function (name, fun, overwrite) {
......@@ -3866,7 +3907,7 @@ MWF.xScript.ViewEnvironment = function (ev) {
* <div>格式如下:</div>
* <pre><code class='language-js'>
* [
{
{
"bundle": "099ed3c9-dfbc-4094-a8b7-5bfd6c5f7070", //cms 的 documentId, process 的 jobId
"data": { //视图中配置的数据
"title": "考勤管理-配置-统计周期设置", //列名称及列值
......@@ -5386,20 +5427,20 @@ if( !MWF.xScript.createDict ){
this.get = function(path, success, failure, async, refresh){
var value = null;
if (success===true) async=true;
if (failure===true) async=true;
if (!refresh ){
var data = MWF.xScript.getDictFromCache( key, path );
if( data ){
if (success && o2.typeOf(success)=="function") success( data );
if( !!async ){
return Promise.resolve( data );
}else{
return data;
if (success===true) async=true;
if (failure===true) async=true;
if (!refresh ){
var data = MWF.xScript.getDictFromCache( key, path );
if( data ){
if (success && o2.typeOf(success)=="function") success( data );
if( !!async ){
return Promise.resolve( data );
}else{
return data;
}
}
}
}
// var cb = function(json){
// value = json.data;
......
......@@ -69,7 +69,7 @@ MWF.xApplication.process.TaskCenter.LP = {
"unit": "组织",
"duty": "职务",
"searchProcess": "输入关键字,搜可启动流程",
"searchProcess": "输入关键字,搜可启动流程",
"searchProcessResault": "”{key}“ 的搜索结果",
"datch": "批量处理",
......
......@@ -543,6 +543,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
var titleArray = [];
var colWidthArr = [];
var dateIndexArray = [];
var numberIndexArray = [];
var idx = 0;
Object.each(this.entries, function (c, k) {
if (this.hideColumns.indexOf(k) === -1) {
......@@ -550,6 +551,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
colWidthArr.push(c.exportWidth || 200);
if( c.isTime )dateIndexArray.push(idx);
if( c.isNumber )numberIndexArray.push(idx);
idx++;
}
}.bind(this));
......@@ -564,6 +566,9 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
Object.each(this.entries, function (c, k) {
if (this.hideColumns.indexOf(k) === -1) {
var text = this.getExportText(c, k, d);
// if( c.isNumber && typeOf(text) === "string" && (parseFloat(text).toString() !== "NaN") ){
// text = parseFloat(text);
// }
dataArray.push( text );
}
}.bind(this));
......@@ -590,7 +595,8 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
arg.data || exportArray,
arg.title || excelName,
arg.colWidthArray || colWidthArr,
dateIndexArray //日期格式列下标
dateIndexArray, //日期格式列下标
numberIndexArray //数字格式列下标
);
}.bind(this));
......@@ -1090,7 +1096,7 @@ MWF.xApplication.query.Query.Statement.ExcelUtils = new Class({
var fileNode = uploadFileAreaNode.getFirst();
fileNode.click();
},
exportToExcel : function(array, fileName, colWidthArr, dateIndexArray){
exportToExcel : function(array, fileName, colWidthArr, dateIndexArray, numberIndexArray){
// var array = [["姓名","性别","学历","专业","出生日期","毕业日期"]];
// array.push([ "张三","男","大学本科","计算机","2001-1-2","2019-9-2" ]);
// array.push([ "李四","男","大学专科","数学","1998-1-2","2018-9-2" ]);
......@@ -1133,6 +1139,14 @@ MWF.xApplication.query.Query.Statement.ExcelUtils = new Class({
}.bind(this))
}
if( numberIndexArray && numberIndexArray.length ){
numberIndexArray.each( function( value, index ){
numberIndexArray[ index ] = this.index2ColName(value);
}.bind(this))
}
var typeFlag = ( dateIndexArray && dateIndexArray.length ) || ( numberIndexArray && numberIndexArray.length );
for( var key in dataInfo ){
//设置所有样式,wrapText=true 后 /n会被换行
if( key.substr(0, 1) !== "!" ){
......@@ -1141,13 +1155,22 @@ MWF.xApplication.query.Query.Statement.ExcelUtils = new Class({
if( !di.s.alignment )di.s.alignment = {};
di.s.alignment.wrapText = true;
if( dateIndexArray && dateIndexArray.length ){
if( typeFlag ){
var colName = key.replace(/\d+/g,''); //清除数字
var rowNum = key.replace( colName, '');
if( rowNum > 1 && dateIndexArray.contains( colName ) ){
//di.s.numFmt = "yyyy-mm-dd HH:MM:SS"; //日期列 两种方式都可以
di.z = 'yyyy-mm-dd HH:MM:SS'; //日期列
if( rowNum > 1 ){
if( dateIndexArray && dateIndexArray.length && dateIndexArray.contains( colName ) ){
//di.s.numFmt = "yyyy-mm-dd HH:MM:SS"; //日期列 两种方式都可以
di.z = 'yyyy-mm-dd HH:MM:SS'; //日期列
}
if( numberIndexArray && numberIndexArray.length && numberIndexArray.contains( colName ) ){
di.s.alignment.wrapText = false;
di.t = 'n'; //数字类型
}
}
}
}
......
......@@ -105,10 +105,21 @@
<tr>
<td class="editTableTitle">{{$.lp.isTime}}:</td>
<td class="editTableValue">
<input class="MWFWorkDataCheck" name="isTime" type="radio" value="true" text{($.isTime)===true?'checked':''}/>{{$.lp.yes}}
<input class="MWFWorkDataCheck" name="isTime" type="radio" value="true" onclick="if(this.checked){
$$('[name=text{$.mid}isNumber]').each(function( el ){ if(el.get('value') === 'false' ){ el.set('checked', true); el.fireEvent('change') }})
}" text{($.isTime)===true?'checked':''}/>{{$.lp.yes}}
<input class="MWFWorkDataCheck" name="isTime" type="radio" value="false" text{($.isTime)!==true?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.isNumber}}:</td>
<td class="editTableValue">
<input class="MWFWorkDataCheck" name="isNumber" type="radio" value="true" onclick="if(this.checked){
$$('[name=text{$.mid}isTime]').each(function( el ){ if(el.get('value') === 'false' ){el.set('checked', true); el.fireEvent('change') }})
}" text{($.isNumber)===true?'checked':''}/>{{$.lp.yes}}
<input class="MWFWorkDataCheck" name="isNumber" type="radio" value="false" text{($.isNumber)!==true?'checked':''}/>{{$.lp.no}}
</td>
</tr>
</table>
</div>
</div>
......
......@@ -79,7 +79,7 @@ MWF.xApplication.query.StatementDesigner.LP = Object.merge( MWF.xApplication.que
"export": "Export",
"exportWidth": "Width",
"isTime": "Time Type"
"isTime": "Time Type",
"isNumber": "Number Type"
}
});
\ No newline at end of file
......@@ -94,7 +94,8 @@ MWF.xApplication.query.StatementDesigner.LP = Object.merge( MWF.xApplication.que
"export": "导出",
"exportWidth": "宽度",
"isTime": "时间类型"
"isTime": "时间类型",
"isNumber": "数字类型"
}
});
\ No newline at end of file
......@@ -18,6 +18,10 @@ MWF.xApplication.query.ViewDesigner.Property = MWF.FVProperty = new Class({
this.data.pid = this.view.json.id + this.data.id;
this.htmlPath = this.options.path;
if (this.module) {
this.data.mid = this.module.json.id;
}
this.maplists = {};
this.designer = designer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册