fix : 페이징 에러 수정 완료

This commit is contained in:
Yesol Choi
2025-05-29 09:19:42 +09:00
parent bca114c082
commit 0f4e962def

View File

@@ -52,12 +52,21 @@ async function getPriceListData(){
} }
const result = await getPriceList(priceBase) const result = await getPriceList(priceBase)
params.priceData = result.content params.priceData = result.content
console.log("result",result)
//페이지 관련 값 설정 //페이지 관련 값 설정
totalItems.value = result.totalElements totalItems.value = result.totalElements
totalPages.value = result.totalPages totalPages.value = result.totalPages
} }
const searchPrice = async (item) => { const searchPrice = async (item) => {
let itemPerChangePage;
if(item == totalPages.value){
itemPerChangePage = totalItems.value / totalPages.value == 0? itemsPerPage : totalItems.value % itemsPerPage
}else{
itemPerChangePage = itemsPerPage
}
const searchParams = { const searchParams = {
params: { params: {
cateCd : searchParamsList.cateCd, //분야코드 cateCd : searchParamsList.cateCd, //분야코드
@@ -66,7 +75,7 @@ const searchPrice = async (item) => {
regSdt: formatDatefromString(searchParamsList.regSdt),//등록시작일 regSdt: formatDatefromString(searchParamsList.regSdt),//등록시작일
regEdt: formatDatefromString(searchParamsList.regEdt),//등록종료일 regEdt: formatDatefromString(searchParamsList.regEdt),//등록종료일
page: item,//페이지 page: item,//페이지
row: itemsPerPage //아이템갯수 row: itemPerChangePage //아이템갯수
} }
} }
const result = await getPriceList(searchParams) const result = await getPriceList(searchParams)