From ce1ecb5897e2f949d6e1806dd22541aae43252be Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 21 Feb 2025 16:21:26 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9C=B4=EA=B0=80=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/custom.css | 6 --- src/views/vacation/VacationManagement.vue | 61 ++++++++++++----------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/public/css/custom.css b/public/css/custom.css index 62bc1b9..2a0f0c5 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -16,12 +16,6 @@ .half-day-buttons .btn.active { border: 2px solid black; } - .fc-daygrid-day-frame { - min-height: 80px !important; - max-height: 120px !important; - overflow: hidden !important; - padding-top: 25px !important; - } .fc-daygrid-day-events { max-height: 100px !important; overflow-y: auto !important; diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index 19647f7..4ffa1f8 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -123,30 +123,32 @@ }; // 프로필 클릭 시 연차 내역 가져오기 - const handleProfileClick = async (user) => { - try { - if (user.MEMBERSEQ === userStore.user.id) { - const response = await axios.get(`vacation/history`); - if (response.status === 200 && response.data) { - myVacations.value = response.data.data.usedVacations || []; - receivedVacations.value = response.data.data.receivedVacations || []; - isModalOpen.value = true; - // 모달을 열 때 기준 연도와 기준 월 갱신 - modalYear.value = new Date().getFullYear(); - modalMonth.value = String(new Date().getMonth() + 1).padStart(2, "0"); - isGrantModalOpen.value = false; - } else { - console.warn("❌ 연차 내역을 불러오지 못했습니다."); - } +// 프로필 클릭 시 연차 내역 가져오기 +const handleProfileClick = async (user) => { + try { + if (user.MEMBERSEQ === userStore.user.id) { + const year = new Date().getFullYear(); // 현재 연도 + // 연도 파라미터를 전달하여 전체 연도의 연차 내역을 조회 + const response = await axios.get(`vacation/history?year=${year}`); + if (response.status === 200 && response.data) { + myVacations.value = response.data.data.usedVacations || []; + receivedVacations.value = response.data.data.receivedVacations || []; + isModalOpen.value = true; + // 모달을 열 때 기준 연도 갱신 + modalYear.value = year; + isGrantModalOpen.value = false; } else { - selectedUser.value = user; - isGrantModalOpen.value = true; - isModalOpen.value = false; + console.warn("❌ 연차 내역을 불러오지 못했습니다."); } - } catch (error) { - console.error("🚨 연차 데이터 불러오기 실패:", error); + } else { + selectedUser.value = user; + isGrantModalOpen.value = true; + isModalOpen.value = false; } - }; + } catch (error) { + console.error("🚨 연차 데이터 불러오기 실패:", error); + } +}; const fetchUserList = async () => { try { @@ -186,10 +188,11 @@ }; // computed: modalYear와 일치하는 항목만 필터링 - const filteredMyVacations = computed(() => { +const filteredMyVacations = computed(() => { const filtered = myVacations.value.filter(vac => { - console.log(vac) - const year = vac.date ? vac.date.split("T")[0].substring(0, 4) : null; + // vac.date가 없으면 vac.LOCVACUDT를 사용하도록 함 + const dateStr = vac.date || vac.LOCVACUDT; + const year = dateStr ? dateStr.split("T")[0].substring(0, 4) : null; console.log("vacation year:", year, "modalYear:", modalYear.value); return year === String(modalYear.value); }); @@ -199,12 +202,10 @@ const filteredReceivedVacations = computed(() => { return receivedVacations.value.filter(vac => { - console.log( - vac.date, - vac.date ? vac.date.split("T")[0].substring(0, 4) : null, - modalYear.value - ); - return vac.date && vac.date.split("T")[0].substring(0, 4) === String(modalYear.value); + const dateStr = vac.date || vac.LOCVACUDT; + const year = dateStr ? dateStr.split("T")[0].substring(0, 4) : null; + console.log("vacation year:", year, "modalYear:", modalYear.value); + return dateStr && year === String(modalYear.value); }); });