瀏覽代碼

限制签章最大+签名交互处理

Tony Kang 3 年之前
父節點
當前提交
96efc0a970
共有 2 個文件被更改,包括 65 次插入56 次删除
  1. 5 1
      app/public/report/js/jpc_output.js
  2. 60 55
      app/public/report/js/rpt_signature.js

+ 5 - 1
app/public/report/js/jpc_output.js

@@ -445,7 +445,11 @@ let JpcCanvasOutput = {
                 };
                 };
             } else if (cell.path) {
             } else if (cell.path) {
                 const img = new Image();
                 const img = new Image();
-                img.src = cell.path;
+                if (cell.path.indexOf(OSS_PATH) < 0) {
+                    img.src = OSS_PATH + cell.path;
+                } else {
+                    img.src = cell.path;
+                }
                 img.crossOrigin = 'anonymous';
                 img.crossOrigin = 'anonymous';
                 img.onload = function() {
                 img.onload = function() {
                     private_drawImage(cell, control, img, (!!cell.isStamp));
                     private_drawImage(cell, control, img, (!!cell.isStamp));

+ 60 - 55
app/public/report/js/rpt_signature.js

@@ -553,7 +553,7 @@ let rptSignatureHelper = {
                     rptSignatureHelper.originalRoleRelList = me._parseRoleRelList(result.signatureRelInfo[0].rel_content);
                     rptSignatureHelper.originalRoleRelList = me._parseRoleRelList(result.signatureRelInfo[0].rel_content);
                     if (current_stage_status === 3) {
                     if (current_stage_status === 3) {
                         rptSignatureHelper.mergeSignDate(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, true);
                         rptSignatureHelper.mergeSignDate(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, true);
-                        rptSignatureHelper.mergeSignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST);
+                        rptSignatureHelper.mergeSignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, true);
                         await rptSignatureHelper.resetDummySignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
                         await rptSignatureHelper.resetDummySignature(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST); // 这里重新整理签章坐标信息(因签章大小在后台暂时获取不到,挪到前端处理)
                         rptSignatureHelper.mergeSignAudit(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, STAGE_AUDIT);
                         rptSignatureHelper.mergeSignAudit(zTreeOprObj.currentRptPageRst, ROLE_REL_LIST, STAGE_AUDIT);
                         zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
                         zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
@@ -675,6 +675,7 @@ let rptSignatureHelper = {
                             }
                             }
                             sCell.path = null;
                             sCell.path = null;
                             sCell.pre_path = null;
                             sCell.pre_path = null;
+                            sCell.pic = null;
                             for (const signType of role_rel.sign_output) {
                             for (const signType of role_rel.sign_output) {
                                 switch (signType) {
                                 switch (signType) {
                                     case NORMAL_SIGN_STR:
                                     case NORMAL_SIGN_STR:
@@ -1070,60 +1071,64 @@ function resetTextSignature(pageData) {
 function _resetStampArea(ctrl, stampCell, roleRelItem) {
 function _resetStampArea(ctrl, stampCell, roleRelItem) {
     let pLeft = stampCell.orgArea.Left,
     let pLeft = stampCell.orgArea.Left,
         pTop = stampCell.orgArea.Top;
         pTop = stampCell.orgArea.Top;
-    let std_stamp_size_width = STD_STAMP_SIZE_WIDTH, std_stamp_size_height = STD_STAMP_SIZE_HEIGHT;
-    if (roleRelItem.stampFeature) {
-        std_stamp_size_width = parseFloat(roleRelItem.stampFeature.ImageWidth.value);
-        std_stamp_size_height = parseFloat(roleRelItem.stampFeature.ImageHeight.value);
-    }
-    switch (ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]]) {
-        case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_LEFT]:
-            pLeft = stampCell.orgArea.Left;
-            break;
-        case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_CENTER]:
-            pLeft = (stampCell.orgArea.Left + stampCell.orgArea.Right - std_stamp_size_width) / 2;
-            break;
-        case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_RIGHT]:
-            pLeft = stampCell.orgArea.Right - std_stamp_size_width;
-            break;
-        default:break;
-    }
-    switch (ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]]) {
-        case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_TOP]:
-            pTop = stampCell.orgArea.Top;
-            break;
-        case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_CENTER]:
-            pTop = (stampCell.orgArea.Top + stampCell.orgArea.Bottom - std_stamp_size_height) / 2;
-            break;
-        case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_BOTTOM]:
-            pTop = stampCell.orgArea.Bottom - std_stamp_size_height;
-            break;
-        default:break;
-    }
-    stampCell.area.Left = pLeft;
-    stampCell.area.Top = pTop;
-    stampCell.area.Right = pLeft + std_stamp_size_width;
-    stampCell.area.Bottom = pTop + std_stamp_size_height;
-    // 最后一步,如超过报表范围,则要调整坐标
-    const maxRect = stampCell.maxRect;
-    if (stampCell.area.Left < maxRect[0]) {
-        const width = maxRect[0] - stampCell.area.Left;
-        stampCell.area.Left += width;
-        stampCell.area.Right += width;
-    }
-    if (stampCell.area.Top < maxRect[1]) {
-        const height = maxRect[1] - stampCell.area.Top;
-        stampCell.area.Top += height;
-        stampCell.area.Bottom += height;
-    }
-    if (stampCell.area.Right > maxRect[2]) {
-        const width = maxRect[2] - stampCell.area.Right; // 负
-        stampCell.area.Left += width;
-        stampCell.area.Right += width;
-    }
-    if (stampCell.area.Bottom > maxRect[3]) {
-        const height = maxRect[3] - stampCell.area.Bottom;
-        stampCell.area.Top += height;
-        stampCell.area.Bottom += height;
+    if (roleRelItem.stampFeature !== 'not found!') {
+        let std_stamp_size_width = STD_STAMP_SIZE_WIDTH, std_stamp_size_height = STD_STAMP_SIZE_HEIGHT;
+        if (roleRelItem.stampFeature) {
+            std_stamp_size_width = parseFloat(roleRelItem.stampFeature.ImageWidth.value);
+            std_stamp_size_height = parseFloat(roleRelItem.stampFeature.ImageHeight.value);
+            std_stamp_size_width = Math.min(std_stamp_size_width, STD_STAMP_SIZE_WIDTH);
+            std_stamp_size_height = Math.min(std_stamp_size_height, STD_STAMP_SIZE_HEIGHT);
+        }
+        switch (ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]]) {
+            case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_LEFT]:
+                pLeft = stampCell.orgArea.Left;
+                break;
+            case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_CENTER]:
+                pLeft = (stampCell.orgArea.Left + stampCell.orgArea.Right - std_stamp_size_width) / 2;
+                break;
+            case JV.OUTPUT_ALIGN.H[JV.H_ALIGN_IDX_RIGHT]:
+                pLeft = stampCell.orgArea.Right - std_stamp_size_width;
+                break;
+            default:break;
+        }
+        switch (ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]]) {
+            case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_TOP]:
+                pTop = stampCell.orgArea.Top;
+                break;
+            case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_CENTER]:
+                pTop = (stampCell.orgArea.Top + stampCell.orgArea.Bottom - std_stamp_size_height) / 2;
+                break;
+            case JV.OUTPUT_ALIGN.H[JV.V_ALIGN_IDX_BOTTOM]:
+                pTop = stampCell.orgArea.Bottom - std_stamp_size_height;
+                break;
+            default:break;
+        }
+        stampCell.area.Left = pLeft;
+        stampCell.area.Top = pTop;
+        stampCell.area.Right = pLeft + std_stamp_size_width;
+        stampCell.area.Bottom = pTop + std_stamp_size_height;
+        // 最后一步,如超过报表范围,则要调整坐标
+        const maxRect = stampCell.maxRect;
+        if (stampCell.area.Left < maxRect[0]) {
+            const width = maxRect[0] - stampCell.area.Left;
+            stampCell.area.Left += width;
+            stampCell.area.Right += width;
+        }
+        if (stampCell.area.Top < maxRect[1]) {
+            const height = maxRect[1] - stampCell.area.Top;
+            stampCell.area.Top += height;
+            stampCell.area.Bottom += height;
+        }
+        if (stampCell.area.Right > maxRect[2]) {
+            const width = maxRect[2] - stampCell.area.Right; // 负
+            stampCell.area.Left += width;
+            stampCell.area.Right += width;
+        }
+        if (stampCell.area.Bottom > maxRect[3]) {
+            const height = maxRect[3] - stampCell.area.Bottom;
+            stampCell.area.Top += height;
+            stampCell.area.Bottom += height;
+        }
     }
     }
 }
 }