|
@@ -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;
|
|
@@ -579,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++;
|
|
@@ -591,6 +599,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
ttlSegRecAmtNormal += adHocAutoHeightAmt;
|
|
|
ttlSegRecAmt += adHocAutoHeightAmt;
|
|
|
+ if (adHocAutoHeightAmt > 0) exBuffer = grpRecAmt;
|
|
|
}
|
|
|
//自动行高调整在多流水合并方式时,只支持前部分(后期需要再加)
|
|
|
while (true) {
|
|
@@ -611,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 数据
|
|
@@ -654,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 {
|