From cad50d4d625cec610bc3985db95a5025cc044157 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 10 Nov 2025 17:42:02 +0900 Subject: (김준회) 기본계약문서관리: pdftron이 보여줄 템플릿 파일을 못찾았을 경우의 폴백 추가 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/template-editor-wrapper.tsx | 78 +++++++++++++++++----- 1 file changed, 61 insertions(+), 17 deletions(-) (limited to 'lib/basic-contract/template/template-editor-wrapper.tsx') diff --git a/lib/basic-contract/template/template-editor-wrapper.tsx b/lib/basic-contract/template/template-editor-wrapper.tsx index 8d2ce97f..be5e6856 100644 --- a/lib/basic-contract/template/template-editor-wrapper.tsx +++ b/lib/basic-contract/template/template-editor-wrapper.tsx @@ -102,6 +102,7 @@ export function TemplateEditorWrapper({ const [templateName, setTemplateName] = React.useState(""); const [predefinedVariables, setPredefinedVariables] = React.useState([]); const [signatureVariables, setSignatureVariables] = React.useState([]); // 서명란 변수 + const [fileLoadError, setFileLoadError] = React.useState(null); // 파일 로드 오류 // 템플릿 이름 로드 및 변수 설정 React.useEffect(() => { @@ -503,23 +504,66 @@ export function TemplateEditorWrapper({ {/* 뷰어 영역 (확대 문제 해결을 위한 컨테이너 격리) */}
-
- { - // 서명란 발견 시 원본 텍스트를 그대로 추가 (자동 서명 기능을 위해) - setSignatureVariables(prev => { - if (!prev.includes(searchText)) { - return [...prev, searchText]; - } - return prev; - }); - }} - /> -
+ {fileLoadError ? ( +
+
+ +
+

파일을 불러올 수 없습니다

+

+ {fileLoadError.message} +

+
+
+

+ 가능한 원인: +

+
    +
  • 템플릿이 폐기되어 파일이 삭제되었습니다
  • +
  • 템플릿이 DB에서 삭제되었습니다
  • +
  • 파일 경로가 변경되었거나 손상되었습니다
  • +
+
+
+ + +
+
+
+ ) : ( +
+ { + // 서명란 발견 시 원본 텍스트를 그대로 추가 (자동 서명 기능을 위해) + setSignatureVariables(prev => { + if (!prev.includes(searchText)) { + return [...prev, searchText]; + } + return prev; + }); + }} + onLoadError={(error) => { + setFileLoadError(error); + }} + /> +
+ )}
{/* 하단 안내 (한글 입력 팁 포함) */} -- cgit v1.2.3