|
@@ -1221,102 +1221,6 @@ function mergeProperties(orgObj, newObj) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-async function resetDummySignature(pageData, roleRel) {
|
|
|
- // 备注:计算草图等其他图形需要额外做些处理
|
|
|
- let dummySignIdx = 0;
|
|
|
- const stampPicKeys = [], stampPicFeatures = [];
|
|
|
- const _resetStampArea = function(stampCell, roleRelItem) {
|
|
|
- const ctrl = pageData[JV.NODE_CONTROL_COLLECTION][stampCell[JV.PROP_CONTROL]];
|
|
|
- const rst = { Left: stampCell.area.Left, Right: stampCell.area.Right, Top: stampCell.area.Top, Bottom: stampCell.area.Bottom };
|
|
|
- let pLeft = stampCell.orgArea.Left,
|
|
|
- pTop = stampCell.orgArea.Top;
|
|
|
- let std_stamp_size_width = STD_COMP_STAMP_SIZE_WIDTH, std_stamp_size_height = STD_COMP_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 (rst.Left < maxRect[0]) {
|
|
|
- // const width = maxRect[0] - rst.Left;
|
|
|
- // rst.Left += width;
|
|
|
- // rst.Right += width;
|
|
|
- // }
|
|
|
- // if (rst.Top < maxRect[1]) {
|
|
|
- // const height = maxRect[1] - rst.Top;
|
|
|
- // rst.Top += height;
|
|
|
- // rst.Bottom += height;
|
|
|
- // }
|
|
|
- // if (rst.Right > maxRect[2]) {
|
|
|
- // const width = maxRect[2] - rst.Right; // 负
|
|
|
- // rst.Left += width;
|
|
|
- // rst.Right += width;
|
|
|
- // }
|
|
|
- // if (rst.Bottom > maxRect[3]) {
|
|
|
- // const height = maxRect[3] - rst.Bottom;
|
|
|
- // rst.Top += height;
|
|
|
- // rst.Bottom += height;
|
|
|
- // }
|
|
|
- return rst;
|
|
|
- };
|
|
|
- for (let pageIdx = 0; pageIdx < pageData.items.length; pageIdx++) {
|
|
|
- const page = pageData.items[pageIdx];
|
|
|
- if (page[JV.PROP_SIGNATURE_CELLS] && page[JV.PROP_SIGNATURE_CELLS].length > 0) {
|
|
|
- for (const signatureCell of page[JV.PROP_SIGNATURE_CELLS]) {
|
|
|
- if (signatureCell.signature_name.indexOf(JV.SIGNATURE_NAME_DUMMY) >= 0) {
|
|
|
- // 表示这是一个其他类型的非原生电子签名图,只是借用signature的处理机制,每个图都是唯一的,所以需要重新给个唯一的新signature_name
|
|
|
- // signatureCell.signature_name = signatureCell.signature_name + '_' + pageIdx + '_' + dummySignIdx;
|
|
|
- signatureCell.signature_name = signatureCell.signature_name + '_' + page.page_seq + '_' + dummySignIdx; // page_seq在分页后都不会变动
|
|
|
- dummySignIdx++;
|
|
|
- const roleRelItem = { type: '用户', sign_path: signatureCell.path, signature_name: signatureCell.signature_name };
|
|
|
- if (signatureCell.isStamp) {
|
|
|
- let stmpIdx = stampPicKeys.indexOf(signatureCell.path);
|
|
|
- if (stampPicKeys.indexOf(signatureCell.path) < 0) {
|
|
|
- stampPicKeys.push(signatureCell.path);
|
|
|
- stmpIdx = stampPicKeys.length - 1;
|
|
|
- const picRes = await getHttpBlobText(signatureCell.path + '?x-oss-process=image/info');
|
|
|
- stampPicFeatures.push(picRes);
|
|
|
- }
|
|
|
- // { "FileSize": {"value": "2514"}, "Format": {"value": "png"}, "ImageHeight": {"value": "94"}, "ImageWidth": {"value": "94"} }
|
|
|
- roleRelItem.stampFeature = stampPicFeatures[stmpIdx];
|
|
|
- // 重新处理cell坐标
|
|
|
- _resetStampArea(signatureCell, roleRelItem);
|
|
|
- }
|
|
|
- roleRel.push(roleRelItem);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
function _createDummyCell(dummyOrgCells, parentPage) {
|
|
|
for (const signature of dummyOrgCells) {
|
|
|
if (!signature.isStamp) {
|
|
@@ -1687,6 +1591,14 @@ const excelExportUtil = {
|
|
|
}
|
|
|
cell[JV.PROP_AREA][JV.PROP_BOTTOM] += offsetY;
|
|
|
cell[JV.PROP_AREA][JV.PROP_TOP] += offsetY;
|
|
|
+ if (cell.orgArea) {
|
|
|
+ cell.orgArea[JV.PROP_BOTTOM] += offsetY;
|
|
|
+ cell.orgArea[JV.PROP_TOP] += offsetY;
|
|
|
+ }
|
|
|
+ if (cell.maxRect) {
|
|
|
+ cell.maxRect[JV.IDX_TOP] += offsetY;
|
|
|
+ cell.maxRect[JV.IDX_BOTTOM] += offsetY;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|