From eb121c3ce65fe5f82ae09d49bbb90f26dc275ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=B3=91=EC=B2=A0?= Date: Thu, 19 Mar 2026 21:06:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[dashboard]=20CEO=20=EB=8C=80=EC=8B=9C?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=20=EB=AA=A8=EB=8B=AC=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=ED=96=89=20=ED=81=B4=EB=A6=AD=20=E2=86=92=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/CEODashboard/CEODashboard.tsx | 20 +++++++++++++++++++ .../cardManagementConfigTransformers.ts | 1 + .../CEODashboard/modals/DetailModal.tsx | 5 +++-- .../modals/DetailModalSections.tsx | 8 ++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/components/business/CEODashboard/CEODashboard.tsx b/src/components/business/CEODashboard/CEODashboard.tsx index f2ec3373..b79e9ef4 100644 --- a/src/components/business/CEODashboard/CEODashboard.tsx +++ b/src/components/business/CEODashboard/CEODashboard.tsx @@ -332,6 +332,25 @@ export function CEODashboard() { }, [currentModalCardId, monthlyExpenseDetailData, cardManagementModals, dashboardSettings.entertainment, dashboardSettings.welfare]); + // 모달 테이블 행 클릭 → 관련 페이지 이동 + const handleModalRowClick = useCallback((_row: Record) => { + if (!currentModalCardId) return; + + const routeMap: Record = { + cm2: '/ko/accounting/card-transactions', // 가지급금 → 카드거래 목록 + me1: '/ko/accounting/purchase', // 당월 매입 → 매입관리 + me2: '/ko/accounting/card-transactions', // 당월 카드 → 카드거래 목록 + me3: '/ko/accounting/bills', // 당월 발행어음 → 어음관리 + me4: '/ko/accounting/expected-expenses', // 당월 지출 예상 → 지출예상 + }; + + const targetPath = routeMap[currentModalCardId]; + if (targetPath) { + handleDetailModalClose(); + router.push(targetPath); + } + }, [currentModalCardId, handleDetailModalClose, router]); + // 카드/가지급금 관리 카드 클릭 → 모두 가지급금 상세(cm2) 모달 // 기획서 P52: 카드, 경조사, 상품권, 접대비, 총합계 모두 동일한 가지급금 상세 모달 const handleCardManagementCardClick = useCallback(async (_cardId: string) => { @@ -842,6 +861,7 @@ export function CEODashboard() { onClose={handleDetailModalClose} config={detailModalConfig} onDateFilterChange={handleDateFilterChange} + onRowClick={handleModalRowClick} /> )} diff --git a/src/components/business/CEODashboard/modalConfigs/cardManagementConfigTransformers.ts b/src/components/business/CEODashboard/modalConfigs/cardManagementConfigTransformers.ts index 4ddae7cb..f99203f6 100644 --- a/src/components/business/CEODashboard/modalConfigs/cardManagementConfigTransformers.ts +++ b/src/components/business/CEODashboard/modalConfigs/cardManagementConfigTransformers.ts @@ -203,6 +203,7 @@ export function transformCm2ModalConfig( // 테이블 데이터 매핑 (백엔드 필드명 기준, 영문 키 → 한글 변환) const tableData = (loans || []).map((item) => ({ + id: item.id, date: item.loan_date, classification: CATEGORY_LABELS[item.category] || item.category || '카드', category: item.status_label || '-', diff --git a/src/components/business/CEODashboard/modals/DetailModal.tsx b/src/components/business/CEODashboard/modals/DetailModal.tsx index 7dce6055..c9594da9 100644 --- a/src/components/business/CEODashboard/modals/DetailModal.tsx +++ b/src/components/business/CEODashboard/modals/DetailModal.tsx @@ -29,9 +29,10 @@ interface DetailModalProps { onClose: () => void; config: DetailModalConfig; onDateFilterChange?: (params: { startDate: string; endDate: string; search: string }) => void; + onRowClick?: (row: Record) => void; } -export function DetailModal({ isOpen, onClose, config, onDateFilterChange }: DetailModalProps) { +export function DetailModal({ isOpen, onClose, config, onDateFilterChange, onRowClick }: DetailModalProps) { return ( !open && onClose()} > @@ -104,7 +105,7 @@ export function DetailModal({ isOpen, onClose, config, onDateFilterChange }: Det )} {/* 메인 테이블 영역 */} - {config.table && } + {config.table && } {/* 참조 테이블 영역 (다중 - 테이블 아래 표시) */} {config.referenceTables && config.referenceTables.length > 0 && ( diff --git a/src/components/business/CEODashboard/modals/DetailModalSections.tsx b/src/components/business/CEODashboard/modals/DetailModalSections.tsx index 0f86614b..36219ae2 100644 --- a/src/components/business/CEODashboard/modals/DetailModalSections.tsx +++ b/src/components/business/CEODashboard/modals/DetailModalSections.tsx @@ -544,7 +544,7 @@ export const ReferenceTableSection = ({ config }: { config: ReferenceTableConfig ); }; -export const TableSection = ({ config }: { config: TableConfig }) => { +export const TableSection = ({ config, onRowClick }: { config: TableConfig; onRowClick?: (row: Record) => void }) => { const [filters, setFilters] = useState>(() => { const initial: Record = {}; config.filters?.forEach((filter) => { @@ -662,7 +662,11 @@ export const TableSection = ({ config }: { config: TableConfig }) => { {filteredData.map((row, rowIndex) => ( onRowClick(row) : undefined} > {config.columns.map((column) => { const cellValue = column.key === 'no'