From 75249e6fa46864f49d4eb91bd755171b6b65eaae Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 28 Jul 2025 12:10:39 +0000
Subject: (김준회) 공통모듈 - Knox 결재 모듈 구현, 유저 선택기 구현, 상신 결재
 저장을 위한 DB 스키마 및 서비스 추가, spreadjs 라이센스 환경변수 통일, 유저
 테이블에 epId 컬럼 추가
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/knox/approval/ApprovalCancel.tsx | 34 +++++++++++++++++------------
 1 file changed, 20 insertions(+), 14 deletions(-)

(limited to 'components/knox/approval/ApprovalCancel.tsx')

diff --git a/components/knox/approval/ApprovalCancel.tsx b/components/knox/approval/ApprovalCancel.tsx
index d077bfc6..b40b43df 100644
--- a/components/knox/approval/ApprovalCancel.tsx
+++ b/components/knox/approval/ApprovalCancel.tsx
@@ -15,19 +15,29 @@ import { Loader2, XCircle, AlertTriangle, CheckCircle } from 'lucide-react';
 import { cancelApproval, getApprovalDetail } from '@/lib/knox-api/approval/approval';
 import type { ApprovalDetailResponse } from '@/lib/knox-api/approval/approval';
 
-// Mock 데이터
-import { mockApprovalAPI, getStatusText } from './mocks/approval-mock';
+// 상태 코드 텍스트 매핑 (mock util 대체)
+const getStatusText = (status: string) => {
+  const map: Record<string, string> = {
+    '-3': '암호화실패',
+    '-2': '암호화중',
+    '-1': '예약상신',
+    '0': '보류',
+    '1': '진행중',
+    '2': '완결',
+    '3': '반려',
+    '4': '상신취소',
+    '5': '전결',
+    '6': '후완결',
+  };
+  return map[status] || '알 수 없음';
+};
 
 interface ApprovalCancelProps {
-  useFakeData?: boolean;
-  systemId?: string;
   initialApInfId?: string;
   onCancelSuccess?: (apInfId: string) => void;
 }
 
 export default function ApprovalCancel({ 
-  useFakeData = false, 
-  systemId = 'EVCP_SYSTEM',
   initialApInfId = '',
   onCancelSuccess 
 }: ApprovalCancelProps) {
@@ -50,9 +60,7 @@ export default function ApprovalCancel({
     setCancelResult(null);
 
     try {
-      const response = useFakeData 
-        ? await mockApprovalAPI.getApprovalDetail(apInfId)
-        : await getApprovalDetail(apInfId, systemId);
+      const response = await getApprovalDetail(apInfId);
 
       if (response.result === 'SUCCESS') {
         setApprovalDetail(response.data);
@@ -75,9 +83,7 @@ export default function ApprovalCancel({
     setIsCancelling(true);
 
     try {
-      const response = useFakeData 
-        ? await mockApprovalAPI.cancelApproval(approvalDetail.apInfId)
-        : await cancelApproval(approvalDetail.apInfId, systemId);
+      const response = await cancelApproval(approvalDetail.apInfId);
 
       if (response.result === 'SUCCESS') {
         setCancelResult({ apInfId: response.data.apInfId });
@@ -154,14 +160,14 @@ export default function ApprovalCancel({
   };
 
   return (
-    <Card className="w-full max-w-4xl">
+    <Card className="w-full max-w-5xl">
       <CardHeader>
         <CardTitle className="flex items-center gap-2">
           <XCircle className="w-5 h-5" />
           결재 취소
         </CardTitle>
         <CardDescription>
-          결재 ID를 입력하여 상신을 취소합니다. {useFakeData && '(테스트 모드)'}
+          상신한 결재를 취소합니다.
         </CardDescription>
       </CardHeader>
 
-- 
cgit v1.2.3

