|
@@ -361,12 +361,12 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
let rst = 1;
|
|
|
for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
|
|
|
/*
|
|
|
- let data_field = null;
|
|
|
- let tab_field = me.auto_height_fields_idx[loop][1];
|
|
|
- if (me.auto_height_fields_idx[loop][0] !== JV.BLANK_FIELD_INDEX) {
|
|
|
- data_field = data_details[me.auto_height_fields_idx[loop][0]];
|
|
|
- }
|
|
|
- /*/
|
|
|
+ let data_field = null;
|
|
|
+ let tab_field = me.auto_height_fields_idx[loop][1];
|
|
|
+ if (me.auto_height_fields_idx[loop][0] !== JV.BLANK_FIELD_INDEX) {
|
|
|
+ data_field = data_details[me.auto_height_fields_idx[loop][0]];
|
|
|
+ }
|
|
|
+ /*/
|
|
|
let tab_field = me.auto_height_fields_idx[loop][1];
|
|
|
let data_field = null,
|
|
|
map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
@@ -620,7 +620,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
if ((ttlSegRecAmtNormal < ttlSegRecAmt) || (followTabEx !== null)) {
|
|
|
//有流水拓展,并且是follow mode
|
|
|
if (currentRecAmt + accAutoHeightAmt + exBuffer + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
- // if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
+ // if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
// if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
|
if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
|
//纯 followTabEx 数据
|
|
@@ -684,7 +684,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
pageStatus[JV.STATUS_REPORT_END] = true;
|
|
|
private_resetBandArea();
|
|
|
let hasAdHocRow = ((adHocAutoHeightAmt > maxRowRec) || !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, handledRowAmt, maxRowRec, me.isEx));
|
|
|
- // !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx));
|
|
|
+ // !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx));
|
|
|
|
|
|
if (hasAdHocRow) {
|
|
|
//add page info(pre segment end)
|
|
@@ -935,7 +935,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
if (removeCellIds.length > 0) {
|
|
|
//排序,保证一定的顺序,不能用默认的方式(默认方式是针对字符串的简单排序)
|
|
|
removeCellIds.sort(function (idx1, idx2) {
|
|
|
- return idx1 - idx2;
|
|
|
+ return parseInt(idx1) - parseInt(idx2);
|
|
|
});
|
|
|
for (let idx = removeCellIds.length - 1; idx >= 0; idx--) {
|
|
|
rstPageCells.splice(removeCellIds[idx], 1);
|
|
@@ -1115,7 +1115,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++) {
|
|
@@ -1131,11 +1131,11 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- let lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx, grpVal_Idx, $CURRENT_RPT);
|
|
|
- grpVal_Idx++;
|
|
|
+ let lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx, grpCntIdx, $CURRENT_RPT);
|
|
|
rst = rst.concat(lineRst);
|
|
|
}
|
|
|
}
|
|
|
+ grpCntIdx++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1144,9 +1144,28 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
for (let idIdx = eliminateCells.length - 1; idIdx >= 0; idIdx--) {
|
|
|
rst.splice(eliminateCells[idIdx], 1);
|
|
|
}
|
|
|
+ me.checkCombineEvent(JV.RUN_TYPE_BEFORE_COMBINE, verticalCombinePos, horizonCombinePos, rst, $CURRENT_RPT);
|
|
|
me.combinePageCells(rst, verticalCombinePos, horizonCombinePos);
|
|
|
+ me.checkCombineEvent(JV.RUN_TYPE_AFTER_COMBINE, verticalCombinePos, horizonCombinePos, rst, $CURRENT_RPT);
|
|
|
return rst;
|
|
|
};
|
|
|
+ JpcFlowTabResult.checkCombineEvent = function ($RUN_TYPE, $VER_COMB_ARRAY, $HOR_COMB_ARRAY, $CURRENT_CELL_ITEMS, $CURRENT_RPT) {
|
|
|
+ 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) {
|
|
|
+ let expression = $CURRENT_RPT.formulas[execFmlIdx][JV.PROP_EXPRESSION];
|
|
|
+ if (expression) {
|
|
|
+ let $ME = $CURRENT_RPT.formulas[execFmlIdx];
|
|
|
+ try {
|
|
|
+ eval(expression);
|
|
|
+ } catch (ex) {
|
|
|
+ console.log(ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
JpcFlowTabResult.outputColumn = function (rptTpl, dataObj, page, segIdx, bands, unitFactor, multiColIdx) {
|
|
|
let me = this, rst = [];
|
|
|
let FLOW_NODE_STR = me.isEx?JV.NODE_FLOW_INFO_EX:JV.NODE_FLOW_INFO;
|
|
@@ -1278,7 +1297,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) {
|
|
|
let me = this, rst = [];
|
|
|
if (grp_line[JV.PROP_GROUP_SUM_KEYS]) {
|
|
|
let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
|
|
@@ -1291,13 +1310,11 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
}
|
|
|
if (grp_line[JV.PROP_TEXTS]) {
|
|
|
- for (let grpIdx = 0; grpIdx < grp_line[JV.PROP_TEXTS].length; grpIdx++) {
|
|
|
- let txt = grp_line[JV.PROP_TEXTS][grpIdx];
|
|
|
- let 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 (let txt of grp_line[JV.PROP_TEXTS]) {
|
|
|
+ me.checkGrpTxtOutEvent(JV.RUN_TYPE_BEFORE_GROUP_TEXT_OUT, txt, grpCntIdx, $CURRENT_RPT);
|
|
|
+ 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]) {
|
|
@@ -1309,15 +1326,24 @@ 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) {
|
|
|
+ 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) {
|
|
|
+ let expression = $CURRENT_RPT.formulas[execFmlIdx][JV.PROP_EXPRESSION];
|
|
|
+ if (expression) {
|
|
|
+ let $ME = $CURRENT_RPT.formulas[execFmlIdx];
|
|
|
+ try {
|
|
|
+ eval(expression);
|
|
|
+ } catch (ex) {
|
|
|
+ console.log(ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
JpcFlowTabResult.commonTabRestOutput = function(dataObj, page, segIdx, bands, band, unitFactor, tab, multiColIdx){
|
|
|
let me = this, rst = [];
|
|
|
if (tab[JV.PROP_TEXT]) {
|
|
@@ -1374,7 +1400,7 @@ function setupControl(mergeCell, controls) {
|
|
|
mergeCell[JV.PROP_CONTROL].Shrink = "T";
|
|
|
mergeCell[JV.PROP_CONTROL].Vertical = "top";
|
|
|
mergeCell[JV.PROP_CONTROL].Wrap = (mergeCell[JV.PROP_IS_AUTO_HEIGHT])?'T':'F',
|
|
|
- mergeCell[JV.PROP_CONTROL].VerticalForExcel = "center";
|
|
|
+ mergeCell[JV.PROP_CONTROL].VerticalForExcel = "center";
|
|
|
orgCtrl = mergeCell[JV.PROP_CONTROL];
|
|
|
}
|
|
|
if (mergeCell[JV.PROP_IS_AUTO_HEIGHT]) {
|