feat: [문서] 모든 문서 저장 경로에 rendered_html 스냅샷 캡처 추가

- InspectionReportModal: readOnly 모드에서도 콘텐츠 로드 후 자동 캡처
- ImportInspectionInputModal: 수입검사 저장 시 폼 HTML 캡처 전송
- ReceivingManagement/actions: saveInspectionData에 rendered_html 파라미터 추가
This commit is contained in:
2026-03-06 20:04:11 +09:00
parent a1fb0d4f9b
commit 31f523c88f
3 changed files with 27 additions and 3 deletions

View File

@@ -12,7 +12,7 @@
* - saveInspectionData()로 저장
*/
import { useState, useEffect, useMemo, useCallback } from 'react';
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
import {
Dialog,
DialogContent,
@@ -216,6 +216,9 @@ export function ImportInspectionInputModal({
receivingId,
onSave,
}: ImportInspectionInputModalProps) {
// HTML 스냅샷 캡처 ref (MNG 출력용)
const contentWrapperRef = useRef<HTMLDivElement>(null);
// Template
const [template, setTemplate] = useState<InspectionTemplateResponse | null>(null);
const [resolveData, setResolveData] = useState<DocumentResolveResponse | null>(null);
@@ -636,7 +639,10 @@ export function ImportInspectionInputModal({
})),
];
// 4. 저장 API 호출
// 4. HTML 스냅샷 캡처 (MNG 출력용)
const renderedHtml = contentWrapperRef.current?.innerHTML || undefined;
// 5. 저장 API 호출
const result = await saveInspectionData({
templateId: parseInt(template.templateId),
itemId,
@@ -645,6 +651,7 @@ export function ImportInspectionInputModal({
attachments,
receivingId,
inspectionResult: overallResult,
rendered_html: renderedHtml,
});
if (result.success) {
@@ -734,7 +741,7 @@ export function ImportInspectionInputModal({
릿 .
</div>
) : (
<div className="flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-5">
<div ref={contentWrapperRef} className="flex-1 min-h-0 overflow-y-auto px-5 py-4 space-y-5">
{/* 기본 정보 (읽기전용 인풋 스타일) */}
<div className="space-y-3">
<div className="space-y-1.5">