Sfoglia il codice sorgente

09-1(带拓展信息)表的一些处理bug

TonyKang 4 anni fa
parent
commit
6484e0ce69

+ 3 - 3
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;

+ 1 - 1
public/web/rpt_value_define.js

@@ -290,7 +290,7 @@ const JV = {
     SIZE_16K: [7.75, 10.75],
     SIZE_EXECUTIVE: [7.25, 10.5],
 
-    OUTPUT_OFFSET: [2,2,1,3],
+    OUTPUT_OFFSET: [1,1,1,1],
     OFFSET_IDX_LEFT: 0,
     OFFSET_IDX_RIGHT: 1,
     OFFSET_IDX_TOP: 2,

+ 8 - 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 = [];
@@ -218,7 +225,7 @@ 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)?1:lines;
                     let actLines = private_splitString(val, validAreaTxtWidth, ctx);
-                    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 {