TonyKang пре 4 година
родитељ
комит
3eac0ff36e

+ 5 - 4
modules/reports/rpt_component/jpc_flow_tab.js

@@ -85,7 +85,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 if (segAutoHeightInfo[segIdx].length > startRecIdx + vi) {
                     couldBreak = private_addAutoHeightPageValue(vi);
                     // if (couldBreak) break;
-                } else if (vIdx.length < maxRecPerPage) {
+                } else if (vIdx.length > 0 && vIdx.length < maxRecPerPage) {
                     vIdx.push([followMode, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
                 }
             } else {
@@ -637,7 +637,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                                 if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
                                     pageStatus[JV.STATUS_SEGMENT_END] = true;
                                     private_resetBandArea();
-                                    let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
+                                    let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
                                     if (hasAdHocRow) {
                                         //add page info(pre segment end)
                                         pageStatus[JV.STATUS_SEGMENT_END] = false;
@@ -655,7 +655,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                                 if (currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt) {
                                     pageStatus[JV.STATUS_SEGMENT_END] = true;
                                     private_resetBandArea();
-                                    let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
+                                    let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt, maxRowRec, me.isEx);
                                     if (hasAdHocRow) {
                                         //add page info(pre segment end)
                                         pageStatus[JV.STATUS_SEGMENT_END] = false;
@@ -668,7 +668,8 @@ JpcFlowTabSrv.prototype.createNew = function(){
                                         //纯 followTabEx 数据啦
                                         private_addPage(segIdx, null, true, false, -1);
                                     } else {
-                                        private_addPage(segIdx, grpSeqInfo, false, true, ttlSegRecAmtNormal);
+                                        let splitPoint = ttlSegRecAmtNormal - handledRowAmt ;
+                                        private_addPage(segIdx, grpSeqInfo, false, true, splitPoint);
                                     }
                                 } else {
                                     //在这里要考虑如果有多页正常的流水数据情况,那么就得考虑这页有多少条普通流水记录,不应该一刀切地用ttlSegRecAmtNormal

+ 9 - 1
web/building_saas/report/js/jpc_output.js

@@ -113,6 +113,13 @@ let JpcCanvasOutput = {
             if (rst.length === 0) rst.push(''); //什么都没有,也得整个空串
             return rst;
         }
+        function _chkIfShinkFirst(control, actLines) {
+            let rst = false;
+            if (control.ShrinkFirst === 'T' && control.Wrap !== 'T' && actLines > 1) {
+                rst = true;
+            }
+            return rst;
+        }
         function private_drawText(val, area, font, control) {
             let dftFontHeight = 12;
             let output = [];
@@ -211,7 +218,8 @@ let JpcCanvasOutput = {
                     let lines = Math.floor((area[JV.IDX_BOTTOM] - area[JV.IDX_TOP]) / (dftFontHeight + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP] + 4));
                     lines = (lines === 0 || (control.Shrink === 'T' && control.ShrinkFirst === 'T'))?1:lines;
                     let actLines = private_splitString(val, validAreaTxtWidth, ctx);
-                    if (actLines.length > lines && dftFontHeight >= 6) {
+                    // if (actLines.length > lines && dftFontHeight >= 6) {
+                    if ((actLines.length > lines || _chkIfShinkFirst(control, actLines.length)) && dftFontHeight >= 6) {
                         dftFontHeight--;
                         ctx.font = "" + dftFontHeight + "px " + font[JV.PROP_NAME];
                     } else {