|
@@ -1139,7 +1139,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
me.pageSumValLst.push(rowGrandTotal);
|
|
|
// grouping content
|
|
|
- let grpVal_Idx = 0;
|
|
|
+ let grpCntIdx = 0;
|
|
|
for (let rowIdx = 0; rowIdx < contentValuesIdx.length; rowIdx++) {
|
|
|
if (contentValuesIdx[rowIdx][1] === JV.DISPLAY_VAL_TYPE_GROUP) {
|
|
|
for (let grpIdx = 0; grpIdx < rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES].length; grpIdx++) {
|
|
@@ -1155,11 +1155,11 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- const lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx, grpVal_Idx, $CURRENT_RPT);
|
|
|
- grpVal_Idx++;
|
|
|
+ const lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx, grpCntIdx, $CURRENT_RPT, dataObj);
|
|
|
rst = rst.concat(lineRst);
|
|
|
}
|
|
|
}
|
|
|
+ grpCntIdx++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1324,7 +1324,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcFlowTabResult.outputTabGrpLine = function(band, grp_line, page, grpValueIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls, multiColIdx, grpVal_Idx, $CURRENT_RPT) {
|
|
|
+ JpcFlowTabResult.outputTabGrpLine = function(band, grp_line, page, grpValueIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls, multiColIdx, grpCntIdx, $CURRENT_RPT, $CURRENT_DATA) {
|
|
|
const me = this;
|
|
|
const rst = [];
|
|
|
if (grp_line[JV.PROP_GROUP_SUM_KEYS]) {
|
|
@@ -1338,13 +1338,11 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
}
|
|
|
if (grp_line[JV.PROP_TEXTS]) {
|
|
|
- for (let grpIdx = 0; grpIdx < grp_line[JV.PROP_TEXTS].length; grpIdx++) {
|
|
|
- const txt = grp_line[JV.PROP_TEXTS][grpIdx];
|
|
|
- const rstCell = JpcTextHelper.outputText(txt, band, unitFactor, rows, rowIdx, cols, colIdx, me.multiCols, multiColIdx);
|
|
|
- if ($CURRENT_RPT.events[JV.EVENT_TYPE[JV.EVENT_IDX_GRP_ON_CREATE]]) {
|
|
|
- me.eventGrpOnCreate(rstCell, JV.EVENT_TYPE[JV.EVENT_IDX_GRP_ON_CREATE], grpIdx, grpVal_Idx, $CURRENT_RPT);
|
|
|
- }
|
|
|
- rst.push(rstCell);
|
|
|
+ for (const txt of grp_line[JV.PROP_TEXTS]) {
|
|
|
+ me.checkGrpTxtOutEvent(JV.RUN_TYPE_BEFORE_GROUP_TEXT_OUT, txt, grpCntIdx, $CURRENT_RPT, $CURRENT_DATA);
|
|
|
+ rst.push(JpcTextHelper.outputText(txt, band, unitFactor, rows, rowIdx, cols, colIdx, me.multiCols, multiColIdx));
|
|
|
+ // me.combinePageCells(rst, verticalCombinePos, horizonCombinePos);
|
|
|
+ // 可能会有一个After,但意义不大,用不着
|
|
|
}
|
|
|
}
|
|
|
if (grp_line[JV.PROP_DISCRETE_FIELDS]) {
|
|
@@ -1356,15 +1354,26 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
// console.log(rst);
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcFlowTabResult.eventGrpOnCreate = function(_$CELL, _$GRP_TYPE, _$GRP_OBJ_IDX, _$GRP_VAL_IDX, $CURRENT_RPT) {
|
|
|
- if ($CURRENT_RPT.events && $CURRENT_RPT.events[JV.EVENT_TYPE[JV.EVENT_IDX_GRP_ON_CREATE]]) {
|
|
|
- try {
|
|
|
- eval($CURRENT_RPT.events[JV.EVENT_TYPE[JV.EVENT_IDX_GRP_ON_CREATE]]);
|
|
|
- } catch (ex) {
|
|
|
- console.log(ex);
|
|
|
+
|
|
|
+ JpcFlowTabResult.checkGrpTxtOutEvent = function($RUN_TYPE, $TEXT, $TIMES, $CURRENT_RPT, $CURRENT_DATA) {
|
|
|
+ if ($CURRENT_RPT.formulas) {
|
|
|
+ for (let execFmlIdx = 0; execFmlIdx < $CURRENT_RPT.formulas.length; execFmlIdx++) {
|
|
|
+ if ($CURRENT_RPT.formulas[execFmlIdx][JV.PROP_RUN_TYPE] === $RUN_TYPE) {
|
|
|
+ const expression = $CURRENT_RPT.formulas[execFmlIdx][JV.PROP_EXPRESSION];
|
|
|
+ if (expression) {
|
|
|
+ const $ME = $CURRENT_RPT.formulas[execFmlIdx];
|
|
|
+ const $JE = JE;
|
|
|
+ try {
|
|
|
+ eval(expression);
|
|
|
+ } catch (ex) {
|
|
|
+ console.log(ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
JpcFlowTabResult.commonTabRestOutput = function(dataObj, page, segIdx, bands, band, unitFactor, tab, multiColIdx, $CURRENT_RPT, customizeCfg) {
|
|
|
const me = this;
|
|
|
let rst = [];
|