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()