|
@@ -20,11 +20,12 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
//grpPageInfo :{"segGrpRecStartIdx": 0, "insertedGrpRecAmt": 0, "preAddPageGrpInfo": null}; //纯属解释参数grpPageInfo结构
|
|
|
//valueIdx: [isFollowMode, type(normal, auto-height, group), valueIndex, sub-value-index(自动行高特有), total-value-amount(自动行高特有)] //解释 dispValueIdxLst 数据构造
|
|
|
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 = [], vFirstIdx = [], preAmt = 0, insertedGrpAmt = 0, grp_lines = 0, followMode = (isFollow)?JV.TYPE_FOLLOW_MODE:-1, nextPageAutoHeightRecAmt = 0;
|
|
|
if (grpSequenceInfo && grpPageInfo) {
|
|
|
if (grpPageInfo[JV.PROP_PRE_ADD_GRP_REC_INFO].length > 0) {
|
|
|
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]);
|
|
|
+ vFirstIdx.push([followMode, JV.DISPLAY_VAL_TYPE_GROUP, grpPageInfo[JV.PROP_SEG_GRP_IDX], grpLineIdx]);
|
|
|
}
|
|
|
grpPageInfo[JV.PROP_SEG_GRP_IDX]++;
|
|
|
}
|
|
@@ -127,6 +128,10 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
if (private_normal_add_rec(vi)) break;
|
|
|
}
|
|
|
}
|
|
|
+ if (vFirstIdx.length > 0) {
|
|
|
+ vIdx = vIdx.concat(vFirstIdx);
|
|
|
+ //备注: 在一开始就加grp的情况下,这些数据应该放在后面才对
|
|
|
+ }
|
|
|
page_seg_map.push([pageIdx, segIdx]);
|
|
|
ValuedIdxLst.push(vIdx);
|
|
|
return nextPageAutoHeightRecAmt;
|
|
@@ -502,6 +507,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
maxRowRec = JpcFlowTabHelper.getMaxRowsPerPage(bands, rptTpl, me.isEx);
|
|
|
}
|
|
|
let handledRowAmt = 0; //handledRowAmt纪录的是真正处理过的显示行数,包含了空白行,主要是为分页用(自动行高)
|
|
|
+ let segRestRecAmt = 0; //一般情况下为0,只有在特殊情况下才需要,如09-x表中,正常流水一页显示不了的时候,就有大问题了
|
|
|
function private_addPage(segIdx, grpSeqInfo, isFollow, isMix, mixSplitPoint) {
|
|
|
private_resetBandArea();
|
|
|
me.pageStatusLst.push(pageStatus.slice(0));
|
|
@@ -516,6 +522,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
redundantRecAmt++;
|
|
|
}
|
|
|
}
|
|
|
+ let restRecAmt = 0;
|
|
|
if (isMix) {
|
|
|
//先处理上半部分
|
|
|
prePageLeftAutoHeightRecAmt = private_addPageValue(me.dispValueIdxLst, me.segments[segIdx], grpSeqInfo, counterRowRec, mixSplitPoint,me.page_seg_map, segIdx, pageIdx, grpPageInfo, false, me.auto_height_info, prePageLeftAutoHeightRecAmt);
|
|
@@ -523,7 +530,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
private_chk_handle_rec_amt(dv, false);
|
|
|
}
|
|
|
//再处理下半部分
|
|
|
- let restRecAmt = maxRowRec - me.dispValueIdxLst[me.dispValueIdxLst.length - 1].length; //备注:在一些极端条件下,mixSplitPoint这个分割点不合适处理下半部分数据,以实际生成的value-index数量为准
|
|
|
+ restRecAmt = maxRowRec - me.dispValueIdxLst[me.dispValueIdxLst.length - 1].length; //备注:在一些极端条件下,mixSplitPoint这个分割点不合适处理下半部分数据,以实际生成的value-index数量为准
|
|
|
// private_addPageValue(me.dispValueIdxLst, followTabEx.segments[segIdx], null, counterRowRecEx, maxRowRec - mixSplitPoint, me.page_seg_map, segIdx, pageIdx, null, true, null, 0);
|
|
|
private_addPageValue(me.dispValueIdxLst, followTabEx.segments[segIdx], null, counterRowRecEx, restRecAmt, me.page_seg_map, segIdx, pageIdx, null, true, null, 0);
|
|
|
for (let dv of me.dispValueIdxLst[me.dispValueIdxLst.length - 1]) {
|
|
@@ -548,6 +555,10 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
}
|
|
|
currentRecAmt -= redundantRecAmt; //在自动行高调整场景下,需要减去冗余的数量
|
|
|
+ if (restRecAmt < 0) {
|
|
|
+ currentRecAmt -= restRecAmt;
|
|
|
+ segRestRecAmt = restRecAmt;
|
|
|
+ }
|
|
|
}
|
|
|
for (let segIdx = 0; segIdx < me.segments.length; segIdx++) {
|
|
|
let grpSeqInfo = (me.group_node_info)?me.group_node_info[segIdx]:null;
|
|
@@ -555,6 +566,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
let grpRecAmtEx = 0;
|
|
|
let accAutoHeightAmt = 0; //累计的自动行高数量
|
|
|
handledRowAmt = 0; //初始化每一段的已处理纪录行数
|
|
|
+ segRestRecAmt = 0;
|
|
|
if (followTabEx && followTabEx.group_node_info) {
|
|
|
grpRecAmtEx = followTabEx.group_node_info.length * followTabEx.group_lines_amt;
|
|
|
}
|
|
@@ -572,10 +584,13 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
let ttlSegRecAmtNormal = me.segments[segIdx].length + grpRecAmt; //正常的segment下的数据长度累计(含grouping data)
|
|
|
let ttlSegRecAmt = (followTabEx)?(me.segments[segIdx].length + grpRecAmt + followTabEx.segments[segIdx].length + grpRecAmtEx):(me.segments[segIdx].length + grpRecAmt); //所有的segment下的数据长度累计(包括ex部分)
|
|
|
let adHocAutoHeightAmt = 0;
|
|
|
+ let normalContentAmt = 0;
|
|
|
+ let exBuffer = 0;
|
|
|
let adHocAutoHeightGrpStartIdx = 0;
|
|
|
if (me.auto_height_fields_idx.length > 0) {
|
|
|
for (let loop = 0; loop < me.auto_height_info[segIdx].length; loop++) {
|
|
|
adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
|
|
|
+ normalContentAmt++;
|
|
|
if (me.group_node_info && me.group_node_info[segIdx]) {
|
|
|
if (me.group_node_info[segIdx][adHocAutoHeightGrpStartIdx] === loop) {
|
|
|
adHocAutoHeightGrpStartIdx++;
|
|
@@ -584,6 +599,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
ttlSegRecAmtNormal += adHocAutoHeightAmt;
|
|
|
ttlSegRecAmt += adHocAutoHeightAmt;
|
|
|
+ if (adHocAutoHeightAmt > 0) exBuffer = grpRecAmt;
|
|
|
}
|
|
|
//自动行高调整在多流水合并方式时,只支持前部分(后期需要再加)
|
|
|
while (true) {
|
|
@@ -604,8 +620,8 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
if ((ttlSegRecAmtNormal < ttlSegRecAmt) || (followTabEx !== null)) {
|
|
|
//有流水拓展,并且是follow mode
|
|
|
- // if (currentRecAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
- if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
+ if (currentRecAmt + accAutoHeightAmt + exBuffer + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
+ // if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
|
|
|
// if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
|
if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
|
|
|
//纯 followTabEx 数据
|
|
@@ -647,7 +663,12 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
private_addPage(segIdx, grpSeqInfo, false, true, ttlSegRecAmtNormal);
|
|
|
}
|
|
|
} else {
|
|
|
- private_addPage(segIdx, grpSeqInfo, false, true, ttlSegRecAmtNormal);
|
|
|
+ //在这里要考虑如果有多页正常的流水数据情况,那么就得考虑这页有多少条普通流水记录,不应该一刀切地用ttlSegRecAmtNormal
|
|
|
+ let splitPoint = ttlSegRecAmtNormal - handledRowAmt ;
|
|
|
+ // if (splitPoint > (exBuffer + maxRowRec)) {
|
|
|
+ // splitPoint = splitPoint % (exBuffer + maxRowRec);
|
|
|
+ // }
|
|
|
+ private_addPage(segIdx, grpSeqInfo, false, true, splitPoint);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -684,7 +705,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
//检测是否可退出
|
|
|
// if ((currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt >= ttlSegRecAmt) && (pageIdx % me.multiCols === 0)) {
|
|
|
- if (handledRowAmt >= ttlSegRecAmt && (pageIdx % me.multiCols === 0)) {
|
|
|
+ if (handledRowAmt >= (ttlSegRecAmt + segRestRecAmt) && (pageIdx % me.multiCols === 0)) {
|
|
|
//备注:这里必须得考虑多栏的情况,否则会造成pageStatus出界的问题
|
|
|
break;
|
|
|
}
|
|
@@ -904,7 +925,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
for (let idx_ex = 0; idx_ex < tab_fields_ex.length; idx_ex++) {
|
|
|
let tab_fieldex = tab_fields_ex[idx_ex];
|
|
|
let data_fieldex = null, map_data_fieldex = JE.F(tab_fieldex[JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
|
- if (me.disp_fields_ex_idx[idx_ex] !== JV.BLANK_FIELD_INDEX && (typeof me.disp_fields_idx[idx_ex] !== 'object')) {
|
|
|
+ if (me.disp_fields_ex_idx[idx_ex] !== JV.BLANK_FIELD_INDEX && (typeof me.disp_fields_ex_idx[idx_ex] !== 'object')) {
|
|
|
data_fieldex = data_details_ex[me.disp_fields_ex_idx[idx_ex]];
|
|
|
} else {
|
|
|
if (map_data_fieldex) {
|