feat: 기안함/결재함 상세 모달 버튼 분기 및 수정 기능 추가

- 기안함 임시저장 상세: 복제, 상신, 인쇄 버튼 표시
- 기안함 결재대기 이후 상세: 인쇄만 표시
- 결재함 상세: 수정, 반려, 승인, 인쇄 버튼 표시
- 결재함 리스트 작업컬럼 수정 버튼 → 기안함 수정 페이지 이동
- DocumentDetailModal mode/documentStatus 기반 조건부 렌더링

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2025-12-29 21:14:08 +09:00
parent 388b113b58
commit 0e5307f7a3
5 changed files with 163 additions and 47 deletions

View File

@@ -408,6 +408,12 @@ export function DocumentCreate() {
drafter,
};
default:
// 이미 업로드된 파일 URL (Next.js 프록시 사용) + 새로 추가된 파일 미리보기 URL
const uploadedFileUrls = (proposalData.uploadedFiles || []).map(f =>
`/api/files/${f.id}/download`
);
const newFileUrls = proposalData.attachments.map(f => URL.createObjectURL(f));
return {
documentNo: basicInfo.documentNo || '미발급',
createdAt: basicInfo.draftDate,
@@ -417,7 +423,7 @@ export function DocumentCreate() {
description: proposalData.description || '-',
reason: proposalData.reason || '-',
estimatedCost: proposalData.estimatedCost,
attachments: proposalData.attachments.map(f => f.name),
attachments: [...uploadedFileUrls, ...newFileUrls],
approvers,
drafter,
};
@@ -550,6 +556,19 @@ export function DocumentCreate() {
onOpenChange={setIsPreviewOpen}
documentType={basicInfo.documentType as ModalDocumentType}
data={getPreviewData()}
mode="draft"
documentStatus="draft"
onCopy={() => {
// 복제: 현재 데이터를 기반으로 새 문서 등록 화면으로 이동
if (documentId) {
router.push(`/ko/approval/draft/new?copyFrom=${documentId}`);
setIsPreviewOpen(false);
}
}}
onSubmit={() => {
setIsPreviewOpen(false);
handleSubmit();
}}
/>
</div>
);