|
@@ -12,12 +12,11 @@ let JpcAreaHelper = require('./helper/jpc_helper_area');
|
|
let PDFKit = require('pdfkit');
|
|
let PDFKit = require('pdfkit');
|
|
|
|
|
|
let JpcFlowTabSrv = function(){};
|
|
let JpcFlowTabSrv = function(){};
|
|
-//let grpPageInfo = {"segGrpRecStartIdx": 0, "insertedGrpRecAmt": 0, "preAddPageGrpInfo": null};
|
|
|
|
JpcFlowTabSrv.prototype.createNew = function(){
|
|
JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
|
+ //grpPageInfo :{"segGrpRecStartIdx": 0, "insertedGrpRecAmt": 0, "preAddPageGrpInfo": null}; //纯属解释参数grpPageInfo结构
|
|
function private_addPageValue(ValuedIdxLst, sortedSequence, grpSequenceInfo, startRecIdx, maxRecPerPage,page_seg_map, segIdx, pageIdx, grpPageInfo, isFollow, segAutoHeightInfo, prePageLeftAutoHeightRecAmt) {
|
|
function private_addPageValue(ValuedIdxLst, sortedSequence, grpSequenceInfo, startRecIdx, maxRecPerPage,page_seg_map, segIdx, pageIdx, grpPageInfo, isFollow, segAutoHeightInfo, prePageLeftAutoHeightRecAmt) {
|
|
let vIdx = [], preAmt = 0, insertedGrpAmt = 0, grp_lines = 0, followMode = (isFollow)?JV.TYPE_FOLLOW_MODE:-1, nextPageAutoHeightRecAmt = 0;
|
|
let vIdx = [], preAmt = 0, insertedGrpAmt = 0, grp_lines = 0, followMode = (isFollow)?JV.TYPE_FOLLOW_MODE:-1, nextPageAutoHeightRecAmt = 0;
|
|
if (grpSequenceInfo && grpPageInfo) {
|
|
if (grpSequenceInfo && grpPageInfo) {
|
|
- //grpPageInfo[JV.PROP_INSERTED_GRP_REC] = 0;
|
|
|
|
if (grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO].length > 0) {
|
|
if (grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO].length > 0) {
|
|
for (let grpLineIdx of grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO]) {
|
|
for (let grpLineIdx of grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO]) {
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_GROUP, grpPageInfo[JV.PROP_SEG_GRP_IDX], grpLineIdx]);
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_GROUP, grpPageInfo[JV.PROP_SEG_GRP_IDX], grpLineIdx]);
|
|
@@ -36,9 +35,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
ttlValAmt = segAutoHeightInfo[segIdx][startRecIdx + vi];
|
|
ttlValAmt = segAutoHeightInfo[segIdx][startRecIdx + vi];
|
|
}
|
|
}
|
|
if (prePageLeftAutoHeightRecAmt > 0 && vi === 0) {
|
|
if (prePageLeftAutoHeightRecAmt > 0 && vi === 0) {
|
|
- // startIdx = ttlValAmt - prePageLeftAutoHeightRecAmt;
|
|
|
|
startIdx = prePageLeftAutoHeightRecAmt;
|
|
startIdx = prePageLeftAutoHeightRecAmt;
|
|
- // autoHeightAmt += prePageLeftAutoHeightRecAmt;
|
|
|
|
}
|
|
}
|
|
for (let subValIdx = startIdx; subValIdx < ttlValAmt; subValIdx++) {
|
|
for (let subValIdx = startIdx; subValIdx < ttlValAmt; subValIdx++) {
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT, sortedSequence[startRecIdx + vi], subValIdx, ttlValAmt]);
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT, sortedSequence[startRecIdx + vi], subValIdx, ttlValAmt]);
|
|
@@ -50,67 +47,68 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return couldBreak;
|
|
return couldBreak;
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
+ let private_inner_add_grp_rec = function(vi) {
|
|
|
|
+ let hasFullGrp = true, couldBreak = false;
|
|
|
|
+ for (let i = 0; i < grp_lines; i++) {
|
|
|
|
+ if ( ((vi + insertedGrpAmt * grp_lines) + i + 1) >= (maxRecPerPage - preAmt)) {
|
|
|
|
+ for (let j = i; j < grp_lines; j++) {
|
|
|
|
+ grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO].push(j);
|
|
|
|
+ }
|
|
|
|
+ //准备要跳出去了
|
|
|
|
+ hasFullGrp = false;
|
|
|
|
+ break;
|
|
|
|
+ } else {
|
|
|
|
+ vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_GROUP, grpPageInfo[JV.PROP_SEG_GRP_IDX], i]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //3. 进位下一个group信息所在位置
|
|
|
|
+ if (hasFullGrp) {
|
|
|
|
+ grpPageInfo[JV.PROP_INSERTED_GRP_REC]++;
|
|
|
|
+ insertedGrpAmt++;
|
|
|
|
+ grpPageInfo[JV.PROP_SEG_GRP_IDX]++;
|
|
|
|
+ } else {
|
|
|
|
+ couldBreak = true;
|
|
|
|
+ }
|
|
|
|
+ return couldBreak;
|
|
|
|
+ };
|
|
|
|
+ let private_normal_add_rec = function(vi) {
|
|
|
|
+ let couldBreak = false;
|
|
|
|
+ if (segAutoHeightInfo && segAutoHeightInfo.length > 0) {
|
|
|
|
+ if (segAutoHeightInfo[segIdx].length > startRecIdx + vi) {
|
|
|
|
+ couldBreak = private_addAutoHeightPageValue(vi);
|
|
|
|
+ // if (couldBreak) break;
|
|
|
|
+ } else if (vIdx.length < maxRecPerPage) {
|
|
|
|
+ vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (sortedSequence.length > startRecIdx + vi) {
|
|
|
|
+ vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, sortedSequence[startRecIdx + vi]]);
|
|
|
|
+ } else {
|
|
|
|
+ vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return couldBreak;
|
|
|
|
+ };
|
|
for (let vi = 0; (vi + insertedGrpAmt * grp_lines) < maxRecPerPage - preAmt; vi++) {
|
|
for (let vi = 0; (vi + insertedGrpAmt * grp_lines) < maxRecPerPage - preAmt; vi++) {
|
|
if (grpSequenceInfo && grpPageInfo) {
|
|
if (grpSequenceInfo && grpPageInfo) {
|
|
if ((startRecIdx + vi) === grpSequenceInfo[grpPageInfo[JV.PROP_SEG_GRP_IDX]]) {
|
|
if ((startRecIdx + vi) === grpSequenceInfo[grpPageInfo[JV.PROP_SEG_GRP_IDX]]) {
|
|
//表示这里要插入grouping信息啦!
|
|
//表示这里要插入grouping信息啦!
|
|
- //1. 首先push正常的记录
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, sortedSequence[startRecIdx + vi]]);
|
|
|
|
- //2. 然后就要push grouping记录了
|
|
|
|
- let hasFullGrp = true;
|
|
|
|
- for (let i = 0; i < grp_lines; i++) {
|
|
|
|
- if ( ((vi + insertedGrpAmt * grp_lines) + i + 1) >= (maxRecPerPage - preAmt)) {
|
|
|
|
- for (let j = i; j < grp_lines; j++) {
|
|
|
|
- grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO].push(j);
|
|
|
|
- }
|
|
|
|
- //准备要跳出去了
|
|
|
|
- hasFullGrp = false;
|
|
|
|
- break;
|
|
|
|
- } else {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_GROUP, grpPageInfo[JV.PROP_SEG_GRP_IDX], i]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //3. 进位下一个group信息所在位置
|
|
|
|
- if (hasFullGrp) {
|
|
|
|
- grpPageInfo[JV.PROP_INSERTED_GRP_REC]++;
|
|
|
|
- insertedGrpAmt++;
|
|
|
|
- grpPageInfo[JV.PROP_SEG_GRP_IDX]++;
|
|
|
|
- } else {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ let couldBreak = false;
|
|
|
|
+ //1. 首先push正常的记录(要考虑自动行高调整的分支)
|
|
if (segAutoHeightInfo && segAutoHeightInfo.length > 0) {
|
|
if (segAutoHeightInfo && segAutoHeightInfo.length > 0) {
|
|
- if (segAutoHeightInfo[segIdx].length > startRecIdx + vi) {
|
|
|
|
- let couldBreak = private_addAutoHeightPageValue(vi);
|
|
|
|
- if (couldBreak) break;
|
|
|
|
- } else if (vIdx.length < maxRecPerPage) {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
- }
|
|
|
|
|
|
+ couldBreak = private_addAutoHeightPageValue(vi);
|
|
} else {
|
|
} else {
|
|
- if (sortedSequence.length > startRecIdx + vi) {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, sortedSequence[startRecIdx + vi]]);
|
|
|
|
- } else {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (segAutoHeightInfo && segAutoHeightInfo.length > 0) {
|
|
|
|
- if (segAutoHeightInfo[segIdx].length > startRecIdx + vi) {
|
|
|
|
- let couldBreak = private_addAutoHeightPageValue(vi);
|
|
|
|
- if (couldBreak) break;
|
|
|
|
- } else if (vIdx.length < maxRecPerPage) {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- nextPageAutoHeightRecAmt = 0;
|
|
|
|
- if (sortedSequence.length > startRecIdx + vi) {
|
|
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, sortedSequence[startRecIdx + vi]]);
|
|
vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, sortedSequence[startRecIdx + vi]]);
|
|
- } else {
|
|
|
|
- vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
|
|
|
|
}
|
|
}
|
|
|
|
+ //2. 然后就要push grouping记录了
|
|
|
|
+ if (private_inner_add_grp_rec(vi)) break;
|
|
|
|
+ if (couldBreak) break;
|
|
|
|
+ } else {
|
|
|
|
+ if (private_normal_add_rec(vi)) break;
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ if (private_normal_add_rec(vi)) break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
page_seg_map.push([pageIdx, segIdx]);
|
|
page_seg_map.push([pageIdx, segIdx]);
|
|
@@ -283,7 +281,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return rst;
|
|
return rst;
|
|
- }
|
|
|
|
|
|
+ };
|
|
let private_get_max_lines_of_the_record = function(theRecIdx) {
|
|
let private_get_max_lines_of_the_record = function(theRecIdx) {
|
|
let rst = 1;
|
|
let rst = 1;
|
|
for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
|
|
for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
|
|
@@ -414,8 +412,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
pageIdx++;
|
|
pageIdx++;
|
|
function private_chk_handle_rec_amt(dv, isEx) {
|
|
function private_chk_handle_rec_amt(dv, isEx) {
|
|
if ((dv[1] === JV.DISPLAY_VAL_TYPE_NORMAL) || (dv[1] === JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT && dv[3] === dv[4] - 1)) {
|
|
if ((dv[1] === JV.DISPLAY_VAL_TYPE_NORMAL) || (dv[1] === JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT && dv[3] === dv[4] - 1)) {
|
|
- if (isEx) counterRowRecEx++
|
|
|
|
- else counterRowRec++;
|
|
|
|
|
|
+ if (isEx) {counterRowRecEx++} else counterRowRec++;
|
|
} else if (dv[1] === JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT) {
|
|
} else if (dv[1] === JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT) {
|
|
redundantRecAmt++;
|
|
redundantRecAmt++;
|
|
}
|
|
}
|
|
@@ -439,7 +436,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
me.dispValueIdxLst.splice(me.dispValueIdxLst.length - 1, 1);
|
|
me.dispValueIdxLst.splice(me.dispValueIdxLst.length - 1, 1);
|
|
} else if (isFollow) {
|
|
} else if (isFollow) {
|
|
- prePageLeftAutoHeightRecAmt = private_addPageValue(me.dispValueIdxLst, followTabEx.segments[segIdx], null, counterRowRecEx, maxRowRec, me.page_seg_map, segIdx, pageIdx, null, true, me.auto_height_info, prePageLeftAutoHeightRecAmt);
|
|
|
|
|
|
+ prePageLeftAutoHeightRecAmt = private_addPageValue(me.dispValueIdxLst, followTabEx.segments[segIdx], null, counterRowRecEx, maxRowRec, me.page_seg_map, segIdx, pageIdx, null, true, null, 0);
|
|
for (let dv of me.dispValueIdxLst[me.dispValueIdxLst.length - 1]) {
|
|
for (let dv of me.dispValueIdxLst[me.dispValueIdxLst.length - 1]) {
|
|
private_chk_handle_rec_amt(dv, true);
|
|
private_chk_handle_rec_amt(dv, true);
|
|
}
|
|
}
|
|
@@ -478,7 +475,6 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
|
|
adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
|
|
if (me.group_node_info && me.group_node_info[segIdx]) {
|
|
if (me.group_node_info && me.group_node_info[segIdx]) {
|
|
if (me.group_node_info[segIdx][adHocAutoHeightGrpStartIdx] === loop) {
|
|
if (me.group_node_info[segIdx][adHocAutoHeightGrpStartIdx] === loop) {
|
|
- me.group_node_info[segIdx][adHocAutoHeightGrpStartIdx] = me.group_node_info[segIdx][adHocAutoHeightGrpStartIdx] + adHocAutoHeightAmt;
|
|
|
|
adHocAutoHeightGrpStartIdx++;
|
|
adHocAutoHeightGrpStartIdx++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -486,34 +482,32 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
ttlSegRecAmtNormal += adHocAutoHeightAmt;
|
|
ttlSegRecAmtNormal += adHocAutoHeightAmt;
|
|
ttlSegRecAmt += adHocAutoHeightAmt;
|
|
ttlSegRecAmt += adHocAutoHeightAmt;
|
|
}
|
|
}
|
|
- //自动行高调整暂时不支持多流水合并方式(后期需要再加)
|
|
|
|
|
|
+ //自动行高调整在多流水合并方式时,只支持前部分(后期需要再加)
|
|
while (true) {
|
|
while (true) {
|
|
if (currentRecAmt > 0) pageStatus[JV.STATUS_SEGMENT_START] = false;
|
|
if (currentRecAmt > 0) pageStatus[JV.STATUS_SEGMENT_START] = false;
|
|
if (pageIdx > 0) pageStatus[JV.STATUS_REPORT_START] = false;
|
|
if (pageIdx > 0) pageStatus[JV.STATUS_REPORT_START] = false;
|
|
//开始判断各种scenarios
|
|
//开始判断各种scenarios
|
|
adHocAutoHeightAmt = 0;
|
|
adHocAutoHeightAmt = 0;
|
|
- let recAmtForAdHocAutoHeight = 0;
|
|
|
|
if (me.auto_height_fields_idx.length > 0) {
|
|
if (me.auto_height_fields_idx.length > 0) {
|
|
adHocAutoHeightAmt -= prePageLeftAutoHeightRecAmt;
|
|
adHocAutoHeightAmt -= prePageLeftAutoHeightRecAmt;
|
|
//for (let loop = currentRecAmt; loop < me.auto_height_info[segIdx].length; loop++) {
|
|
//for (let loop = currentRecAmt; loop < me.auto_height_info[segIdx].length; loop++) {
|
|
for (let loop = currentRecAmt; loop < currentRecAmt + maxRowRec; loop++) {
|
|
for (let loop = currentRecAmt; loop < currentRecAmt + maxRowRec; loop++) {
|
|
if (me.auto_height_info[segIdx].length > loop) {
|
|
if (me.auto_height_info[segIdx].length > loop) {
|
|
adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
|
|
adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
|
|
- recAmtForAdHocAutoHeight++;
|
|
|
|
} else {
|
|
} else {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ((ttlSegRecAmtNormal < ttlSegRecAmt) || (followTabEx != null)) {
|
|
|
|
|
|
+ if ((ttlSegRecAmtNormal < ttlSegRecAmt) || (followTabEx !== null)) {
|
|
//有流水拓展,并且是follow mode
|
|
//有流水拓展,并且是follow mode
|
|
- if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
|
- if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight >= ttlSegRecAmtNormal) {
|
|
|
|
|
|
+ if (currentRecAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
|
+ if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
//纯 followTabEx 数据
|
|
//纯 followTabEx 数据
|
|
- if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec >= ttlSegRecAmt) {
|
|
|
|
|
|
+ if (currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
private_resetBandArea();
|
|
private_resetBandArea();
|
|
- let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight, maxRowRec, me.isEx);
|
|
|
|
|
|
+ let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
|
|
if (hasAdHocRow) {
|
|
if (hasAdHocRow) {
|
|
//add page info(pre segment end)
|
|
//add page info(pre segment end)
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
@@ -527,10 +521,10 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//混合数据
|
|
//混合数据
|
|
- if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec >= ttlSegRecAmt) {
|
|
|
|
|
|
+ if (currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
private_resetBandArea();
|
|
private_resetBandArea();
|
|
- let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight, maxRowRec, me.isEx);
|
|
|
|
|
|
+ let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
|
|
if (hasAdHocRow) {
|
|
if (hasAdHocRow) {
|
|
//add page info(pre segment end)
|
|
//add page info(pre segment end)
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
@@ -538,7 +532,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
//add page info
|
|
//add page info
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
- if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight >= ttlSegRecAmtNormal) {
|
|
|
|
|
|
+ if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
//纯 followTabEx 数据啦
|
|
//纯 followTabEx 数据啦
|
|
private_addPage(segIdx, null, true, false, -1);
|
|
private_addPage(segIdx, null, true, false, -1);
|
|
} else {
|
|
} else {
|
|
@@ -554,14 +548,15 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//普通流水数据情况
|
|
//普通流水数据情况
|
|
- if ((currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec >= ttlSegRecAmt)
|
|
|
|
- && (recAmtForAdHocAutoHeight + adHocAutoHeightAmt < 2 * maxRowRec) ) {
|
|
|
|
|
|
+ if ((currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt)
|
|
|
|
+ //&& (adHocAutoHeightAmt < 2 * maxRowRec) ) {
|
|
|
|
+ && ((currentRecAmt + adHocAutoHeightAmt + maxRowRec - ttlSegRecAmt) < maxRowRec) ) {
|
|
//备注: 理论上自动行高是没有上限的,有可能正常一页的数据可以拓展到3页及以上,在此极端情况下,必须做一些限制判断,否则会出现缺页情况。
|
|
//备注: 理论上自动行高是没有上限的,有可能正常一页的数据可以拓展到3页及以上,在此极端情况下,必须做一些限制判断,否则会出现缺页情况。
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = true;
|
|
pageStatus[JV.STATUS_REPORT_END] = true;
|
|
pageStatus[JV.STATUS_REPORT_END] = true;
|
|
private_resetBandArea();
|
|
private_resetBandArea();
|
|
- let hasAdHocRow = ((recAmtForAdHocAutoHeight + adHocAutoHeightAmt > maxRowRec) ||
|
|
|
|
- !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight, maxRowRec, me.isEx));
|
|
|
|
|
|
+ let hasAdHocRow = ((adHocAutoHeightAmt > maxRowRec) ||
|
|
|
|
+ !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx));
|
|
if (hasAdHocRow) {
|
|
if (hasAdHocRow) {
|
|
//add page info(pre segment end)
|
|
//add page info(pre segment end)
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
pageStatus[JV.STATUS_SEGMENT_END] = false;
|
|
@@ -591,7 +586,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- console.log(me.auto_height_info);
|
|
|
|
|
|
+ // console.log(me.auto_height_info);
|
|
// console.log(me.dispValueIdxLst);
|
|
// console.log(me.dispValueIdxLst);
|
|
rst = Math.ceil(pageIdx / me.multiCols);
|
|
rst = Math.ceil(pageIdx / me.multiCols);
|
|
}
|
|
}
|
|
@@ -760,7 +755,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
for (let grpIdx = 0; grpIdx < rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES].length; grpIdx++) {
|
|
for (let grpIdx = 0; grpIdx < rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES].length; grpIdx++) {
|
|
if (contentValuesIdx[rowIdx][3] === grpIdx) {
|
|
if (contentValuesIdx[rowIdx][3] === grpIdx) {
|
|
let grp_line = rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES][grpIdx];
|
|
let grp_line = rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES][grpIdx];
|
|
- let lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx)
|
|
|
|
|
|
+ let lineRst = me.outputTabGrpLine(band, grp_line, page, contentValuesIdx[rowIdx], contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx);
|
|
rst = rst.concat(lineRst);
|
|
rst = rst.concat(lineRst);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -887,7 +882,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
let curSegGrpSum = me.group_sum_values[segIdx];
|
|
let curSegGrpSum = me.group_sum_values[segIdx];
|
|
for (let sumFieldNode of grp_line[JV.PROP_GROUP_SUM_KEYS]) {
|
|
for (let sumFieldNode of grp_line[JV.PROP_GROUP_SUM_KEYS]) {
|
|
let value = curSegGrpSum[sumFieldNode[JV.PROP_SUM_KEY]][grpValueIdx[2]];
|
|
let value = curSegGrpSum[sumFieldNode[JV.PROP_SUM_KEY]][grpValueIdx[2]];
|
|
- let sumFldRst = JpcTextHelper.outputDirectValue(sumFieldNode, value, band, unitFactor, rows, rowIdx, cols, colIdx, me.multiCols, multiColIdx)
|
|
|
|
|
|
+ let sumFldRst = JpcTextHelper.outputDirectValue(sumFieldNode, value, band, unitFactor, rows, rowIdx, cols, colIdx, me.multiCols, multiColIdx);
|
|
rst.push(sumFldRst);
|
|
rst.push(sumFldRst);
|
|
}
|
|
}
|
|
}
|
|
}
|