From f8f9d0cf1f2bd8915cfb511c1804d8e765b1324e Mon Sep 17 00:00:00 2001 From: suemini <121214637+suemini@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:12:21 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Feat=20:=20=EC=8B=A0=EA=B3=A0=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=EA=B8=B0=EB=8A=A5=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/components/admin/adminQuizPage.vue | 6 +- src/components/admin/adminReportPage.vue | 335 ++++++++++++++++++++++- src/main.js | 6 +- 3 files changed, 337 insertions(+), 10 deletions(-) diff --git a/src/components/admin/adminQuizPage.vue b/src/components/admin/adminQuizPage.vue index edecee8..c694955 100644 --- a/src/components/admin/adminQuizPage.vue +++ b/src/components/admin/adminQuizPage.vue @@ -36,11 +36,11 @@ - {{ startPage+pg-1 }} ▶︎ diff --git a/src/components/admin/adminReportPage.vue b/src/components/admin/adminReportPage.vue index ad7c70f..ba7a8b6 100644 --- a/src/components/admin/adminReportPage.vue +++ b/src/components/admin/adminReportPage.vue @@ -1,19 +1,344 @@ - Reportlist 입니당~~ + + + + + 전체 + UNRANKED + + + + + + + + + + + {{ report.reportNo }} + {{ formatReportType(report.reportType) }} + {{ formatDate(report.reportDate) }} + {{ report.memberName }} + 조회 + + + + + ◀ + + {{ startPage + pg }} + + ▶︎ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index c7dba49..0009c42 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,8 @@ const app = createApp(App) app.use(router) app.component('font-awesome-icon', FontAwesomeIcon) app.mount('#app') -app.config.globalProperties.backURL = 'http://192.168.3.113:8881/codesparring' -app.config.globalProperties.socketURL = 'ws://192.168.3.113:8881/codesparring/ws/session' +// app.config.globalProperties.backURL = 'http://192.168.3.113:8881/codesparring' +// app.config.globalProperties.socketURL = 'ws://192.168.3.113:8881/codesparring/ws/session' +app.config.globalProperties.backURL = 'http://192.168.0.25:8881/codesparring' +app.config.globalProperties.socketURL = 'ws://192.168.0.25:8881/codesparring/ws/session' From bd5ed43e27ce4239cadf693117452690f375f68a Mon Sep 17 00:00:00 2001 From: suemini <121214637+suemini@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:10:00 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20:=20=EC=8B=A0=EA=B3=A0=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=B6=9C=EB=A0=A5=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/admin/adminQuizPage.vue | 631 +++++++++++------------ src/components/admin/adminReportPage.vue | 106 ++-- src/main.js | 8 +- 3 files changed, 363 insertions(+), 382 deletions(-) diff --git a/src/components/admin/adminQuizPage.vue b/src/components/admin/adminQuizPage.vue index c694955..f97a207 100644 --- a/src/components/admin/adminQuizPage.vue +++ b/src/components/admin/adminQuizPage.vue @@ -1,336 +1,335 @@ - - - - - 전체 - UNRANKED - - - - - - + + + + + 전체 + UNRANKED - - - + + + + - - - - {{ q.quizNo }} - {{ q.quizTier }} - {{ q.quizTitle }} - {{ q.quizCorrectPercent }} - 조회 - - - - - ◀ - - {{ startPage+pg}} - ▶︎ + + + + + + + + + {{ q.quizNo }} + {{ q.quizTier }} + {{ q.quizTitle }} + {{ q.quizCorrectPercent }} + 조회 - - - - - \ No newline at end of file +} + +.page-bt-num.current-page { + opacity: 100%; + cursor: default; +} + diff --git a/src/components/admin/adminReportPage.vue b/src/components/admin/adminReportPage.vue index ba7a8b6..6dc1410 100644 --- a/src/components/admin/adminReportPage.vue +++ b/src/components/admin/adminReportPage.vue @@ -1,36 +1,38 @@ - - - 전체 - UNRANKED + + + 전체 + UNRANKED - - - + + + - + {{ report.reportNo }} {{ formatReportType(report.reportType) }} {{ formatDate(report.reportDate) }} {{ report.memberName }} - 조회 + 조회 - + {{ totalPage }} : {{ startPage }} : {{ endPage }} + ◀ - - {{ startPage + pg }} + + {{ startPage + pg -1 }} - ▶︎ + ▶︎ @@ -54,9 +56,9 @@ export default { mounted() { const filter = this.$route.params.filter if (filter == 'all') { - const onBt = document.getElementById('quiz-all') + const onBt = document.getElementById('report-all') onBt.style.opacity = '100%' - const offBt = document.getElementById('quiz-urk') + const offBt = document.getElementById('report-urk') offBt.style.opacity = '50%' this.popup = false @@ -65,26 +67,25 @@ export default { text.value = '' this.currentPage = this.$route.params.currentPage - const url = `${this.backURL}/report/date?page=${this.currentPage - 1}` axios .get(url) .then((res) => { - console.log(res.data.list) - console.log('Response Status:', res.status); - this.reportList = res.data.list - this.startPage = res.data.startPage - this.endPage = res.data.endPage - this.totalPage = res.data.totalPage + console.log(res.data) + this.reportList = res.data.content + this.totalPage = res.data.totalPages + alert(this.totalPage) + this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1; + this.endPage = Math.ceil(res.data.totalElements / 10); }) .catch((error) => { console.error('Error fetching reports:', error.message); alert('신고목록을 조회할 수 없습니다') }) } else if (filter == 'UNRANKED') { - const onBt = document.getElementById('quiz-urk') + const onBt = document.getElementById('report-urk') onBt.style.opacity = '100%' - const offBt = document.getElementById('quiz-all') + const offBt = document.getElementById('report-all') offBt.style.opacity = '50%' this.popup = false @@ -97,10 +98,11 @@ export default { axios .get(url) .then((res) => { - this.reportList = res.data.list - this.startPage = res.data.startPage - this.endPage = res.data.endPage - this.totalPage = res.data.totalPage + this.reportList = res.data.content + this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1; + this.endPage = Math.ceil(res.data.totalElements / 10); + this.totalPage = res.data.totalPages; + }) .catch(() => { window.history.back() @@ -108,13 +110,13 @@ export default { } }, methods: { - allquiz() { - location.href = '/admin/report/all/1' + allReport() { + location.href = '/admin/report/date/1' }, - urkquiz() { + urkReport() { location.href = '/admin/report/UNRANKED/1' }, - searchQuiz(e) { + searchReport(e) { if (this.popup) { if (e.target.id == 'search-icon') return const onBt = document.getElementById('quiz-all') @@ -130,36 +132,20 @@ export default { } } }, - // fetchReports() { - // console.log('리포트를 불러오는 중...'); - // axios - // .get(`${this.backURL}/report/date?page=${this.currentPage - 1}`) - // .then((response) => { - // console.log('데이터를 받았습니다:', response.data); - // this.reportList = response.data; - // this.updatePagination(); - // }) - // .catch((error) => { - // console.error("Error fetching reports:", error); - // }); - // }, pgClick(e) { const pg = parseInt(e.target.id.replace("pg", "")); this.currentPage = pg; - // location.href = '/admin/report/all/' + this.currentPage const filter = this.$route.params.filter location.href = '/admin/report/' + filter + '/' + this.currentPage }, pgPrevClick() { this.currentPage = Math.floor(((this.currentPage - 1) / 5)) * 5 - // location.href = '/admin/report/all/' + this.currentPage const filter = this.$route.params.filter location.href = '/admin/report/' + filter + '/' + this.currentPage }, pgNextClick() { if (this.currentPage == 1) this.currentPage = 2 this.currentPage = (Math.floor(((this.currentPage - 1) / 5)) + 1) * 5 + 1 - // location.href = '/admin/report/all/' + this.currentPage const filter = this.$route.params.filter location.href = '/admin/report/' + filter + '/' + this.currentPage }, @@ -168,10 +154,6 @@ export default { location.href = '/report/' + e.target.id }, - // updatePagination() { - // this.startPage = Math.max(1, this.currentPage - 2); - // this.endPage = Math.min(this.totalPage, this.currentPage + 2); - // }, formatDate(reportDate) { const date = new Date(reportDate); const formattedDate = date.toLocaleDateString('ko-KR', { @@ -201,17 +183,17 @@ export default { text-align: center; } -#quiz-header { +#report-header { display: flex; justify-content: space-between; } -#quiz-filter { +#report-filter { margin-left: 10px; margin-top: 8px; } -.quiz-opt { +.report-opt { padding: 4px; border: none; background-color: var(--main1-color); @@ -223,11 +205,11 @@ export default { } } -#quiz-urk { +#report-urk { opacity: 50%; } -#quiz-search-box { +#report-search-box { margin-right: 8px; display: flex; align-items: center; @@ -265,7 +247,7 @@ input[type='number']::-webkit-inner-spin-button { margin: 0; } -.quiz-content { +.report-content { width: 100%; height: 77%; margin-top: 25px; @@ -304,7 +286,7 @@ input[type='number']::-webkit-inner-spin-button { display: inline-block; } -.quiz-info-bt { +.report-info-bt { width: 10%; background-color: var(--main4-color); border: 2px solid var(--main4-color); @@ -317,7 +299,7 @@ input[type='number']::-webkit-inner-spin-button { } } -#quiz-page { +#report-page { margin-top: 22px; } diff --git a/src/main.js b/src/main.js index 0009c42..1285308 100644 --- a/src/main.js +++ b/src/main.js @@ -26,8 +26,8 @@ const app = createApp(App) app.use(router) app.component('font-awesome-icon', FontAwesomeIcon) app.mount('#app') -// app.config.globalProperties.backURL = 'http://192.168.3.113:8881/codesparring' -// app.config.globalProperties.socketURL = 'ws://192.168.3.113:8881/codesparring/ws/session' +app.config.globalProperties.backURL = 'http://192.168.1.116:8881/codesparring' +app.config.globalProperties.socketURL = 'ws://192.168.1.116:8881/codesparring/ws/session' -app.config.globalProperties.backURL = 'http://192.168.0.25:8881/codesparring' -app.config.globalProperties.socketURL = 'ws://192.168.0.25:8881/codesparring/ws/session' +// app.config.globalProperties.backURL = 'http://192.168.0.25:8881/codesparring' +// app.config.globalProperties.socketURL = 'ws://192.168.0.25:8881/codesparring/ws/session' From b6fe70b27489e2716747707c721833660f551298 Mon Sep 17 00:00:00 2001 From: suemini <121214637+suemini@users.noreply.github.com> Date: Thu, 14 Dec 2023 09:26:18 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Comment=20:=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 1285308..ec5c3a8 100644 --- a/src/main.js +++ b/src/main.js @@ -27,7 +27,4 @@ app.use(router) app.component('font-awesome-icon', FontAwesomeIcon) app.mount('#app') app.config.globalProperties.backURL = 'http://192.168.1.116:8881/codesparring' -app.config.globalProperties.socketURL = 'ws://192.168.1.116:8881/codesparring/ws/session' - -// app.config.globalProperties.backURL = 'http://192.168.0.25:8881/codesparring' -// app.config.globalProperties.socketURL = 'ws://192.168.0.25:8881/codesparring/ws/session' +app.config.globalProperties.socketURL = 'ws://192.168.1.116:8881/codesparring/ws/session' \ No newline at end of file