feat: 노후 하수관로, 침입수 분석 페이지 일련번호 수정
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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: '분기' },
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user