diff --git a/public/img/main-category-img/main-300201.png b/public/img/main-category-img/main-300201.png new file mode 100644 index 0000000..9e99e0f Binary files /dev/null and b/public/img/main-category-img/main-300201.png differ diff --git a/public/img/main-category-img/main-300202.png b/public/img/main-category-img/main-300202.png new file mode 100644 index 0000000..aaf6a0e Binary files /dev/null and b/public/img/main-category-img/main-300202.png differ diff --git a/public/img/main-category-img/main-300203.png b/public/img/main-category-img/main-300203.png new file mode 100644 index 0000000..4d53c85 Binary files /dev/null and b/public/img/main-category-img/main-300203.png differ diff --git a/public/img/main-category-img/main-300204.png b/public/img/main-category-img/main-300204.png new file mode 100644 index 0000000..89a2bb3 Binary files /dev/null and b/public/img/main-category-img/main-300204.png differ diff --git a/public/img/main-category-img/main-300205.png b/public/img/main-category-img/main-300205.png new file mode 100644 index 0000000..26c60d9 Binary files /dev/null and b/public/img/main-category-img/main-300205.png differ diff --git a/public/img/main-category-img/main-300206.png b/public/img/main-category-img/main-300206.png new file mode 100644 index 0000000..0b1a5c7 Binary files /dev/null and b/public/img/main-category-img/main-300206.png differ diff --git a/src/common/common.js b/src/common/common.js index 24dcf2d..89a0f7a 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -47,11 +47,11 @@ const common = { * * @param {string} dateStr * @return - * 1. Date type 인 경우 예시 '25-02-24 12:02' + * 1. Date type 인 경우 예시 '2025-02-24 12:02' * 2. Date type 이 아닌 경우 입력값 리턴 * */ - dateFormatter(dateStr) { + dateFormatter(dateStr, type = null) { const date = new Date(dateStr); const dateCheck = date.getTime(); @@ -59,13 +59,26 @@ const common = { return dateStr; } else { const { year, month, day, hours, minutes } = this.formatDateTime(date); - return `${year}-${month}-${day} ${hours}:${minutes}`; + let callback = ''; + + if (type == 'YMD') { + callback = `${year}-${month}-${day}`; + } else if (type == 'MD') { + callback = `${month}-${day}`; + } else { + callback = `${year}-${month}-${day} ${hours}:${minutes}`; + } + + return callback; } }, - formatDateTime(date) { - const zeroFormat = num => (num < 10 ? `0${num}` : num); + formatDateTime(dateObj) { + const date = new Date(dateObj); + const dateCheck = date.getTime(); + if (isNaN(dateCheck)) return dateObj; + const zeroFormat = num => (num < 10 ? `0${num}` : num); return { year: date.getFullYear(), month: zeroFormat(date.getMonth() + 1), @@ -76,6 +89,34 @@ const common = { }; }, + // 오늘 날짜시간 조회 + getToday() { + const date = new Date(); + return { + year: date.getFullYear(), + month: date.getMonth() + 1, + day: date.getDate(), + hours: date.getHours(), + minutes: date.getMinutes(), + seconds: date.getSeconds(), + }; + }, + + // 해당 월, 일에 맞는 목록 필터링 + filterTargetByDate(target, key, month, day) { + if (!Array.isArray(target) || target.length === 0) return []; + + return [...target].filter(item => { + if (!item[key]) return false; + + const date = new Date(item[key]); + const MatchingMonth = date.getMonth() + 1 === parseInt(month, 10); + const MatchingDay = date.getDate() === parseInt(day, 10); + + return MatchingMonth && MatchingDay; + }); + }, + /** * 빈값 확인 * @@ -83,9 +124,17 @@ const common = { * @returns */ isNotEmpty(obj) { - if (obj === null || obj === undefined) return false; - if (typeof obj === 'string' && obj.trim() === '') return false; - if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) return false; + if (obj === null || obj === undefined) { + return false; + } + + if (typeof obj === 'string' && obj.trim() === '') { + return false; + } + + if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) { + return false; + } return true; }, @@ -139,6 +188,17 @@ const common = { showImage(event) { return (event.target.style.visibility = 'visible'); }, + + addHyphenToPhoneNumber(phoneNum) { + const phoneNumber = phoneNum; + const length = phoneNumber.length; + + if (length >= 9) { + return phoneNumber.replace(/[^0-9]/g, '').replace(/^(\d{2,3})(\d{3,4})(\d{4})$/, `$1-$2-$3`); + } else { + return phoneNum; + } + }, }; export default { diff --git a/src/components/main/EventModal.vue b/src/components/main/EventModal.vue new file mode 100644 index 0000000..82be55a --- /dev/null +++ b/src/components/main/EventModal.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/components/main/MainEventCalendar.vue b/src/components/main/MainEventCalendar.vue new file mode 100644 index 0000000..bc06eb1 --- /dev/null +++ b/src/components/main/MainEventCalendar.vue @@ -0,0 +1,585 @@ + + + + diff --git a/src/components/main/MainEventList.vue b/src/components/main/MainEventList.vue new file mode 100644 index 0000000..05fcbfe --- /dev/null +++ b/src/components/main/MainEventList.vue @@ -0,0 +1,122 @@ + + + diff --git a/src/components/main/MainMemberProfile.vue b/src/components/main/MainMemberProfile.vue new file mode 100644 index 0000000..357b4b3 --- /dev/null +++ b/src/components/main/MainMemberProfile.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/components/main/MemberManagement.vue b/src/components/main/MemberManagement.vue new file mode 100644 index 0000000..f2be48a --- /dev/null +++ b/src/components/main/MemberManagement.vue @@ -0,0 +1,63 @@ + + + diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 0760a82..8a42f0f 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -1,1192 +1,26 @@ + import MainEventCalendar from '@/components/main/MainEventCalendar.vue'; + import MemberManagement from '@/components/main/MemberManagement.vue'; + import { useUserInfoStore } from '@/stores/useUserInfoStore'; + import { inject, onMounted, ref } from 'vue'; + import $api from '@api'; - + const userStore = useUserInfoStore(); + const user = ref(); + + const isAdmin = user => { + return user.value.role === 'ROLE_ADMIN' ? true : false; + }; + + onMounted(async () => { + await userStore.userInfo(); + user.value = userStore.user; + }); +