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/ApprovalList.tsx | 38 ++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 16 deletions(-)

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

diff --git a/components/knox/approval/ApprovalList.tsx b/components/knox/approval/ApprovalList.tsx
index 7f80e74a..3a766901 100644
--- a/components/knox/approval/ApprovalList.tsx
+++ b/components/knox/approval/ApprovalList.tsx
@@ -12,12 +12,24 @@ import { Loader2, List, Eye, RefreshCw, AlertCircle } from 'lucide-react';
 import { getSubmissionList, getApprovalHistory } from '@/lib/knox-api/approval/approval';
 import type { SubmissionListResponse, ApprovalHistoryResponse } 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 ApprovalListProps {
-  useFakeData?: boolean;
-  systemId?: string;
   type?: 'submission' | 'history';
   onItemClick?: (apInfId: string) => void;
 }
@@ -35,8 +47,6 @@ type ListItem = {
 };
 
 export default function ApprovalList({ 
-  useFakeData = false, 
-  systemId = 'EVCP_SYSTEM',
   type = 'submission',
   onItemClick
 }: ApprovalListProps) {
@@ -52,17 +62,13 @@ export default function ApprovalList({
       let response: SubmissionListResponse | ApprovalHistoryResponse;
       
       if (type === 'submission') {
-        response = useFakeData 
-          ? await mockApprovalAPI.getSubmissionList()
-          : await getSubmissionList(systemId);
+        response = await getSubmissionList();
       } else {
-        response = useFakeData 
-          ? await mockApprovalAPI.getApprovalHistory()
-          : await getApprovalHistory(systemId);
+        response = await getApprovalHistory();
       }
 
       if (response.result === 'SUCCESS') {
-        setListData(response.data);
+        setListData(response.data as unknown as ListItem[]);
       } else {
         setError('목록을 가져오는데 실패했습니다.');
         toast.error('목록을 가져오는데 실패했습니다.');
@@ -142,10 +148,10 @@ export default function ApprovalList({
   // 컴포넌트 마운트 시 데이터 로드
   useEffect(() => {
     fetchData();
-  }, [type, useFakeData, systemId]);
+  }, [type]);
 
   return (
-    <Card className="w-full max-w-6xl">
+    <Card className="w-full max-w-5xl">
       <CardHeader>
         <CardTitle className="flex items-center gap-2">
           <List className="w-5 h-5" />
@@ -155,7 +161,7 @@ export default function ApprovalList({
           {type === 'submission' 
             ? '상신한 결재 목록을 확인합니다.' 
             : '결재 처리 이력을 확인합니다.'
-          } {useFakeData && '(테스트 모드)'}
+          }
         </CardDescription>
       </CardHeader>
 
-- 
cgit v1.2.3

