From 4daab961cf283a4a887d9476882cb28006a29199 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 11 Feb 2025 15:03:25 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=ED=9C=B4=EA=B0=80=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/button/HalfDayButtons.vue | 43 ++ src/components/vacation/ProfileList.vue | 187 ++++++++ src/stores/userList.js | 1 - src/views/vacation/AddEventModal.vue | 37 -- src/views/vacation/ProfileList.vue | 56 --- src/views/vacation/VacationManagement.vue | 527 +++++++++++----------- 6 files changed, 492 insertions(+), 359 deletions(-) create mode 100644 src/components/button/HalfDayButtons.vue create mode 100644 src/components/vacation/ProfileList.vue delete mode 100644 src/views/vacation/AddEventModal.vue delete mode 100644 src/views/vacation/ProfileList.vue diff --git a/src/components/button/HalfDayButtons.vue b/src/components/button/HalfDayButtons.vue new file mode 100644 index 0000000..2dc31e0 --- /dev/null +++ b/src/components/button/HalfDayButtons.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/components/vacation/ProfileList.vue b/src/components/vacation/ProfileList.vue new file mode 100644 index 0000000..32e7ce0 --- /dev/null +++ b/src/components/vacation/ProfileList.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/src/stores/userList.js b/src/stores/userList.js index 767e711..b32d0b3 100644 --- a/src/stores/userList.js +++ b/src/stores/userList.js @@ -16,7 +16,6 @@ export const useUserStore = defineStore("userStore", { actions: { async fetchUserList() { const response = await axios.get('user/allUserList'); - console.log('response',response) this.userList = response.data.data.allUserList; this.userInfo = response.data.data.user; diff --git a/src/views/vacation/AddEventModal.vue b/src/views/vacation/AddEventModal.vue deleted file mode 100644 index 321c9e7..0000000 --- a/src/views/vacation/AddEventModal.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/src/views/vacation/ProfileList.vue b/src/views/vacation/ProfileList.vue deleted file mode 100644 index 9f729d4..0000000 --- a/src/views/vacation/ProfileList.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - - - diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index ec7db60..47cc56c 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -1,301 +1,298 @@ + - +/** + * 공휴일 데이터 요청 및 이벤트 변환 + */ +async function fetchHolidays(year, month) { +try { + const response = await axios.get(`vacation/${year}/${month}`); + const holidayEvents = response.data.map((holiday) => ({ + title: holiday.name, + start: holiday.date, // "YYYY-MM-DD" 형식 + backgroundColor: "#ff6666", + classNames: ["holiday-event"], + })); + return holidayEvents; +} catch (error) { + console.error("공휴일 정보를 불러오지 못했습니다.", error); + return []; +} +} + +/** + * 달력 월 변경 시 호출 (FullCalendar의 datesSet 옵션) + */ +function handleMonthChange(viewInfo) { +const currentDate = viewInfo.view.currentStart; +const year = currentDate.getFullYear(); +const month = String(currentDate.getMonth() + 1).padStart(2, "0"); +loadCalendarData(year, month); +} + +/** + * 지정한 월의 데이터를 로드 (휴가, 공휴일 데이터를 병렬 요청) + */ +async function loadCalendarData(year, month) { +fetchedEvents.value = []; +const [vacationEvents, holidayEvents] = await Promise.all([ + fetchVacationData(year, month), + fetchHolidays(year, month), +]); +// 클릭 불가 처리를 위해 공휴일 날짜 Set 업데이트 +holidayDates.value = new Set(holidayEvents.map((event) => event.start)); +fetchedEvents.value = [...vacationEvents, ...holidayEvents]; +updateCalendarEvents(); +await nextTick(); +fullCalendarRef.value.getApi().refetchEvents(); +} + +// 컴포넌트 마운트 시 현재 달의 데이터 로드 +onMounted(async () => { +await fetchUserList(); // 사용자 목록 먼저 불러오기 +const today = new Date(); +const year = today.getFullYear(); +const month = String(today.getMonth() + 1).padStart(2, "0"); +await loadCalendarData(year, month); +}); + From e4455e94e562edfc1213de23e2f10cd4ff752d3e Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 11 Feb 2025 16:18:05 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=ED=9C=B4=EA=B0=80=20=EC=82=AC=EC=9B=90?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/vacation/ProfileList.vue | 103 +++++++++++++++------- src/views/vacation/VacationManagement.vue | 14 ++- 2 files changed, 74 insertions(+), 43 deletions(-) diff --git a/src/components/vacation/ProfileList.vue b/src/components/vacation/ProfileList.vue index 32e7ce0..b7947a9 100644 --- a/src/components/vacation/ProfileList.vue +++ b/src/components/vacation/ProfileList.vue @@ -12,7 +12,7 @@ @click="toggleDisable(index)" data-bs-toggle="tooltip" data-popup="tooltip-custom" - data-bs-placement="top" + data-bs-placement="bottom" :aria-label="user.MEMBERSEQ" :data-bs-original-title="getTooltipTitle(user)" > @@ -41,11 +41,10 @@ const emit = defineEmits(); const userStore = useUserStore(); const userList = ref([]); - const userListContainer = ref(null); // 프로필 목록 컨테이너 참조 + const userListContainer = ref(null); const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ""); - const defaultProfile = "/img/icons/icon.png"; // 기본 이미지 경로 + const defaultProfile = "/img/icons/icon.png"; - // ✅ 사용자 목록 호출 onMounted(async () => { await userStore.fetchUserList(); userList.value = userStore.userList; @@ -57,77 +56,78 @@ }); }); - // ✅ 프로필 이미지 경로 반환 const getUserProfileImage = (profilePath) => { return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile; }; - // ✅ 이미지 로딩 오류 처리 const setDefaultImage = (event) => { event.target.src = defaultProfile; }; - // ✅ 이미지 로드 후 깜빡임 방지 const showImage = (event) => { event.target.style.visibility = "visible"; }; - // ✅ 툴팁 타이틀 설정 const getTooltipTitle = (user) => { return user.MEMBERSEQ === userList.value.MEMBERSEQ ? "나" : user.MEMBERNAM; }; - // ✅ 좌우 스크롤 이동 기능 추가 (한 줄씩 이동) + const scrollAmount = 9 * 100; + const scrollLeft = () => { - userListContainer.value.scrollBy({ left: -userListContainer.value.clientWidth, behavior: "smooth" }); + userListContainer.value.scrollBy({ left: -scrollAmount, behavior: "smooth" }); }; const scrollRight = () => { - userListContainer.value.scrollBy({ left: userListContainer.value.clientWidth, behavior: "smooth" }); + userListContainer.value.scrollBy({ left: scrollAmount, behavior: "smooth" }); }; diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index 47cc56c..f267dc0 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -5,23 +5,19 @@
+
+
- - - - - -
From cfa46c0a6d3f074ca3d58e4fef71e47ed50837c6 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Thu, 13 Feb 2025 11:54:38 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=EA=B0=9C=EB=B0=9C=EC=9A=A9=EB=8F=84?= =?UTF-8?q?=EC=9D=98=20=EC=BF=A0=ED=82=A4=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 5 +++++ src/common/axios-interceptor.js | 17 ++++++++-------- src/components/user/LoginForm.vue | 32 +++++++++++++++---------------- 3 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 .env.dev diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..99081c1 --- /dev/null +++ b/.env.dev @@ -0,0 +1,5 @@ +VITE_DOMAIN = http://localhost:5173/ +# VITE_LOGIN_URL = http://localhost:10325/ms/ +# VITE_FILE_URL = http://localhost:10325/ms/ +# VITE_API_URL = http://localhost:10325/api/ +VITE_API_URL = http://localhost:10325/test/ \ No newline at end of file diff --git a/src/common/axios-interceptor.js b/src/common/axios-interceptor.js index 05f3abd..a6ae5a1 100644 --- a/src/common/axios-interceptor.js +++ b/src/common/axios-interceptor.js @@ -1,12 +1,12 @@ -import axios from "axios"; +import axios from 'axios'; import { useRoute } from 'vue-router'; import { useToastStore } from '@s/toastStore'; const $api = axios.create({ baseURL: 'http://localhost:10325/api/', timeout: 300000, - withCredentials : true -}) + withCredentials: true, +}); /** * Default Content-Type : json @@ -14,7 +14,6 @@ const $api = axios.create({ */ $api.interceptors.request.use( function (config) { - let contentType = 'application/json'; if (config.isFormData) contentType = 'multipart/form-data'; @@ -23,21 +22,21 @@ $api.interceptors.request.use( config.headers['X-Requested-With'] = 'XMLHttpRequest'; return config; - }, function (error) { + }, + function (error) { // 요청 오류가 있는 작업 수행 return Promise.reject(error); - } + }, ); // 응답 인터셉터 추가하기 $api.interceptors.response.use( - function (response) { // 2xx 범위의 응답 처리 return response; }, function (error) { - const toastStore = useToastStore() + const toastStore = useToastStore(); const currentPage = error.config.headers['X-Page-Route']; // 오류 응답 처리 if (error.response) { @@ -70,7 +69,7 @@ $api.interceptors.response.use( } return Promise.reject(error); - } + }, ); export default $api; diff --git a/src/components/user/LoginForm.vue b/src/components/user/LoginForm.vue index 55b1e4a..48a3c77 100644 --- a/src/components/user/LoginForm.vue +++ b/src/components/user/LoginForm.vue @@ -1,14 +1,7 @@