diff --git a/src/pages/app/priceManagement.vue b/src/pages/app/priceManagement.vue
index d1ab70c..3320660 100644
--- a/src/pages/app/priceManagement.vue
+++ b/src/pages/app/priceManagement.vue
@@ -12,14 +12,17 @@ onBeforeMount(async () => {
const masks = ref({
modelValue: 'YYYY-MM-DD',
})
+
+const totalItems = ref(0) // 전체 아이템 수
+const currentPage = ref(0) // 현재 페이지
+const itemsPerPage = 8
+
const searchParamsList = reactive({
cateCd : '', //분야코드
stCd : '', //등록상태
regNm : '', //담당자
regSdt: '',//등록시작일
regEdt: '',//등록종료일
- page: 1,//페이지
- row: 5 //아이템갯수
})
const params = reactive({
sessionUser:'',
@@ -40,20 +43,27 @@ async function getPriceListData(){
before30.setDate(today.getDate() - 30)
const after30 = new Date()
- after30.setDate(today.getDate() + 30)
+ after30.setDate(today.getDate())
const priceBase = {
params:{
regSdt: formatDatefromObject(before30),
regEdt: formatDatefromObject(after30),
- page: searchParamsList.page,
- row: searchParamsList.row
+ page: Number.parseInt(route.query.page as string) || 1,
+ row: 10
}
}
const result = await getPriceList(priceBase)
params.priceData = result.content
+ //페이지 관련 값 설정
+ currentPage.value = result.pageable.pageNumber + 1
+ totalItems.value = result.totalElements
+ console.log("currentPage.value",currentPage.value)
+ console.log("totalItems.value",totalItems.value)
}
+const route = useRoute()
const searchPrice = async () => {
+
const searchParams = {
params: {
cateCd : searchParamsList.cateCd, //분야코드
@@ -61,12 +71,20 @@ const searchPrice = async () => {
regNm : searchParamsList.regNm, //담당자
regSdt: formatDatefromString(searchParamsList.regSdt),//등록시작일
regEdt: formatDatefromString(searchParamsList.regEdt),//등록종료일
- page: 1,//페이지
- row: 3 //아이템갯수
+ page: Number.parseInt(route.query.page as string) || 1,//페이지
+ row: 10 //아이템갯수
}
}
+ console.log("searchParams", Number.parseInt(route.query.page as string))
const result = await getPriceList(searchParams)
params.priceData = result.content
+ currentPage.value = null
+ totalItems.value = null
+ //페이지 관련 값 설정
+ currentPage.value = result.pageable.pageNumber + 1
+ totalItems.value = result.totalElements
+ console.log("currentPage.value",currentPage.value)
+ console.log("totalItems.value",totalItems.value)
}
function getPriceDetail(){
@@ -77,6 +95,10 @@ function getPriceDetail(){
router.push({ path: '/app/priceDetail', state: { key: arguments[0].prcsNo }})
}
}
+
+watch(() => route.query.page, (newPage) => {
+ searchPrice()
+})
@@ -115,6 +137,7 @@ function getPriceDetail(){
v-model="searchParamsList.regNm"
class="input custom-text-filter"
placeholder="담당자"
+ @keydown.enter="searchPrice"
>
@@ -211,7 +234,14 @@ function getPriceDetail(){
등록
+
+