Procházet zdrojové kódy

feat: GLY-3736 后台调整

Tony Kang před 1 týdnem
rodič
revize
5e410493ff

+ 5 - 0
modules/reports/rpt_component/helper/jpc_helper_common_output.js

@@ -31,6 +31,11 @@ let JpcCommonOutputHelper = {
         rst[JV.PROP_FONT] = node[[JV.PROP_FONT]];
         rst[JV.PROP_CONTROL] = node[[JV.PROP_CONTROL]];
         rst[JV.PROP_STYLE] = node[[JV.PROP_STYLE]];
+        if (node.diagonal_down === 'T') {
+            rst.diagonal_down = true;
+        } else if (node.diagonal_up === 'T') {
+            rst.diagonal_up = true;
+        }
         //2. value
         rst[JV.PROP_VALUE] = value;
         JpcFieldHelper.decorateValue(rst, controls);

+ 21 - 0
web/maintain/report/js/jpc_output.js

@@ -313,6 +313,24 @@ let JpcCanvasOutput = {
             }
             return rst;
         }
+        function privateDrawDiagonal(cell) {
+            if (cell.diagonal_down) {
+                ctx.beginPath();
+                ctx.moveTo(cell.area.Left + JpcCanvasOutput.offsetX, cell.area.Top + JpcCanvasOutput.offsetY);
+                ctx.lineWidth = 1;
+                ctx.strokeStyle = 'BLACK';
+                ctx.lineTo(cell.area.Right + JpcCanvasOutput.offsetX, cell.area.Bottom + JpcCanvasOutput.offsetY);
+                ctx.stroke();
+            }
+            if (cell.diagonal_up) {
+                ctx.beginPath();
+                ctx.moveTo(cell.area.Left + JpcCanvasOutput.offsetX, cell.area.Bottom + JpcCanvasOutput.offsetY);
+                ctx.lineWidth = 1;
+                ctx.strokeStyle = 'BLACK';
+                ctx.lineTo(cell.area.Right + JpcCanvasOutput.offsetX, cell.area.Top + JpcCanvasOutput.offsetY);
+                ctx.stroke();
+            }
+        }
         function private_drawCell(cell, fonts, styles, controls, mergedBand) {
             ctx.save();
             ctx.translate(0.5,0.5);
@@ -324,6 +342,9 @@ let JpcCanvasOutput = {
                 private_drawLine(cell, ctx, style, JV.PROP_BOTTOM, [JV.PROP_RIGHT, JV.PROP_BOTTOM],[JV.PROP_LEFT, JV.PROP_BOTTOM], mergedBand, styles, isNeedMergeBand);
                 private_drawLine(cell, ctx, style, JV.PROP_LEFT, [JV.PROP_LEFT, JV.PROP_BOTTOM],[JV.PROP_LEFT, JV.PROP_TOP], mergedBand, styles, isNeedMergeBand);
             }
+            if (cell.diagonal_down || cell.diagonal_up) {
+                privateDrawDiagonal(cell);
+            }
             private_drawCellText(cell, fonts, controls);
             ctx.restore();
         }