From 3dff71046d2779626cdc244e2fb1897f9f0b2080 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 5 Mar 2026 14:23:51 +0900 Subject: [PATCH] =?UTF-8?q?feat(calculate):=20=EC=A0=95=EC=82=B0=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20API=20=EB=B0=8F=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/calculate.js | 12 +++++----- src/views/Calculate/CalculateContent.vue | 22 +++++++++++++++++-- .../Calculate/CalculateContentDonation.vue | 22 +++++++++++++++++-- src/views/Calculate/CalculateLive.vue | 22 +++++++++++++++++-- 4 files changed, 66 insertions(+), 12 deletions(-) diff --git a/src/api/calculate.js b/src/api/calculate.js index 36c249d..9493d23 100644 --- a/src/api/calculate.js +++ b/src/api/calculate.js @@ -1,19 +1,19 @@ import Vue from 'vue'; -async function getCalculateLive(startDate, endDate) { - return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate); +async function getCalculateLive(startDate, endDate, page, size) { + return Vue.axios.get('/admin/calculate/live?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size); } -async function getCalculateContent(startDate, endDate) { - return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate); +async function getCalculateContent(startDate, endDate, page, size) { + return Vue.axios.get('/admin/calculate/content-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size); } async function getCumulativeSalesByContent(page, size) { return Vue.axios.get('/admin/calculate/cumulative-sales-by-content?page=' + (page - 1) + "&size=" + size); } -async function getCalculateContentDonation(startDate, endDate) { - return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate); +async function getCalculateContentDonation(startDate, endDate, page, size) { + return Vue.axios.get('/admin/calculate/content-donation-list?startDateStr=' + startDate + '&endDateStr=' + endDate + '&page=' + (page - 1) + '&size=' + size); } async function getCalculateCommunityPost(startDate, endDate, page, size) { diff --git a/src/views/Calculate/CalculateContent.vue b/src/views/Calculate/CalculateContent.vue index 901aa2c..7b379e8 100644 --- a/src/views/Calculate/CalculateContent.vue +++ b/src/views/Calculate/CalculateContent.vue @@ -119,6 +119,16 @@ + + + + + @@ -136,6 +146,9 @@ export default { is_loading: false, start_date: null, end_date: null, + page: 1, + page_size: 20, + total_page: 0, items: [], headers: [ { @@ -260,9 +273,10 @@ export default { this.is_loading = true try { - const res = await api.getCalculateContent(this.start_date, this.end_date) + const res = await api.getCalculateContent(this.start_date, this.end_date, this.page, this.page_size) if (res.status === 200 && res.data.success === true) { - this.items = res.data.data + this.items = res.data.data.items + this.total_page = Math.ceil(res.data.data.totalCount / this.page_size) } else { this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') } @@ -274,6 +288,10 @@ export default { } }, + next() { + this.getCalculateContent() + }, + async downloadExcel() { try { const res = await api.downloadCalculateContentExcel(this.start_date, this.end_date) diff --git a/src/views/Calculate/CalculateContentDonation.vue b/src/views/Calculate/CalculateContentDonation.vue index 7e667e4..b8e1cfa 100644 --- a/src/views/Calculate/CalculateContentDonation.vue +++ b/src/views/Calculate/CalculateContentDonation.vue @@ -111,6 +111,16 @@ + + + + + @@ -128,6 +138,9 @@ export default { is_loading: false, start_date: null, end_date: null, + page: 1, + page_size: 20, + total_page: 0, items: [], headers: [ { @@ -246,9 +259,10 @@ export default { this.is_loading = true try { - const res = await api.getCalculateContentDonation(this.start_date, this.end_date) + const res = await api.getCalculateContentDonation(this.start_date, this.end_date, this.page, this.page_size) if (res.status === 200 && res.data.success === true) { - this.items = res.data.data + this.items = res.data.data.items + this.total_page = Math.ceil(res.data.data.totalCount / this.page_size) } else { this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') } @@ -260,6 +274,10 @@ export default { } }, + next() { + this.getCalculateContentDonation() + }, + async downloadExcel() { try { const res = await api.downloadCalculateContentDonationExcel(this.start_date, this.end_date) diff --git a/src/views/Calculate/CalculateLive.vue b/src/views/Calculate/CalculateLive.vue index 5333f0e..cffb922 100644 --- a/src/views/Calculate/CalculateLive.vue +++ b/src/views/Calculate/CalculateLive.vue @@ -119,6 +119,16 @@ + + + + + @@ -136,6 +146,9 @@ export default { is_loading: false, start_date: null, end_date: null, + page: 1, + page_size: 20, + total_page: 0, items: [], headers: [ { @@ -254,9 +267,10 @@ export default { this.is_loading = true try { - const res = await api.getCalculateLive(this.start_date, this.end_date) + const res = await api.getCalculateLive(this.start_date, this.end_date, this.page, this.page_size) if (res.status === 200 && res.data.success === true) { - this.items = res.data.data + this.items = res.data.data.items + this.total_page = Math.ceil(res.data.data.totalCount / this.page_size) } else { this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') } @@ -268,6 +282,10 @@ export default { } }, + next() { + this.getCalculateLive() + }, + async downloadExcel() { try { const res = await api.downloadCalculateLiveExcel(this.start_date, this.end_date)