|
@@ -166,14 +166,14 @@ JpcExSrv.prototype.createNew = function() {
|
|
|
me.events = JpcEvent.createNew(rptTpl);
|
|
|
};
|
|
|
|
|
|
- JpcResult.analyzeData = function(rptTpl, dataObj, defProperties, option, outputType) {
|
|
|
+ JpcResult.analyzeData = function($CTX_HELPER, rptTpl, dataObj, defProperties, option, outputType) {
|
|
|
const me = this;
|
|
|
const dftPagingOption = option || JV.PAGING_OPTION_NORMAL;
|
|
|
// 1. data object
|
|
|
let dataHelper = JpcData.createNew();
|
|
|
- me.executeFormulas(JV.RUN_TYPE_BEFORE_ANALYZING, rptTpl, dataObj, me); // 在分析前运行,主要是增加灵活性,比如:重新编排数据的主从关系
|
|
|
+ me.executeFormulas($CTX_HELPER, JV.RUN_TYPE_BEFORE_ANALYZING, rptTpl, dataObj, me); // 在分析前运行,主要是增加灵活性,比如:重新编排数据的主从关系
|
|
|
if (me.crossTab) {
|
|
|
- me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
|
|
|
+ me.executeFormulas($CTX_HELPER, JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
|
|
|
dataHelper.analyzeData(rptTpl, dataObj);
|
|
|
me.crossTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
|
|
|
} else {
|
|
@@ -193,7 +193,7 @@ JpcExSrv.prototype.createNew = function() {
|
|
|
// let dt2 = new Date();
|
|
|
// alert(dt2 - dt1);
|
|
|
// 3. formulas
|
|
|
- me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
|
|
|
+ me.executeFormulas($CTX_HELPER, JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
|
|
|
}
|
|
|
// 4. paging
|
|
|
me.paging(rptTpl, dataObj, defProperties, dftPagingOption, outputType);
|
|
@@ -222,7 +222,7 @@ JpcExSrv.prototype.createNew = function() {
|
|
|
me.totalPages = me.billTab.paging(rptTpl, dataObj);
|
|
|
}
|
|
|
};
|
|
|
- JpcResult.executeFormulas = function(runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT) {
|
|
|
+ JpcResult.executeFormulas = function($CTX_HELPER, runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT) {
|
|
|
const execFmlMe = this;
|
|
|
for (let execFmlIdx = 0; execFmlIdx < execFmlMe.formulas.length; execFmlIdx++) {
|
|
|
// remark: 搞这么复杂的变量名是为了防止与表达式起冲突(如循环变量i,j,k,容易造成变量冲突且不容易看出问题)
|
|
@@ -301,7 +301,7 @@ JpcExSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcResult.outputAsSimpleJSONPageArray = function(rptTpl, dataObj, startPage, endPage, defProperties, customizeCfg) {
|
|
|
+ JpcResult.outputAsSimpleJSONPageArray = function($CTX_HELPER, rptTpl, dataObj, startPage, endPage, defProperties, customizeCfg) {
|
|
|
const me = this;
|
|
|
const rst = {};
|
|
|
if ((startPage > 0) && (startPage <= endPage) && (endPage <= me.totalPages)) {
|