From de4f8d618ff5837d2cb0a31d293754aad72aae6b Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 9 Jul 2025 12:12:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=85=B8=ED=9B=84=20=ED=95=98=EC=88=98?= =?UTF-8?q?=EA=B4=80=EB=A1=9C,=20=EC=B9=A8=EC=9E=85=EC=88=98=20=EB=B6=84?= =?UTF-8?q?=EC=84=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=BC=EB=A0=A8?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx | 8 +++++++- apps/sn/app/(with-base-layout)/oper/index.ts | 6 ++++-- apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx | 9 +++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx b/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx index 3578ff967..9479a5395 100644 --- a/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx +++ b/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx @@ -41,7 +41,12 @@ const Page = () => { page: curPage - 1, size: '10' }) - setTableData(data) + // 일련번호를 추가한 데이터로 변환 (전체 데이터 기준으로 일련번호 계산) + const dataWithRowNumber = (data || []).map((item: any, index: number) => ({ + ...item, + rowNumber: (curPage - 1) * 10 + index + 1, // 페이지 기준 일련번호 계산 + })); + setTableData(dataWithRowNumber) setTotalData(total) } catch (error) { console.error('Error fetching data:', error) } @@ -52,6 +57,7 @@ const Page = () => { setIsLoading(false); } } + useEffect(() => { setCurPage(1) fetchData() diff --git a/apps/sn/app/(with-base-layout)/oper/index.ts b/apps/sn/app/(with-base-layout)/oper/index.ts index e4be8bcf6..b9dd98685 100644 --- a/apps/sn/app/(with-base-layout)/oper/index.ts +++ b/apps/sn/app/(with-base-layout)/oper/index.ts @@ -1,5 +1,6 @@ export const tableHeadlist = [ - { id: 'sbmrgPrevntBizSn', title: '일련번호' }, + { id: 'rowNumber', title: '일련번호' }, + // { id: 'sbmrgPrevntBizSn', title: '일련번호' }, { id: 'sbmrgPrevntBizNm', title: '파일명' }, { id: 'mngYr', title: '년도' }, { id: 'mngQu', title: '분기' }, @@ -8,7 +9,8 @@ export const tableHeadlist = [ ] export const tableHeadlistOldPp = [ - { id: 'dcrpPplMtncBizSn', title: '일련번호' }, + { id: 'rowNumber', title: '일련번호' }, + // { id: 'dcrpPplMtncBizSn', title: '일련번호' }, { id: 'dcrpPplMtncBizNm', title: '파일명' }, { id: 'mngYr', title: '년도' }, { id: 'mngQu', title: '분기' }, diff --git a/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx b/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx index c4bac35b7..5236e1c17 100644 --- a/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx +++ b/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx @@ -38,9 +38,13 @@ const Page = () => { page: curPage - 1, size: '10' }) - setTableData(data) + // 일련번호를 추가한 데이터로 변환 (전체 데이터 기준으로 일련번호 계산) + const dataWithRowNumber = (data || []).map((item: any, index: number) => ({ + ...item, + rowNumber: (curPage - 1) * 10 + index + 1, // 페이지 기준 일련번호 계산 + })); + setTableData(dataWithRowNumber) setTotalData(total) - console.log(data, total) } catch (error) { console.error('Error fetching data:', error) } finally { @@ -50,6 +54,7 @@ const Page = () => { setIsLoading(false) } } + useEffect(() => { setCurPage(1) fetchData()