sales-frontend-bridge 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +0 -946
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -701
- package/dist/index.d.ts +8 -701
- package/dist/index.js +2 -889
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var salesFrontendUtils = require('sales-frontend-utils');
|
|
4
|
-
var react = require('react');
|
|
5
4
|
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
7
6
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -870,951 +869,6 @@ var Bridge = {
|
|
|
870
869
|
iframeCore: new IframeBridgeCore()
|
|
871
870
|
};
|
|
872
871
|
|
|
873
|
-
// src/oz/constant/comment-pen-param.ts
|
|
874
|
-
var commentPenDefaultParam = [
|
|
875
|
-
`comment.selectedpen=highlightpen`,
|
|
876
|
-
`comment.highlightpen_thick=15`
|
|
877
|
-
];
|
|
878
|
-
var commentPenYellow = [...commentPenDefaultParam, `comment.highlightpen_color=ffd900`];
|
|
879
|
-
var commentPenPink = [...commentPenDefaultParam, `comment.highlightpen_color=f48fb1`];
|
|
880
|
-
var commentPenGreen = [...commentPenDefaultParam, `comment.highlightpen_color=81c784`];
|
|
881
|
-
var commentPenEraser = [`comment.selectedpen=eraser`];
|
|
882
|
-
|
|
883
|
-
// src/oz/constant/oz-param.ts
|
|
884
|
-
var informationOzParam = [
|
|
885
|
-
// 뷰어 콘솔 로그 정보의 수준(Level)을 설정합니다. - 뷰어 수행에 필요한 디버깅용 메시지를 자바 콘솔에 출력
|
|
886
|
-
`information.debug = true`
|
|
887
|
-
];
|
|
888
|
-
var globalOzParam = [
|
|
889
|
-
// 다중 보고서 호출 시 부모 보고서의 파라미터 값을 자식 보고서가 상속받을지 여부를 설정합니다.
|
|
890
|
-
`global.inheritparameter=true`,
|
|
891
|
-
// 멀티 보고서를 하나의 보고서처럼 사용할지 여부를 설정합니다.
|
|
892
|
-
`global.concatpage=true`
|
|
893
|
-
// 멀티 보고서를 하나의 보고서처럼 설정한 경우 각각의 보고서별로 페이지 번호를 부여할지 여부를 설정합니다.
|
|
894
|
-
// `global.eachpagenumberatconcatpage=true`,
|
|
895
|
-
];
|
|
896
|
-
var eformOzParam = [
|
|
897
|
-
`eform.signpad_type=embedded`,
|
|
898
|
-
// `eform.signpad_type=keypad`,
|
|
899
|
-
`eform.show_prev_next_input=true`,
|
|
900
|
-
// `eform.signpad_prev_next_iconposition=sign_top_left`,
|
|
901
|
-
`eform.signpad_prev_next_iconposition=sign_top`,
|
|
902
|
-
`eform.signpad_show_draw_erase_button=false`,
|
|
903
|
-
`eform.signpad_viewtype=keepratioandfittoframe`,
|
|
904
|
-
`eform.radiobutton_type=ensurevisible_at_prev_next`,
|
|
905
|
-
`eform.checkbox_type=ensurevisible_at_prev_next`,
|
|
906
|
-
`eform.prev_next_required_rule=required_only`,
|
|
907
|
-
`eform.prev_next_navigation_rule=required_only`,
|
|
908
|
-
`eform.prev_next_constraint_rule=empty_only`,
|
|
909
|
-
`eform.imagepicker_camera_iconposition = camera_top`,
|
|
910
|
-
`eform.inputeventcommand=true`,
|
|
911
|
-
// 서명 입력 중간중간에 onValueChanged가 호출 / 디폴트는 입력끝나고 창이 닫힐때 호출
|
|
912
|
-
`eform.onvaluechanged_callrule_json=${JSON.stringify({ signpad: "changed" })}`,
|
|
913
|
-
`eform.inputcomponent_toolbar_button_json=${JSON.stringify({
|
|
914
|
-
// 서명패드 버튼 배열 수정
|
|
915
|
-
"all": {
|
|
916
|
-
// 왼쪽에 [이전, 창닫기]
|
|
917
|
-
"left_align": "prev,ok",
|
|
918
|
-
// 오른쪽에 [다시쓰기, 성명,서명 불러오기, 다음]
|
|
919
|
-
"right_align": "clear,reusablesign,next"
|
|
920
|
-
}
|
|
921
|
-
})}`,
|
|
922
|
-
`eform.imagepicker_id_info=${JSON.stringify({
|
|
923
|
-
ids: [
|
|
924
|
-
{
|
|
925
|
-
id: "1",
|
|
926
|
-
name: "\uC6B4\uC804\uBA74\uD5C8\uC99D_\uCD5C\uC2E0",
|
|
927
|
-
size: "86x54",
|
|
928
|
-
margin: "3",
|
|
929
|
-
mask: [
|
|
930
|
-
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
931
|
-
{ name: "\uC6B4\uC804\uBA74\uD5C8\uBC88\uD638", area: "0,0,0,0" },
|
|
932
|
-
{ name: "\uBC1C\uAE09\uBC88\uD638", area: "0,0,0,0" },
|
|
933
|
-
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
934
|
-
]
|
|
935
|
-
},
|
|
936
|
-
{
|
|
937
|
-
id: "2",
|
|
938
|
-
name: "\uC6B4\uC804\uBA74\uD5C8\uC99D_\uAD6C\uD615",
|
|
939
|
-
size: "86x54",
|
|
940
|
-
margin: "3",
|
|
941
|
-
mask: [
|
|
942
|
-
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
943
|
-
{ name: "\uC6B4\uC804\uBA74\uD5C8\uBC88\uD638", area: "0,0,0,0" },
|
|
944
|
-
{ name: "\uBC1C\uAE09\uBC88\uD638", area: "0,0,0,0" },
|
|
945
|
-
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
946
|
-
]
|
|
947
|
-
},
|
|
948
|
-
{
|
|
949
|
-
id: "3",
|
|
950
|
-
name: "\uC8FC\uBBFC\uB4F1\uB85D\uC99D",
|
|
951
|
-
size: "86x54",
|
|
952
|
-
margin: "3",
|
|
953
|
-
mask: [
|
|
954
|
-
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
955
|
-
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
956
|
-
]
|
|
957
|
-
},
|
|
958
|
-
{
|
|
959
|
-
id: "4",
|
|
960
|
-
name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uC99D \uC55E\uBA74",
|
|
961
|
-
size: "86x54",
|
|
962
|
-
margin: "3",
|
|
963
|
-
mask: [
|
|
964
|
-
{ name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uBC88\uD6381", area: "0,0,0,0" },
|
|
965
|
-
{ name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uBC88\uD6382", area: "0,0,0,0" },
|
|
966
|
-
{ name: "\uC131\uBA85", area: "0,0,0,0" },
|
|
967
|
-
{ name: "\uC131\uBCC4", area: "0,0,0,0" },
|
|
968
|
-
{ name: "\uAD6D\uAC00\uC9C0\uC5ED", area: "0,0,0,0" },
|
|
969
|
-
{ name: "\uCCB4\uB958\uC790\uACA9", area: "0,0,0,0" },
|
|
970
|
-
{ name: "\uBC1C\uAE09\uC77C\uC790", area: "0,0,0,0" }
|
|
971
|
-
]
|
|
972
|
-
},
|
|
973
|
-
{ id: "5", name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uC99D \uB4B7\uBA74", size: "86x54", margin: "3", mask: [{ name: "\uC678\uAD6D\uC778", area: "0,0,0,0" }] }
|
|
974
|
-
],
|
|
975
|
-
choice: { title: "\uC2E0\uBD84\uC99D\uC744 \uC120\uD0DD\uD558\uC138\uC694.", items: "1,2,3,4,5" }
|
|
976
|
-
})}`
|
|
977
|
-
];
|
|
978
|
-
var viewerOzPram = [
|
|
979
|
-
`viewer.pagenavigate_by_prev_next=true`,
|
|
980
|
-
// `viewer.zoombymouse=false`,
|
|
981
|
-
`viewer.pagedisplay=singlepagecontinuous`,
|
|
982
|
-
`viewer.usetoolbar=false`,
|
|
983
|
-
`viewer.usestatusbar=false`,
|
|
984
|
-
`viewer.useprogressbar=false`,
|
|
985
|
-
`viewer.zoom=137`,
|
|
986
|
-
`viewer.viewmode=fittowidth`,
|
|
987
|
-
`viewer.hidehorizontalscroll=false`,
|
|
988
|
-
`viewer.progresscommand=true`,
|
|
989
|
-
`viewer.pagechangecommand=true`,
|
|
990
|
-
`viewer.exportcommand=true`,
|
|
991
|
-
`viewer.errorcommand=true`,
|
|
992
|
-
`viewer.reportchangecommand=true`,
|
|
993
|
-
`viewer.pagebindcommandinterval=500`
|
|
994
|
-
];
|
|
995
|
-
var ozdOzParam = [
|
|
996
|
-
// connection.args=key=value로 넘기는 정보들은 ozr에서만 유효하나 ozd에서도 유효하도록 허용
|
|
997
|
-
`ozd.allowreplaceformparam=true`
|
|
998
|
-
];
|
|
999
|
-
var commonOzParam = [
|
|
1000
|
-
...informationOzParam,
|
|
1001
|
-
...globalOzParam,
|
|
1002
|
-
...eformOzParam,
|
|
1003
|
-
...viewerOzPram,
|
|
1004
|
-
...ozdOzParam
|
|
1005
|
-
];
|
|
1006
|
-
|
|
1007
|
-
// src/oz/constant/pdf-param.ts
|
|
1008
|
-
var commonPdfExportParam = [
|
|
1009
|
-
// `pdf.filename=${"test.pdf"}`,
|
|
1010
|
-
// `export.pages=${i.startPage}-${i.endPage}`,
|
|
1011
|
-
// "pdf.userpassword=$pdfPassword",G
|
|
1012
|
-
"export.pagerange=range",
|
|
1013
|
-
"export.confirmsave=false",
|
|
1014
|
-
"export.mode=silent",
|
|
1015
|
-
// pdf에 폰트를 포함시킨다
|
|
1016
|
-
`pdf.fontembedding=true`,
|
|
1017
|
-
// 폰트를 포함시킬때 사용하는 글자만 포함시킨다
|
|
1018
|
-
`pdf.fontembedding_subset=true`
|
|
1019
|
-
];
|
|
1020
|
-
|
|
1021
|
-
// src/oz/constant/test-data.ts
|
|
1022
|
-
var wrapperStyle = { display: "flex", flexFlow: "column", gap: "10px" };
|
|
1023
|
-
var btnStyle = { border: "1px solid red", minHeight: "40px" };
|
|
1024
|
-
var DownloadDocumentList = [
|
|
1025
|
-
{ name: "[A0010]\uCCAD\uC57D\uC11C", doc: [{ docCode: "A0010", fileID: "548PJrCOTEbtSKkAA", imageFormatCode: "RT003000", imageDocumentTypeCode: "IT00", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1026
|
-
{ name: "[A0100]\uBE44\uAD50\uC548\uB0B4\uD655\uC778\uC11C", doc: [{ docCode: "A0100", fileID: "ADXS1CCOTEgGVKkAA", imageFormatCode: "RT003001", imageDocumentTypeCode: "IT01", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1027
|
-
{ name: "[A0900]\uC0C1\uD488\uC124\uBA85\uC11C", doc: [{ docCode: "A0900", fileID: "q7jjxECOTErDoKkAA", imageFormatCode: "RT003002", imageDocumentTypeCode: "IT02", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1028
|
-
{ name: "[A1500]\uCCAD\uC57D\uBD80\uC18D\uC815\uBCF4\uD655\uC778\uC11C", doc: [{ docCode: "A1500", fileID: "PHYuIXCOTEvSIKkAA", imageFormatCode: "RT003003", imageDocumentTypeCode: "IT03", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1029
|
-
{ name: "[A2215]\uBCF4\uD5D8\uACC4\uC57D\uB300\uCD9C\uC774\uD589\uAD00\uB9AC\uB3D9\uC758\uC11C", doc: [{ docCode: "A2215", fileID: "aCLb5eCOTEyqjKkAA", imageFormatCode: "RT003004", imageDocumentTypeCode: "IT04", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1030
|
-
{ name: "[A2800]\uACC4\uC57D\uC804\uC54C\uB9B4\uC758\uBB34", doc: [{ docCode: "A2800", fileID: "Je6ZAtCOTE4rTKkAA", imageFormatCode: "RT003005", imageDocumentTypeCode: "IT05", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1031
|
-
{ name: "[A3503]\uCCAD\uC57D\uC11C\uBCC4\uC9C0(\uBCC0\uC561\uC6A9)", doc: [{ docCode: "A3503", fileID: "ApnNTbCOTE8CjKkAA", imageFormatCode: "RT003006", imageDocumentTypeCode: "IT06", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1032
|
-
{ name: "[B0101]\uBCF4\uD5D8\uACC4\uC57D\uCCB4\uACB0\uB3D9\uC758\uC11C", doc: [{ docCode: "B0101", fileID: "756qLXCOTFDYFKkAA", imageFormatCode: "RT003007", imageDocumentTypeCode: "IT07", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1033
|
-
{ name: "[C0400]\uACC4\uC57D\uCCB4\uACB0\uC774\uD589\uB3D9\uC758\uC11C", doc: [{ docCode: "C0400", fileID: "Bg0c0HCOTFHF7KkAA", imageFormatCode: "RT003008", imageDocumentTypeCode: "IT08", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1034
|
-
{ name: "[C0401]\uC0C1\uD488\uC18C\uAC1C\uC0C1\uC138\uB3D9\uC758\uC11C", doc: [{ docCode: "C0401", fileID: "yDoJLMCOTFKKpKkAA", imageFormatCode: "RT003009", imageDocumentTypeCode: "IT09", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1035
|
-
{ name: "[C1000]\uBCF4\uD5D8\uC0C1\uD488\uD310\uB9E4\uCCB4\uD06C\uB9AC\uC2A4\uD2B8", doc: [{ docCode: "C1000", fileID: "FtAEqcCOTFOOsKkAA", imageFormatCode: "RT003010", imageDocumentTypeCode: "IT10", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1036
|
-
{ name: "[C1300]\uACC4\uC57D\uCCB4\uACB0\uACE0\uC9C0\uC758\uBB34\uD655\uC778\uC11C", doc: [{ docCode: "C1300", fileID: "TAHeCCCOTFRqrKkAA", imageFormatCode: "RT003011", imageDocumentTypeCode: "IT11", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false },
|
|
1037
|
-
{ name: "[C1400]\uBCF4\uD5D8\uC0C1\uD488\uBE44\uAD50\uC124\uBA85\uD655\uC778\uC11C", doc: [{ docCode: "C1400", fileID: "3nLROXCOTFU1QKkAA", imageFormatCode: "RT003012", imageDocumentTypeCode: "IT12", filePath: "", startPage: 0, endPage: 0 }], complete: false, startPage: 0, endPage: 0, focus: false }
|
|
1038
|
-
];
|
|
1039
|
-
var ExtraData = {
|
|
1040
|
-
// 문서코드
|
|
1041
|
-
A0010: {
|
|
1042
|
-
// connection.inputjson으로 바인딩할 데이터
|
|
1043
|
-
inputJson: {
|
|
1044
|
-
// 계약자 성명 사인정보
|
|
1045
|
-
A0010_mynm_sg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAABDUlEQVR4nOzSMQ0CQBQEUSAnAAU0iEAAPWKQgQU04gED10z1IXlPwWay6/78HH7P+3qZnrBxmh7wT8QKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECsQKxArECtZjvaY3bNzOx+kJG54ViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgVfAMAAP//tD4Eb/yjIncAAAAASUVORK5CYII=",
|
|
1046
|
-
// 계약자 서명 사인정보
|
|
1047
|
-
A0010_mysg_sign: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAABDElEQVR4nOzSsQkCYRgEUZXDVgTtxdDIYgR7sFkTG/iTiT4P3qtgGXa7vp+H//M5PqYnLJymB+yJWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgVjBdj9fpjcsvG7f6QkLnhWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBWIFYgViBX8AgAA//9+7gTkg4AcBQAAAABJRU5ErkJggg=="
|
|
1048
|
-
},
|
|
1049
|
-
// 기타 공통으로 사용하지 않을 파라미터
|
|
1050
|
-
extraParam: [],
|
|
1051
|
-
// aaa=bbb
|
|
1052
|
-
args: []
|
|
1053
|
-
},
|
|
1054
|
-
A0900: {
|
|
1055
|
-
args: []
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
var policyNumber = "300034894";
|
|
1059
|
-
var fpInfo = { uniqNo: "2210000" };
|
|
1060
|
-
var roleCode = [`11`, `28`];
|
|
1061
|
-
var xdudheaders = `Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJXNWRtc1g1MkVWZGV0YThJRy90YmlZY281bnVCdzRZOXhGZjlWakZzdWxnbU00YnkiLCJpYXQiOjE3NjEwNDMyNjgsImV4cCI6MTc2NjI5OTI2OH0.KDnF7ZhkmnEApGCvOcItwcHnLWe5iJu64g93GACT2yo`;
|
|
1062
|
-
function useDocumentInfo(initialValue) {
|
|
1063
|
-
const documentInfo = initialValue;
|
|
1064
|
-
const documentList = react.useMemo(() => documentInfo.map((i) => i.doc).flat(1), [documentInfo]);
|
|
1065
|
-
const documentIndexMap = documentList.reduce((acc, cur, index) => {
|
|
1066
|
-
acc[cur.docCode] = index;
|
|
1067
|
-
return acc;
|
|
1068
|
-
}, {});
|
|
1069
|
-
const documentTemplateMap = react.useMemo(() => documentInfo.reduce((map, template) => {
|
|
1070
|
-
template.doc.forEach((ozdFile) => {
|
|
1071
|
-
map[ozdFile.docCode] = { ...template };
|
|
1072
|
-
});
|
|
1073
|
-
return map;
|
|
1074
|
-
}, {}), [documentInfo]);
|
|
1075
|
-
const nameTemplateMap = documentInfo.reduce((acc, doc) => {
|
|
1076
|
-
acc[doc.name] = doc;
|
|
1077
|
-
return acc;
|
|
1078
|
-
}, {});
|
|
1079
|
-
const groupIndexes = react.useMemo(() => documentInfo.reduce((acc, item) => {
|
|
1080
|
-
item.doc.forEach((ozdFile) => {
|
|
1081
|
-
const currentIndex = documentIndexMap[ozdFile.docCode];
|
|
1082
|
-
if (!acc[currentIndex]) {
|
|
1083
|
-
acc[currentIndex] = [];
|
|
1084
|
-
}
|
|
1085
|
-
item.doc.forEach((ozdFile2) => {
|
|
1086
|
-
acc[currentIndex].push(documentIndexMap[ozdFile2.docCode]);
|
|
1087
|
-
});
|
|
1088
|
-
});
|
|
1089
|
-
return acc;
|
|
1090
|
-
}, []), [documentIndexMap, documentInfo]);
|
|
1091
|
-
const isAllComplete = react.useMemo(() => documentInfo.every((i) => i.complete), [documentInfo]);
|
|
1092
|
-
return {
|
|
1093
|
-
documentList,
|
|
1094
|
-
documentTemplateMap,
|
|
1095
|
-
documentIndexMap,
|
|
1096
|
-
nameTemplateMap,
|
|
1097
|
-
groupIndexes,
|
|
1098
|
-
isAllComplete
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
function useOzEventListener({ event, handler }) {
|
|
1102
|
-
const handleEvent = react.useCallback(
|
|
1103
|
-
async (e) => {
|
|
1104
|
-
const customEvent = e;
|
|
1105
|
-
return await handler(customEvent);
|
|
1106
|
-
},
|
|
1107
|
-
[handler]
|
|
1108
|
-
);
|
|
1109
|
-
react.useEffect(() => {
|
|
1110
|
-
window.addEventListener(event, handleEvent);
|
|
1111
|
-
return () => {
|
|
1112
|
-
window.removeEventListener(event, handleEvent);
|
|
1113
|
-
};
|
|
1114
|
-
}, [handleEvent, event]);
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
// src/oz/types/oz-event.types.ts
|
|
1118
|
-
var OZViewerEvent = /* @__PURE__ */ ((OZViewerEvent2) => {
|
|
1119
|
-
OZViewerEvent2["OZProgressCommand"] = "OZProgressCommand";
|
|
1120
|
-
OZViewerEvent2["OZErrorCommand"] = "OZErrorCommand";
|
|
1121
|
-
OZViewerEvent2["OZPageChangeCommand"] = "OZPageChangeCommand";
|
|
1122
|
-
OZViewerEvent2["OZReportChangeCommand"] = "OZReportChangeCommand";
|
|
1123
|
-
OZViewerEvent2["OZUserEvent"] = "OZUserEvent";
|
|
1124
|
-
OZViewerEvent2["OZPageBindCommand"] = "OZPageBindCommand";
|
|
1125
|
-
OZViewerEvent2["OZEFormInputEventCommand"] = "OZEFormInputEventCommand";
|
|
1126
|
-
OZViewerEvent2["OZExportCommand"] = "OZExportCommand";
|
|
1127
|
-
OZViewerEvent2["OZBtnTouchEvent"] = "btnTouchEvent";
|
|
1128
|
-
OZViewerEvent2["OZReportCreated"] = "OZReportCreated";
|
|
1129
|
-
return OZViewerEvent2;
|
|
1130
|
-
})(OZViewerEvent || {});
|
|
1131
|
-
var OZTriggerExternalEvent = /* @__PURE__ */ ((OZTriggerExternalEvent2) => {
|
|
1132
|
-
OZTriggerExternalEvent2["GetDraftData"] = "getDraftData";
|
|
1133
|
-
OZTriggerExternalEvent2["CropImage"] = "cropimage";
|
|
1134
|
-
return OZTriggerExternalEvent2;
|
|
1135
|
-
})(OZTriggerExternalEvent || {});
|
|
1136
|
-
|
|
1137
|
-
// src/oz/utils/common-util.ts
|
|
1138
|
-
function categorizeByPageRange(data, pageCounts) {
|
|
1139
|
-
let currentPage = 1;
|
|
1140
|
-
let pageIndex = 0;
|
|
1141
|
-
const result = DeepCopy(data);
|
|
1142
|
-
result.forEach((group) => {
|
|
1143
|
-
group.startPage = currentPage;
|
|
1144
|
-
group.doc.forEach((doc) => {
|
|
1145
|
-
const pageCount = pageCounts[pageIndex++];
|
|
1146
|
-
doc.startPage = currentPage;
|
|
1147
|
-
doc.endPage = currentPage + pageCount - 1;
|
|
1148
|
-
currentPage += pageCount;
|
|
1149
|
-
});
|
|
1150
|
-
group.endPage = group.doc[group.doc.length - 1].endPage;
|
|
1151
|
-
});
|
|
1152
|
-
return result;
|
|
1153
|
-
}
|
|
1154
|
-
function extractFileName(filePath) {
|
|
1155
|
-
if (!filePath || typeof filePath !== "string") {
|
|
1156
|
-
throw new Error("\uC720\uD6A8\uD55C \uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.");
|
|
1157
|
-
}
|
|
1158
|
-
const fileName = filePath.replace(/^.*\/|(\.[^/.]+)$/g, "");
|
|
1159
|
-
if (!fileName) {
|
|
1160
|
-
throw new Error("\uD30C\uC77C \uACBD\uB85C\uC5D0\uC11C \uD30C\uC77C \uC774\uB984\uC744 \uCD94\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1161
|
-
}
|
|
1162
|
-
return fileName;
|
|
1163
|
-
}
|
|
1164
|
-
function getFileListByGlobalIndex(index, data) {
|
|
1165
|
-
let currentIndex = 0;
|
|
1166
|
-
for (const template of data) {
|
|
1167
|
-
const fileCount = template.doc.length;
|
|
1168
|
-
if (index >= currentIndex && index < currentIndex + fileCount) {
|
|
1169
|
-
return template;
|
|
1170
|
-
}
|
|
1171
|
-
currentIndex += fileCount;
|
|
1172
|
-
}
|
|
1173
|
-
return null;
|
|
1174
|
-
}
|
|
1175
|
-
async function sleep(ms = 10) {
|
|
1176
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1177
|
-
}
|
|
1178
|
-
function PromiseWithResolvers() {
|
|
1179
|
-
let resolve;
|
|
1180
|
-
let reject;
|
|
1181
|
-
const promise = new Promise((res, rej) => {
|
|
1182
|
-
resolve = res;
|
|
1183
|
-
reject = rej;
|
|
1184
|
-
});
|
|
1185
|
-
return { promise, resolve, reject };
|
|
1186
|
-
}
|
|
1187
|
-
function ensureArray(arg) {
|
|
1188
|
-
return Array.isArray(arg) ? DeepCopy(arg) : [];
|
|
1189
|
-
}
|
|
1190
|
-
function DeepCopy(arg) {
|
|
1191
|
-
return JSON.parse(JSON.stringify(arg));
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
// src/oz/utils/bridge-util/alert-util.ts
|
|
1195
|
-
async function AlertTemporaryError() {
|
|
1196
|
-
return await Bridge.nativeOz.showAlert({
|
|
1197
|
-
title: "\uC77C\uC2DC\uC801\uC778 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4",
|
|
1198
|
-
message: "\uBB38\uC81C\uAC00 \uC9C0\uC18D\uB420 \uACBD\uC6B0 IT\uCF5C\uC13C\uD130(1522-6379)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694.",
|
|
1199
|
-
buttons: { close: false, main: "\uD655\uC778" }
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
async function AlertDocumentLoadError() {
|
|
1203
|
-
return await Bridge.nativeOz.showAlert({
|
|
1204
|
-
title: "\uCCAD\uC57D\uBB38\uC11C\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",
|
|
1205
|
-
message: "\uBB38\uC81C\uAC00 \uC9C0\uC18D\uB420 \uACBD\uC6B0 IT\uCF5C\uC13C\uD130(1522-6379)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694.",
|
|
1206
|
-
buttons: { close: false, main: "\uD655\uC778" }
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
// src/oz/utils/bridge-util/oz-wrapper-util.ts
|
|
1211
|
-
async function CreateOzViewer(ozParam) {
|
|
1212
|
-
const { promise, resolve, reject } = PromiseWithResolvers();
|
|
1213
|
-
const handleTimeout = () => {
|
|
1214
|
-
window.removeEventListener("OZReportCreated" /* OZReportCreated */, handleOZCreated);
|
|
1215
|
-
reject(new Error("createOZViewer TimeOut"));
|
|
1216
|
-
};
|
|
1217
|
-
const timeout = setTimeout(handleTimeout, 1e3 * 60 * 3);
|
|
1218
|
-
const handleOZCreated = (e) => {
|
|
1219
|
-
clearTimeout(timeout);
|
|
1220
|
-
resolve(e);
|
|
1221
|
-
};
|
|
1222
|
-
window.addEventListener(
|
|
1223
|
-
"OZReportCreated" /* OZReportCreated */,
|
|
1224
|
-
// OZReportCreated가 트리거되면 promise resolve 처리
|
|
1225
|
-
handleOZCreated,
|
|
1226
|
-
// 이벤트 리스너는 한 번만 실행되도록 설정
|
|
1227
|
-
{ once: true }
|
|
1228
|
-
);
|
|
1229
|
-
try {
|
|
1230
|
-
await Bridge.native.createOZViewer({ param: ozParam.join("\n") });
|
|
1231
|
-
return await promise;
|
|
1232
|
-
} catch (e) {
|
|
1233
|
-
clearTimeout(timeout);
|
|
1234
|
-
await AlertTemporaryError();
|
|
1235
|
-
await Bridge.native.hideOZViewer();
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
async function MovePage(page) {
|
|
1239
|
-
return await Bridge.nativeOz.script({ command: `movepage=${page}` });
|
|
1240
|
-
}
|
|
1241
|
-
async function getCurrentPage() {
|
|
1242
|
-
const { data } = await Bridge.nativeOz.getInformation({ command: `CURRENT_PAGE` });
|
|
1243
|
-
if (data === null) {
|
|
1244
|
-
throw new Error(`Bridge returned null for command: CURRENT_PAGE`);
|
|
1245
|
-
}
|
|
1246
|
-
return Number(data);
|
|
1247
|
-
}
|
|
1248
|
-
var getTotalPageMemo = (() => {
|
|
1249
|
-
let cache = null;
|
|
1250
|
-
async function getTotalPage() {
|
|
1251
|
-
if (cache) {
|
|
1252
|
-
return cache;
|
|
1253
|
-
}
|
|
1254
|
-
cache = (async () => {
|
|
1255
|
-
try {
|
|
1256
|
-
const { data } = await Bridge.nativeOz.getInformation({ command: "TOTAL_PAGE" });
|
|
1257
|
-
return Number(data);
|
|
1258
|
-
} catch (e) {
|
|
1259
|
-
cache = null;
|
|
1260
|
-
throw e;
|
|
1261
|
-
}
|
|
1262
|
-
})();
|
|
1263
|
-
return await cache;
|
|
1264
|
-
}
|
|
1265
|
-
getTotalPage.clearCache = () => {
|
|
1266
|
-
cache = null;
|
|
1267
|
-
};
|
|
1268
|
-
return getTotalPage;
|
|
1269
|
-
})();
|
|
1270
|
-
var getReportCountMemo = (() => {
|
|
1271
|
-
let cache = null;
|
|
1272
|
-
async function getReportCount() {
|
|
1273
|
-
if (cache) {
|
|
1274
|
-
return await cache;
|
|
1275
|
-
}
|
|
1276
|
-
cache = (async () => {
|
|
1277
|
-
try {
|
|
1278
|
-
const { data } = await Bridge.nativeOz.getInformation({ command: "REPORT_COUNT" });
|
|
1279
|
-
if (data === null) {
|
|
1280
|
-
throw new Error(`Bridge returned null for command: REPORT_COUNT`);
|
|
1281
|
-
}
|
|
1282
|
-
return Number(data);
|
|
1283
|
-
} catch (e) {
|
|
1284
|
-
cache = null;
|
|
1285
|
-
throw e;
|
|
1286
|
-
}
|
|
1287
|
-
})();
|
|
1288
|
-
return await cache;
|
|
1289
|
-
}
|
|
1290
|
-
getReportCount.clearCache = () => {
|
|
1291
|
-
cache = null;
|
|
1292
|
-
};
|
|
1293
|
-
return getReportCount;
|
|
1294
|
-
})();
|
|
1295
|
-
|
|
1296
|
-
// src/oz/utils/bridge-util/btn-touch-event-util/category-handler.ts
|
|
1297
|
-
async function CategoryHandler(documentInfo, { type, btnID }) {
|
|
1298
|
-
if (type !== "category") {
|
|
1299
|
-
throw `Unexpected Type ${type}`;
|
|
1300
|
-
}
|
|
1301
|
-
const target = documentInfo.find((i) => i.name === btnID);
|
|
1302
|
-
if (!target) {
|
|
1303
|
-
throw `Unexpected btnID ${target}`;
|
|
1304
|
-
}
|
|
1305
|
-
await MovePage(target.startPage);
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
// src/oz/utils/bridge-util/btn-touch-event-util/top-handler.ts
|
|
1309
|
-
async function TopHandler({ type, btnID }) {
|
|
1310
|
-
if (type !== "top") {
|
|
1311
|
-
throw `Unexpected Type ${type}`;
|
|
1312
|
-
}
|
|
1313
|
-
if (btnID === "btnExit") {
|
|
1314
|
-
await Bridge.native.hideOZViewer();
|
|
1315
|
-
} else {
|
|
1316
|
-
throw `Unexpected btnID ${btnID}`;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
// src/oz/utils/bridge-util/btn-touch-event-util/comment-handler.ts
|
|
1321
|
-
async function CommentHandler({ type, btnID }) {
|
|
1322
|
-
if (type !== "comment") {
|
|
1323
|
-
throw `Unexpected Type ${type}`;
|
|
1324
|
-
}
|
|
1325
|
-
if (btnID === "yellow") {
|
|
1326
|
-
await setEnableCommentMode("yellow");
|
|
1327
|
-
} else if (btnID === "pink") {
|
|
1328
|
-
await setEnableCommentMode("pink");
|
|
1329
|
-
} else if (btnID === "green") {
|
|
1330
|
-
await setEnableCommentMode("green");
|
|
1331
|
-
} else if (btnID === "eraser") {
|
|
1332
|
-
await setEnableCommentMode("eraser");
|
|
1333
|
-
} else if (btnID === "disable") {
|
|
1334
|
-
await setDisableCommentMode();
|
|
1335
|
-
} else {
|
|
1336
|
-
throw `Unexpected btnID ${btnID}`;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
async function isCommentMode() {
|
|
1340
|
-
const { data } = await Bridge.nativeOz.getInformation({ command: `COMMENT_MODE` });
|
|
1341
|
-
return data === "comment";
|
|
1342
|
-
}
|
|
1343
|
-
async function setCommentMode(penConfig) {
|
|
1344
|
-
const command = `mode_comment_all`;
|
|
1345
|
-
const commentEnabled = await isCommentMode();
|
|
1346
|
-
const param = [
|
|
1347
|
-
...commentEnabled ? [] : [`viewer.screentool=comment`],
|
|
1348
|
-
...penConfig
|
|
1349
|
-
].join("\n");
|
|
1350
|
-
await sleep();
|
|
1351
|
-
return await Bridge.nativeOz.scriptEx({ command, param });
|
|
1352
|
-
}
|
|
1353
|
-
async function setEnableCommentMode(type = "yellow") {
|
|
1354
|
-
let param;
|
|
1355
|
-
if (type === "yellow") {
|
|
1356
|
-
param = commentPenYellow;
|
|
1357
|
-
} else if (type === "pink") {
|
|
1358
|
-
param = commentPenPink;
|
|
1359
|
-
} else if (type === "green") {
|
|
1360
|
-
param = commentPenGreen;
|
|
1361
|
-
} else {
|
|
1362
|
-
param = commentPenEraser;
|
|
1363
|
-
}
|
|
1364
|
-
return await setCommentMode(param);
|
|
1365
|
-
}
|
|
1366
|
-
async function setDisableCommentMode() {
|
|
1367
|
-
const command = `mode_input_all`;
|
|
1368
|
-
return await Bridge.nativeOz.script({ command });
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
// src/oz/utils/bridge-util/btn-touch-event-util/pdf-handler.ts
|
|
1372
|
-
async function PdfHandler({ type, btnID }) {
|
|
1373
|
-
if (type !== "pdf") {
|
|
1374
|
-
throw `Unexpected Type ${type}`;
|
|
1375
|
-
}
|
|
1376
|
-
if (btnID === "modify") {
|
|
1377
|
-
await Bridge.nativeOz.hideOzPdfViewer();
|
|
1378
|
-
} else if (btnID === "submit") {
|
|
1379
|
-
await Bridge.nativeOz.hideOzPdfViewer();
|
|
1380
|
-
await Bridge.native.hideOZViewer();
|
|
1381
|
-
} else {
|
|
1382
|
-
throw `Unexpected btnID ${btnID}`;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
// src/oz/utils/bridge-util/focus-util.ts
|
|
1387
|
-
async function setFocusOnValidation(enable, reportCount) {
|
|
1388
|
-
const count = reportCount ?? await getReportCountMemo();
|
|
1389
|
-
const expectedValue = enable ? "1" : "0";
|
|
1390
|
-
const { data: prev } = await Bridge.nativeOz.getGlobal({ key: "chkFlag", docIndex: 0 });
|
|
1391
|
-
if (prev === expectedValue) {
|
|
1392
|
-
return;
|
|
1393
|
-
}
|
|
1394
|
-
for (let i = 0; i < count; i++) {
|
|
1395
|
-
await sleep();
|
|
1396
|
-
await Bridge.nativeOz.setGlobal({ key: "chkFlag", value: expectedValue, docIndex: i });
|
|
1397
|
-
}
|
|
1398
|
-
return;
|
|
1399
|
-
}
|
|
1400
|
-
async function enableFocusOnValidation(reportCount) {
|
|
1401
|
-
return setFocusOnValidation(true, reportCount);
|
|
1402
|
-
}
|
|
1403
|
-
async function disableFocusOnValidation(reportCount) {
|
|
1404
|
-
return setFocusOnValidation(false, reportCount);
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
// src/oz/utils/bridge-util/validation-util.ts
|
|
1408
|
-
async function checkDocumentsValidityByIndex(indexList) {
|
|
1409
|
-
const VALID = "";
|
|
1410
|
-
for (let i = 0; i < indexList.length; i++) {
|
|
1411
|
-
await sleep();
|
|
1412
|
-
const command = `INVALID_INFO_JSON_AT=${indexList[i]}`;
|
|
1413
|
-
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
1414
|
-
if (data !== VALID) {
|
|
1415
|
-
return false;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
return true;
|
|
1419
|
-
}
|
|
1420
|
-
async function validateAllPages(pageCount) {
|
|
1421
|
-
const count = pageCount ?? await getTotalPageMemo();
|
|
1422
|
-
for (let i = 1; i <= count; i++) {
|
|
1423
|
-
await sleep();
|
|
1424
|
-
const isValid = await checkValidPageMemo(i);
|
|
1425
|
-
if (!isValid) {
|
|
1426
|
-
return false;
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
return true;
|
|
1430
|
-
}
|
|
1431
|
-
var checkValidPageMemo = (() => {
|
|
1432
|
-
const cache = /* @__PURE__ */ new Map();
|
|
1433
|
-
async function checkValidPage(page) {
|
|
1434
|
-
const cached = cache.get(page);
|
|
1435
|
-
if (cached) {
|
|
1436
|
-
return cached;
|
|
1437
|
-
}
|
|
1438
|
-
const VALID = "valid";
|
|
1439
|
-
const command = `INPUT_CHECK_VALIDITY_PAGE_AT=${page}`;
|
|
1440
|
-
const promise = (async () => {
|
|
1441
|
-
try {
|
|
1442
|
-
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
1443
|
-
const isValid = data === VALID;
|
|
1444
|
-
if (!isValid) {
|
|
1445
|
-
cache.delete(page);
|
|
1446
|
-
}
|
|
1447
|
-
return isValid;
|
|
1448
|
-
} catch (err) {
|
|
1449
|
-
cache.delete(page);
|
|
1450
|
-
throw err;
|
|
1451
|
-
}
|
|
1452
|
-
})();
|
|
1453
|
-
cache.set(page, promise);
|
|
1454
|
-
return promise;
|
|
1455
|
-
}
|
|
1456
|
-
checkValidPage.clearCache = () => {
|
|
1457
|
-
cache.clear();
|
|
1458
|
-
};
|
|
1459
|
-
checkValidPage.clearCacheByPage = (page) => {
|
|
1460
|
-
cache.delete(page);
|
|
1461
|
-
};
|
|
1462
|
-
return checkValidPage;
|
|
1463
|
-
})();
|
|
1464
|
-
|
|
1465
|
-
// src/oz/utils/bridge-util/btn-touch-event-util/signature-handler.ts
|
|
1466
|
-
async function SignatureHandler({ type, btnID }) {
|
|
1467
|
-
if (type !== "signature") {
|
|
1468
|
-
throw `Unexpected Type ${type}`;
|
|
1469
|
-
}
|
|
1470
|
-
if (btnID === "signatureInProgress") {
|
|
1471
|
-
await SignatureInProgressHandler();
|
|
1472
|
-
} else if (btnID === "signatureInMissing") {
|
|
1473
|
-
await SignatureInMissingHandler();
|
|
1474
|
-
} else if (btnID === "signatureComplete") {
|
|
1475
|
-
await SignatureCompleteHandler();
|
|
1476
|
-
} else {
|
|
1477
|
-
throw `Unexpected btnID ${btnID}`;
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
async function SignatureInProgressHandler() {
|
|
1481
|
-
const reportCount = await getReportCountMemo();
|
|
1482
|
-
const pageCount = await getTotalPageMemo();
|
|
1483
|
-
await enableFocusOnValidation(reportCount);
|
|
1484
|
-
await validateAllPages(pageCount);
|
|
1485
|
-
}
|
|
1486
|
-
async function SignatureInMissingHandler() {
|
|
1487
|
-
const { data: result } = await Bridge.nativeOz.showAlert({
|
|
1488
|
-
title: "\uC785\uB825\uD558\uC9C0 \uC54A\uC740 \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4",
|
|
1489
|
-
message: "\uD574\uB2F9 \uD56D\uBAA9\uC73C\uB85C \uC774\uB3D9\uD558\uC5EC \uC785\uB825\uC744 \uC644\uB8CC\uD574\uC8FC\uC138\uC694.",
|
|
1490
|
-
buttons: {
|
|
1491
|
-
close: true,
|
|
1492
|
-
main: "\uBBF8\uC785\uB825 \uD56D\uBAA9 \uC785\uB825\uD558\uAE30"
|
|
1493
|
-
}
|
|
1494
|
-
});
|
|
1495
|
-
if (result === "main") {
|
|
1496
|
-
return await SignatureInProgressHandler();
|
|
1497
|
-
}
|
|
1498
|
-
return;
|
|
1499
|
-
}
|
|
1500
|
-
async function SignatureCompleteHandler() {
|
|
1501
|
-
try {
|
|
1502
|
-
await Bridge.native.showLoader();
|
|
1503
|
-
checkValidPageMemo.clearCache();
|
|
1504
|
-
getReportCountMemo.clearCache();
|
|
1505
|
-
getTotalPageMemo.clearCache();
|
|
1506
|
-
const reportCount = await getReportCountMemo();
|
|
1507
|
-
const pageCount = await getTotalPageMemo();
|
|
1508
|
-
await disableFocusOnValidation(reportCount);
|
|
1509
|
-
const isAllValid = await validateAllPages(pageCount);
|
|
1510
|
-
if (!isAllValid) {
|
|
1511
|
-
throw "MissingAlert";
|
|
1512
|
-
}
|
|
1513
|
-
const filePath = await SaveTotalPdf();
|
|
1514
|
-
await Bridge.nativeOz.createOzPdfViewer({ filePath });
|
|
1515
|
-
} catch (e) {
|
|
1516
|
-
if (e === "MissingAlert") {
|
|
1517
|
-
await SignatureInMissingHandler();
|
|
1518
|
-
} else {
|
|
1519
|
-
alert("PDF export \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD558\uC600\uC2B5\uB2C8\uB2E4");
|
|
1520
|
-
}
|
|
1521
|
-
} finally {
|
|
1522
|
-
await Bridge.native.hideLoader();
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
async function SaveTotalPdf() {
|
|
1526
|
-
const { promise, resolve } = PromiseWithResolvers();
|
|
1527
|
-
window.addEventListener(
|
|
1528
|
-
"OZExportCommand" /* OZExportCommand */,
|
|
1529
|
-
// 이벤트를 CustomEvent로 타입 캐스팅하고, detail에서 파일 경로 추출
|
|
1530
|
-
(e) => resolve(e.detail.filepaths),
|
|
1531
|
-
// 이벤트 리스너는 한 번만 실행되도록 설정
|
|
1532
|
-
{ once: true }
|
|
1533
|
-
);
|
|
1534
|
-
const totalPage = await getTotalPageMemo();
|
|
1535
|
-
await Bridge.nativeOz.savePdf({
|
|
1536
|
-
// PDF 저장은 증번폴더/파일이름.pdf로 생성
|
|
1537
|
-
policyNumber,
|
|
1538
|
-
param: [
|
|
1539
|
-
// 저장할 파일명 설정
|
|
1540
|
-
`pdf.filename=${"total.pdf"}`,
|
|
1541
|
-
// 1페이지부터 마지막 페이지까지 저장
|
|
1542
|
-
`export.pages=${1}-${totalPage}`,
|
|
1543
|
-
// 공통 PDF 내보내기 파라미터 추가
|
|
1544
|
-
...commonPdfExportParam
|
|
1545
|
-
].join("\n")
|
|
1546
|
-
});
|
|
1547
|
-
const filepath = await promise;
|
|
1548
|
-
return filepath;
|
|
1549
|
-
}
|
|
1550
|
-
async function SaveSinglePdf({ startPage, endPage, imageDocumentTypeCode }) {
|
|
1551
|
-
const { promise, resolve } = PromiseWithResolvers();
|
|
1552
|
-
window.addEventListener(
|
|
1553
|
-
"OZExportCommand" /* OZExportCommand */,
|
|
1554
|
-
// 이벤트를 CustomEvent로 타입 캐스팅하고, detail에서 파일 경로 추출
|
|
1555
|
-
(e) => resolve(e.detail.filepaths),
|
|
1556
|
-
// 이벤트 리스너는 한 번만 실행되도록 설정
|
|
1557
|
-
{ once: true }
|
|
1558
|
-
);
|
|
1559
|
-
await Bridge.nativeOz.savePdf({
|
|
1560
|
-
// PDF 저장은 증번폴더/파일이름.pdf로 생성
|
|
1561
|
-
policyNumber,
|
|
1562
|
-
param: [
|
|
1563
|
-
// 저장할 파일명 설정
|
|
1564
|
-
`pdf.filename=${imageDocumentTypeCode}.pdf`,
|
|
1565
|
-
// 1페이지부터 마지막 페이지까지 저장
|
|
1566
|
-
`export.pages=${startPage}-${endPage}`,
|
|
1567
|
-
// 공통 PDF 내보내기 파라미터 추가
|
|
1568
|
-
...commonPdfExportParam
|
|
1569
|
-
].join("\n")
|
|
1570
|
-
});
|
|
1571
|
-
const filepath = await promise;
|
|
1572
|
-
return filepath;
|
|
1573
|
-
}
|
|
1574
|
-
async function fetchDocument(args) {
|
|
1575
|
-
const { data: result } = await Bridge.native.downloadDocument(args);
|
|
1576
|
-
return result.data.map((i) => ({ ...i, startPage: 0, endPage: 0 }));
|
|
1577
|
-
}
|
|
1578
|
-
async function fetchFont() {
|
|
1579
|
-
const { data: fontMap } = await Bridge.native.getOzFontParam();
|
|
1580
|
-
const fontParms = Object.keys(fontMap).map((i) => `font.${i}=${fontMap[i]}`);
|
|
1581
|
-
return fontParms;
|
|
1582
|
-
}
|
|
1583
|
-
async function postFiletoDud(imageStr) {
|
|
1584
|
-
const formData = new FormData();
|
|
1585
|
-
formData.append("data", salesFrontendUtils.base64ToFile(imageStr, "test.png"));
|
|
1586
|
-
formData.append("fileIdentifierValue", "string");
|
|
1587
|
-
formData.append("fileExtendContent1", "string");
|
|
1588
|
-
formData.append("fileExtendContent2", "string");
|
|
1589
|
-
formData.append("preservationTerm", "1");
|
|
1590
|
-
formData.append("fileType", "png");
|
|
1591
|
-
const response = await fetch("/api/v1/post/file", {
|
|
1592
|
-
headers: {
|
|
1593
|
-
"x-channel-appversion": "3.1",
|
|
1594
|
-
"x-channel-carriername": "SK",
|
|
1595
|
-
"x-channel-deviceid": "deviceid",
|
|
1596
|
-
"x-channel-devicemodel": "iPHONE13",
|
|
1597
|
-
"x-channel-formfactor": "Phone",
|
|
1598
|
-
"x-channel-loginchannel": "DSP",
|
|
1599
|
-
"x-channel-logintype": "ONPA_PIN",
|
|
1600
|
-
"x-channel-networktype": "LTE",
|
|
1601
|
-
"x-channel-platformversion": "15.4.1",
|
|
1602
|
-
"x-channel-screenid": "ScreenId",
|
|
1603
|
-
"x-dud-authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJXNWRtc1g1MkVWZGV0YThJRy90YmlZY281bnVCdzRZOXhGZjlWakZzdWxnbU00YnkiLCJpYXQiOjE3NjEwNDMyNjgsImV4cCI6MTc2NjI5OTI2OH0.KDnF7ZhkmnEApGCvOcItwcHnLWe5iJu64g93GACT2yo",
|
|
1604
|
-
"x-x-channel-platformname": "IOS"
|
|
1605
|
-
},
|
|
1606
|
-
method: "POST",
|
|
1607
|
-
body: formData
|
|
1608
|
-
});
|
|
1609
|
-
const json = await response.json();
|
|
1610
|
-
return json;
|
|
1611
|
-
}
|
|
1612
|
-
async function getFileFromDud(fileMgmtId) {
|
|
1613
|
-
const outputType = "binary";
|
|
1614
|
-
const response = await fetch("/api/v1/get/file", {
|
|
1615
|
-
headers: {
|
|
1616
|
-
"content-type": "application/json",
|
|
1617
|
-
"x-channel-appversion": "3.1",
|
|
1618
|
-
"x-channel-carriername": "SK",
|
|
1619
|
-
"x-channel-deviceid": "deviceid",
|
|
1620
|
-
"x-channel-devicemodel": "iPHONE13",
|
|
1621
|
-
"x-channel-formfactor": "Phone",
|
|
1622
|
-
"x-channel-loginchannel": "DSP",
|
|
1623
|
-
"x-channel-logintype": "ONPA_PIN",
|
|
1624
|
-
"x-channel-networktype": "LTE",
|
|
1625
|
-
"x-channel-platformversion": "15.4.1",
|
|
1626
|
-
"x-channel-screenid": "ScreenId",
|
|
1627
|
-
"x-dud-authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJXNWRtc1g1MkVWZGV0YThJRy90YmlZY281bnVCdzRZOXhGZjlWakZzdWxnbU00YnkiLCJpYXQiOjE3NjEwNDMyNjgsImV4cCI6MTc2NjI5OTI2OH0.KDnF7ZhkmnEApGCvOcItwcHnLWe5iJu64g93GACT2yo",
|
|
1628
|
-
"x-x-channel-platformname": "IOS"
|
|
1629
|
-
},
|
|
1630
|
-
method: "POST",
|
|
1631
|
-
body: JSON.stringify({ fileMgmtId, outputType })
|
|
1632
|
-
});
|
|
1633
|
-
const blob = await response.blob();
|
|
1634
|
-
const base64String = await salesFrontendUtils.fileToBase64(blob);
|
|
1635
|
-
return base64String;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
// src/oz/utils/bridge-util/create-report-util.ts
|
|
1639
|
-
async function CreateOzParam({ documentList, extraData = {}, roleCd, jijungInfo = "" }) {
|
|
1640
|
-
if (documentList.length === 0) {
|
|
1641
|
-
throw new Error("\uBB38\uC11C\uBAA9\uB85D\uC774 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4");
|
|
1642
|
-
}
|
|
1643
|
-
const fontParms = await fetchFont();
|
|
1644
|
-
const connectionParams = documentList.map(
|
|
1645
|
-
({ filePath }, idx) => idx === 0 ? `connection.openfile=${filePath}` : `child${idx}.connection.openfile=${filePath}`
|
|
1646
|
-
);
|
|
1647
|
-
const childCount = documentList.length - 1;
|
|
1648
|
-
const extraParams = documentList.map((ozdFile, idx) => {
|
|
1649
|
-
const result = [];
|
|
1650
|
-
const docCode = ozdFile.docCode.replace(/^.*[\\/]|(\.[^/.]+)$/g, "");
|
|
1651
|
-
const prefix = idx === 0 ? "" : `child${idx}.`;
|
|
1652
|
-
const data = extraData[docCode] || {};
|
|
1653
|
-
if (data.inputJson) {
|
|
1654
|
-
result.push(`${prefix}connection.inputjson=${JSON.stringify(data.inputJson)}`);
|
|
1655
|
-
}
|
|
1656
|
-
const args = [
|
|
1657
|
-
// 모든서식에 공통으로 필요한 docCd param 추가
|
|
1658
|
-
`docCd=${docCode}`,
|
|
1659
|
-
// 모든서식에 공통으로 필요한 roleCode 정보 추가
|
|
1660
|
-
`roleCd=${roleCd}`,
|
|
1661
|
-
// 모든서식에 공통으로 필요한 지정대리인 정보 추가
|
|
1662
|
-
`jijungInfo=${jijungInfo}`,
|
|
1663
|
-
...ensureArray(data.args)
|
|
1664
|
-
];
|
|
1665
|
-
args.forEach((arg, idx2) => result.push(`${prefix}connection.args${idx2 + 1}=${arg}`));
|
|
1666
|
-
const extraParam = [
|
|
1667
|
-
// connection.args의 갯수만큼 pcount 보정
|
|
1668
|
-
`connection.pcount=${args.length}`,
|
|
1669
|
-
...ensureArray(data.extraParam)
|
|
1670
|
-
];
|
|
1671
|
-
extraParam.forEach((param) => result.push(`${prefix}${param}`));
|
|
1672
|
-
return result;
|
|
1673
|
-
});
|
|
1674
|
-
const params = [
|
|
1675
|
-
...childCount > 0 ? [`viewer.childcount=${childCount}`] : [],
|
|
1676
|
-
...connectionParams,
|
|
1677
|
-
...commonOzParam,
|
|
1678
|
-
...fontParms,
|
|
1679
|
-
...extraParams.flat(1)
|
|
1680
|
-
];
|
|
1681
|
-
return params;
|
|
1682
|
-
}
|
|
1683
|
-
async function setCheckEform(reportCount) {
|
|
1684
|
-
const count = reportCount ?? await getReportCountMemo();
|
|
1685
|
-
for (let i = 0; i < count; i++) {
|
|
1686
|
-
await sleep();
|
|
1687
|
-
await Bridge.nativeOz.setGlobal({ key: "checkeForm", value: "Y", docIndex: i });
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
async function triggerClickOnAllDocuments(reportCount) {
|
|
1691
|
-
const count = reportCount ?? await getReportCountMemo();
|
|
1692
|
-
for (let i = 0; i < count; i++) {
|
|
1693
|
-
await sleep();
|
|
1694
|
-
const command = `INPUT_TRIGGER_CLICK_AT=${i}`;
|
|
1695
|
-
await Bridge.nativeOz.getInformation({ command });
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
async function triggerCropImageOnAllDocuments(reportCount) {
|
|
1699
|
-
const count = reportCount ?? await getReportCountMemo();
|
|
1700
|
-
for (let i = 0; i < count; i++) {
|
|
1701
|
-
await sleep();
|
|
1702
|
-
await Bridge.nativeOz.triggerExternalEventByDocIndex({ param1: "cropimage" /* CropImage */, docIndex: Number(i) });
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
async function getTotalPageOnAllDocuments(reportCount) {
|
|
1706
|
-
const count = reportCount ?? await getReportCountMemo();
|
|
1707
|
-
const totalPages = [];
|
|
1708
|
-
for (let i = 0; i < count; i++) {
|
|
1709
|
-
await sleep();
|
|
1710
|
-
const command = `TOTAL_PAGE_OF_REPORT_FILE_AT=${i}`;
|
|
1711
|
-
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
1712
|
-
totalPages.push(Number(data));
|
|
1713
|
-
}
|
|
1714
|
-
return totalPages;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
// src/oz/utils/bridge-util/get-draft-data-util.ts
|
|
1718
|
-
async function getDraftDataHandler(rawOzRequest, documentIndexMap) {
|
|
1719
|
-
const parsedRequest = JSON.parse(rawOzRequest);
|
|
1720
|
-
const { docCd, ...signKeyMap } = parsedRequest;
|
|
1721
|
-
const documentIndex = documentIndexMap[docCd];
|
|
1722
|
-
if (documentIndex === void 0) {
|
|
1723
|
-
throw new Error(`Invalid document code: ${docCd}`);
|
|
1724
|
-
}
|
|
1725
|
-
const { data } = await Bridge.nativeOz.getInformation({ command: `INPUT_JSON_AT=${documentIndex}` });
|
|
1726
|
-
if (data === null) {
|
|
1727
|
-
throw new Error(`Bridge returned null for document: ${docCd} (command=INPUT_JSON_AT=${documentIndex})`);
|
|
1728
|
-
}
|
|
1729
|
-
const documentJson = JSON.parse(data);
|
|
1730
|
-
const signDataMap = Object.keys(signKeyMap).reduce((acc, key) => {
|
|
1731
|
-
acc[key] = documentJson[key];
|
|
1732
|
-
return acc;
|
|
1733
|
-
}, {});
|
|
1734
|
-
return signDataMap;
|
|
1735
|
-
}
|
|
1736
|
-
async function triggerDraftDataByIndexList(indexList) {
|
|
1737
|
-
for (let i = 0; i < indexList.length; i++) {
|
|
1738
|
-
await sleep();
|
|
1739
|
-
await Bridge.nativeOz.triggerExternalEventByDocIndex({ param1: "getDraftData" /* GetDraftData */, docIndex: indexList[i] });
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
var valueChangeDebounceMap = /* @__PURE__ */ new Map();
|
|
1743
|
-
function getDebouncedValueChangeHandler(docIndex, onValueChanged) {
|
|
1744
|
-
const DEBOUNCE_DELAY = 1e3 * 1;
|
|
1745
|
-
const existingHandler = valueChangeDebounceMap.get(docIndex);
|
|
1746
|
-
if (existingHandler) {
|
|
1747
|
-
return existingHandler;
|
|
1748
|
-
}
|
|
1749
|
-
const debouncedHandler = salesFrontendUtils.debounce((idx) => {
|
|
1750
|
-
onValueChanged(idx);
|
|
1751
|
-
}, DEBOUNCE_DELAY);
|
|
1752
|
-
valueChangeDebounceMap.set(docIndex, debouncedHandler);
|
|
1753
|
-
return debouncedHandler;
|
|
1754
|
-
}
|
|
1755
|
-
function clearValueChangeDebounceHandlers() {
|
|
1756
|
-
valueChangeDebounceMap.clear();
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
exports.AlertDocumentLoadError = AlertDocumentLoadError;
|
|
1760
|
-
exports.AlertTemporaryError = AlertTemporaryError;
|
|
1761
872
|
exports.Bridge = Bridge;
|
|
1762
|
-
exports.CategoryHandler = CategoryHandler;
|
|
1763
|
-
exports.CommentHandler = CommentHandler;
|
|
1764
|
-
exports.CreateOzParam = CreateOzParam;
|
|
1765
|
-
exports.CreateOzViewer = CreateOzViewer;
|
|
1766
|
-
exports.DownloadDocumentList = DownloadDocumentList;
|
|
1767
|
-
exports.ExtraData = ExtraData;
|
|
1768
|
-
exports.MovePage = MovePage;
|
|
1769
|
-
exports.OZTriggerExternalEvent = OZTriggerExternalEvent;
|
|
1770
|
-
exports.OZViewerEvent = OZViewerEvent;
|
|
1771
|
-
exports.PdfHandler = PdfHandler;
|
|
1772
|
-
exports.PromiseWithResolvers = PromiseWithResolvers;
|
|
1773
|
-
exports.SaveSinglePdf = SaveSinglePdf;
|
|
1774
|
-
exports.SaveTotalPdf = SaveTotalPdf;
|
|
1775
|
-
exports.SignatureHandler = SignatureHandler;
|
|
1776
|
-
exports.TopHandler = TopHandler;
|
|
1777
|
-
exports.btnStyle = btnStyle;
|
|
1778
|
-
exports.categorizeByPageRange = categorizeByPageRange;
|
|
1779
|
-
exports.checkDocumentsValidityByIndex = checkDocumentsValidityByIndex;
|
|
1780
|
-
exports.checkValidPageMemo = checkValidPageMemo;
|
|
1781
|
-
exports.clearValueChangeDebounceHandlers = clearValueChangeDebounceHandlers;
|
|
1782
|
-
exports.commentPenEraser = commentPenEraser;
|
|
1783
|
-
exports.commentPenGreen = commentPenGreen;
|
|
1784
|
-
exports.commentPenPink = commentPenPink;
|
|
1785
|
-
exports.commentPenYellow = commentPenYellow;
|
|
1786
|
-
exports.commonOzParam = commonOzParam;
|
|
1787
|
-
exports.commonPdfExportParam = commonPdfExportParam;
|
|
1788
|
-
exports.disableFocusOnValidation = disableFocusOnValidation;
|
|
1789
|
-
exports.enableFocusOnValidation = enableFocusOnValidation;
|
|
1790
|
-
exports.ensureArray = ensureArray;
|
|
1791
|
-
exports.extractFileName = extractFileName;
|
|
1792
|
-
exports.fetchDocument = fetchDocument;
|
|
1793
|
-
exports.fetchFont = fetchFont;
|
|
1794
|
-
exports.fpInfo = fpInfo;
|
|
1795
|
-
exports.getCurrentPage = getCurrentPage;
|
|
1796
|
-
exports.getDebouncedValueChangeHandler = getDebouncedValueChangeHandler;
|
|
1797
|
-
exports.getDraftDataHandler = getDraftDataHandler;
|
|
1798
|
-
exports.getFileFromDud = getFileFromDud;
|
|
1799
|
-
exports.getFileListByGlobalIndex = getFileListByGlobalIndex;
|
|
1800
|
-
exports.getReportCountMemo = getReportCountMemo;
|
|
1801
|
-
exports.getTotalPageMemo = getTotalPageMemo;
|
|
1802
|
-
exports.getTotalPageOnAllDocuments = getTotalPageOnAllDocuments;
|
|
1803
|
-
exports.isCommentMode = isCommentMode;
|
|
1804
|
-
exports.policyNumber = policyNumber;
|
|
1805
|
-
exports.postFiletoDud = postFiletoDud;
|
|
1806
|
-
exports.roleCode = roleCode;
|
|
1807
|
-
exports.setCheckEform = setCheckEform;
|
|
1808
|
-
exports.setDisableCommentMode = setDisableCommentMode;
|
|
1809
|
-
exports.setEnableCommentMode = setEnableCommentMode;
|
|
1810
|
-
exports.sleep = sleep;
|
|
1811
|
-
exports.triggerClickOnAllDocuments = triggerClickOnAllDocuments;
|
|
1812
|
-
exports.triggerCropImageOnAllDocuments = triggerCropImageOnAllDocuments;
|
|
1813
|
-
exports.triggerDraftDataByIndexList = triggerDraftDataByIndexList;
|
|
1814
|
-
exports.useDocumentInfo = useDocumentInfo;
|
|
1815
|
-
exports.useOzEventListener = useOzEventListener;
|
|
1816
|
-
exports.validateAllPages = validateAllPages;
|
|
1817
|
-
exports.wrapperStyle = wrapperStyle;
|
|
1818
|
-
exports.xdudheaders = xdudheaders;
|
|
1819
873
|
//# sourceMappingURL=index.cjs.map
|
|
1820
874
|
//# sourceMappingURL=index.cjs.map
|