|  | @@ -47,7 +47,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return couldBreak;
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  |          let private_inner_add_grp_rec = function(vi) {
 | 
	
		
			
				|  |  |              let hasFullGrp = true, couldBreak = false;
 | 
	
		
			
				|  |  |              for (let i = 0; i < grp_lines; i++) {
 | 
	
	
		
			
				|  | @@ -71,7 +71,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                  couldBreak = true;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return couldBreak;
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  |          let private_normal_add_rec = function(vi) {
 | 
	
		
			
				|  |  |              let couldBreak = false;
 | 
	
		
			
				|  |  |              if (segAutoHeightInfo && segAutoHeightInfo.length > 0) {
 | 
	
	
		
			
				|  | @@ -89,7 +89,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return couldBreak;
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  |          for (let vi = 0; (vi + insertedGrpAmt * grp_lines) < maxRecPerPage - preAmt; vi++) {
 | 
	
		
			
				|  |  |              if (grpSequenceInfo && grpPageInfo) {
 | 
	
		
			
				|  |  |                  if ((startRecIdx + vi) === grpSequenceInfo[grpPageInfo[JV.PROP_SEG_GRP_IDX]]) {
 | 
	
	
		
			
				|  | @@ -281,7 +281,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  return rst;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  |              let private_get_max_lines_of_the_record = function(theRecIdx) {
 | 
	
		
			
				|  |  |                  let rst = 1;
 | 
	
		
			
				|  |  |                  for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
 | 
	
	
		
			
				|  | @@ -412,8 +412,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                  pageIdx++;
 | 
	
		
			
				|  |  |                  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 (isEx) counterRowRecEx++
 | 
	
		
			
				|  |  | -                        else counterRowRec++;
 | 
	
		
			
				|  |  | +                        if (isEx) counterRowRecEx++ else counterRowRec++;
 | 
	
		
			
				|  |  |                      } else if (dv[1] === JV.DISPLAY_VAL_TYPE_AUTO_HEIGHT) {
 | 
	
		
			
				|  |  |                          redundantRecAmt++;
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -483,20 +482,18 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                      ttlSegRecAmtNormal += adHocAutoHeightAmt;
 | 
	
		
			
				|  |  |                      ttlSegRecAmt += adHocAutoHeightAmt;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                //自动行高调整暂时不支持多流水合并方式(后期需要再加)
 | 
	
		
			
				|  |  | +                //自动行高调整在多流水合并方式时,只支持前部分(后期需要再加)
 | 
	
		
			
				|  |  |                  while (true) {
 | 
	
		
			
				|  |  |                      if (currentRecAmt > 0) pageStatus[JV.STATUS_SEGMENT_START] = false;
 | 
	
		
			
				|  |  |                      if (pageIdx > 0) pageStatus[JV.STATUS_REPORT_START] = false;
 | 
	
		
			
				|  |  |                      //开始判断各种scenarios
 | 
	
		
			
				|  |  |                      adHocAutoHeightAmt = 0;
 | 
	
		
			
				|  |  | -                    let recAmtForAdHocAutoHeight = 0;
 | 
	
		
			
				|  |  |                      if (me.auto_height_fields_idx.length > 0) {
 | 
	
		
			
				|  |  |                          adHocAutoHeightAmt -= prePageLeftAutoHeightRecAmt;
 | 
	
		
			
				|  |  |                          //for (let loop = currentRecAmt; loop < me.auto_height_info[segIdx].length; loop++) {
 | 
	
		
			
				|  |  |                          for (let loop = currentRecAmt; loop < currentRecAmt + maxRowRec; loop++) {
 | 
	
		
			
				|  |  |                              if (me.auto_height_info[segIdx].length > loop) {
 | 
	
		
			
				|  |  |                                  adHocAutoHeightAmt += (me.auto_height_info[segIdx][loop] - 1);
 | 
	
		
			
				|  |  | -                                // recAmtForAdHocAutoHeight++;
 | 
	
		
			
				|  |  |                              } else {
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  |                              }
 | 
	
	
		
			
				|  | @@ -504,13 +501,13 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      if ((ttlSegRecAmtNormal < ttlSegRecAmt) || (followTabEx !== null)) {
 | 
	
		
			
				|  |  |                          //有流水拓展,并且是follow mode
 | 
	
		
			
				|  |  | -                        if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec > ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  | -                            if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight >= ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  | +                        if (currentRecAmt + adHocAutoHeightAmt + maxRowRec > ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  | +                            if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  |                                  //纯 followTabEx 数据
 | 
	
		
			
				|  |  | -                                if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec >= ttlSegRecAmt) {
 | 
	
		
			
				|  |  | +                                if (currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
 | 
	
		
			
				|  |  |                                      pageStatus[JV.STATUS_SEGMENT_END] = true;
 | 
	
		
			
				|  |  |                                      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) {
 | 
	
		
			
				|  |  |                                          //add page info(pre segment end)
 | 
	
		
			
				|  |  |                                          pageStatus[JV.STATUS_SEGMENT_END] = false;
 | 
	
	
		
			
				|  | @@ -524,10 +521,10 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                              } else {
 | 
	
		
			
				|  |  |                                  //混合数据
 | 
	
		
			
				|  |  | -                                if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight + maxRowRec >= ttlSegRecAmt) {
 | 
	
		
			
				|  |  | +                                if (currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
 | 
	
		
			
				|  |  |                                      pageStatus[JV.STATUS_SEGMENT_END] = true;
 | 
	
		
			
				|  |  |                                      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) {
 | 
	
		
			
				|  |  |                                          //add page info(pre segment end)
 | 
	
		
			
				|  |  |                                          pageStatus[JV.STATUS_SEGMENT_END] = false;
 | 
	
	
		
			
				|  | @@ -535,7 +532,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      //add page info
 | 
	
		
			
				|  |  |                                      pageStatus[JV.STATUS_SEGMENT_END] = true;
 | 
	
		
			
				|  |  | -                                    if (currentRecAmt + adHocAutoHeightAmt + recAmtForAdHocAutoHeight >= ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  | +                                    if (currentRecAmt + adHocAutoHeightAmt >= ttlSegRecAmtNormal) {
 | 
	
		
			
				|  |  |                                          //纯 followTabEx 数据啦
 | 
	
		
			
				|  |  |                                          private_addPage(segIdx, null, true, false, -1);
 | 
	
		
			
				|  |  |                                      } else {
 | 
	
	
		
			
				|  | @@ -551,14 +548,15 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      } 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页及以上,在此极端情况下,必须做一些限制判断,否则会出现缺页情况。
 | 
	
		
			
				|  |  |                              pageStatus[JV.STATUS_SEGMENT_END] = true;
 | 
	
		
			
				|  |  |                              pageStatus[JV.STATUS_REPORT_END] = true;
 | 
	
		
			
				|  |  |                              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) {
 | 
	
		
			
				|  |  |                                  //add page info(pre segment end)
 | 
	
		
			
				|  |  |                                  pageStatus[JV.STATUS_SEGMENT_END] = false;
 | 
	
	
		
			
				|  | @@ -588,7 +586,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            console.log(me.auto_height_info);
 | 
	
		
			
				|  |  | +            // console.log(me.auto_height_info);
 | 
	
		
			
				|  |  |              // console.log(me.dispValueIdxLst);
 | 
	
		
			
				|  |  |              rst = Math.ceil(pageIdx / me.multiCols);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -757,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++) {
 | 
	
		
			
				|  |  |                              if (contentValuesIdx[rowIdx][3] === 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);
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
	
		
			
				|  | @@ -884,7 +882,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |              let curSegGrpSum = me.group_sum_values[segIdx];
 | 
	
		
			
				|  |  |              for (let sumFieldNode of grp_line[JV.PROP_GROUP_SUM_KEYS]) {
 | 
	
		
			
				|  |  |                  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);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 |