From 2244a525b34111453e773d7c40ea198df2aeef97 Mon Sep 17 00:00:00 2001 From: Jaybe Date: Mon, 9 Jun 2025 16:12:59 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/adminRoutes.js | 2 +- frontend/src/components/event/EventDialog.vue | 6 +- .../src/components/event/FileUploadDialog.vue | 4 +- frontend/src/main.js | 4 +- frontend/src/utils/enumMappings.js | 87 ++++++++++++++++--- .../views/admin/SubscriptionManagement.vue | 64 ++------------ frontend/src/views/admin/UserManagement.vue | 85 ++---------------- frontend/src/views/club/EventManagement.vue | 2 +- 8 files changed, 98 insertions(+), 156 deletions(-) diff --git a/backend/routes/adminRoutes.js b/backend/routes/adminRoutes.js index 27529fe..3fd3045 100644 --- a/backend/routes/adminRoutes.js +++ b/backend/routes/adminRoutes.js @@ -325,7 +325,7 @@ router.get('/features/stats', async (req, res) => { router.get('/users', async (req, res) => { try { const users = await User.findAll({ - attributes: ['id', 'name', 'email', 'role', 'createdAt'], + attributes: ['id', 'name', 'email', 'role', 'status', 'createdAt'], order: [['createdAt', 'DESC']] }); diff --git a/frontend/src/components/event/EventDialog.vue b/frontend/src/components/event/EventDialog.vue index 8a79dcf..7953202 100644 --- a/frontend/src/components/event/EventDialog.vue +++ b/frontend/src/components/event/EventDialog.vue @@ -33,13 +33,13 @@
- + 시작일은 필수입니다.
- + 종료일은 필수입니다.
@@ -65,7 +65,7 @@
- +
diff --git a/frontend/src/components/event/FileUploadDialog.vue b/frontend/src/components/event/FileUploadDialog.vue index bb70231..cd351e4 100644 --- a/frontend/src/components/event/FileUploadDialog.vue +++ b/frontend/src/components/event/FileUploadDialog.vue @@ -274,7 +274,7 @@
- - ({ ...acc, [cur.value]: cur.name }), + {} +); + +export function getRoleName(role) { + return ROLE_LABELS[role] || role; +} export const GENDER_OPTIONS = [ { name: '남성', value: 'male' }, @@ -93,33 +106,60 @@ export const AVERAGE_CALCULATION_PERIOD_LABELS = AVERAGE_CALCULATION_PERIOD_OPTI {} ); +export const CLUB_STATUS_OPTIONS = [ + { name: '활성', value: 'active' }, + { name: '비활성', value: 'inactive' } +]; +export const CLUB_STATUS_LABELS = CLUB_STATUS_OPTIONS.reduce( + (acc, cur) => ({ ...acc, [cur.value]: cur.name }), + {} +); + +export const SUBSCRIPTION_STATUS_OPTIONS = [ + { name: '활성', value: 'active' }, + { name: '만료', value: 'expired' }, + { name: '일시중지', value: 'paused' } +]; +export const SUBSCRIPTION_STATUS_LABELS = SUBSCRIPTION_STATUS_OPTIONS.reduce( + (acc, cur) => ({ ...acc, [cur.value]: cur.name }), + {} +); + export function getGenderLabel(code) { - return GENDER_LABELS[code] || '-'; + return GENDER_LABELS[code] || code; } export function getMemberTypeLabel(code) { - return MEMBER_TYPE_LABELS[code] || '-'; + return MEMBER_TYPE_LABELS[code] || code; } export function getStatusLabel(code) { - return STATUS_LABELS[code] || '-'; + return STATUS_LABELS[code] || code; } export function getParticipantStatusLabel(code) { - return PARTICIPANT_STATUS_LABELS[code] || '-'; + return PARTICIPANT_STATUS_LABELS[code] || code; } export function getEventStatusLabel(code) { - return EVENT_STATUS_LABELS[code] || '-'; + return EVENT_STATUS_LABELS[code] || code; } export function getEventTypeLabel(code) { - return EVENT_TYPE_LABELS[code] || '-'; + return EVENT_TYPE_LABELS[code] || code; } export function getPaymentStatusLabel(code) { - return PAYMENT_STATUS_LABELS[code] || '-'; + return PAYMENT_STATUS_LABELS[code] || code; } export function getAverageCalculationPeriodLabel(code) { - return AVERAGE_CALCULATION_PERIOD_LABELS[code] || '-'; + return AVERAGE_CALCULATION_PERIOD_LABELS[code] || code; +} + +export function getClubStatusLabel(code) { + return CLUB_STATUS_LABELS[code] || code; +} + +export function getSubscriptionStatusLabel(code) { + return SUBSCRIPTION_STATUS_LABELS[code] || code; } export function getMemberTypeSeverity(type) { @@ -174,4 +214,31 @@ export function getParticipantStatusSeverity(status) { case 'canceled': return 'danger'; default: return 'secondary'; } -} \ No newline at end of file +} + +export function getRoleSeverity(role) { + switch (role) { + case 'admin': return 'danger'; + case 'clubadmin': return 'warning'; + case 'user': return 'info'; + default: return 'info'; + } +} + +export function getClubStatusSeverity(status) { + switch (status) { + case 'active': return 'success'; + case 'inactive': return 'danger'; + default: return 'secondary'; + } +} + +export function getSubscriptionStatusSeverity(status) { + switch (status) { + case 'active': return 'success'; + case 'expired': return 'danger'; + case 'paused': return 'warning'; + default: return 'secondary'; + } +} + \ No newline at end of file diff --git a/frontend/src/views/admin/SubscriptionManagement.vue b/frontend/src/views/admin/SubscriptionManagement.vue index 0b4d73d..b074be6 100644 --- a/frontend/src/views/admin/SubscriptionManagement.vue +++ b/frontend/src/views/admin/SubscriptionManagement.vue @@ -77,7 +77,7 @@ @@ -126,7 +126,7 @@
- +