휴가 수정정

This commit is contained in:
dyhj625 2025-02-21 16:21:26 +09:00
parent c4b1a946ab
commit ce1ecb5897
2 changed files with 31 additions and 36 deletions

View File

@ -16,12 +16,6 @@
.half-day-buttons .btn.active { .half-day-buttons .btn.active {
border: 2px solid black; 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 { .fc-daygrid-day-events {
max-height: 100px !important; max-height: 100px !important;
overflow-y: auto !important; overflow-y: auto !important;

View File

@ -123,30 +123,32 @@
}; };
// //
const handleProfileClick = async (user) => { //
try { const handleProfileClick = async (user) => {
if (user.MEMBERSEQ === userStore.user.id) { try {
const response = await axios.get(`vacation/history`); if (user.MEMBERSEQ === userStore.user.id) {
if (response.status === 200 && response.data) { const year = new Date().getFullYear(); //
myVacations.value = response.data.data.usedVacations || []; //
receivedVacations.value = response.data.data.receivedVacations || []; const response = await axios.get(`vacation/history?year=${year}`);
isModalOpen.value = true; if (response.status === 200 && response.data) {
// myVacations.value = response.data.data.usedVacations || [];
modalYear.value = new Date().getFullYear(); receivedVacations.value = response.data.data.receivedVacations || [];
modalMonth.value = String(new Date().getMonth() + 1).padStart(2, "0"); isModalOpen.value = true;
isGrantModalOpen.value = false; //
} else { modalYear.value = year;
console.warn("❌ 연차 내역을 불러오지 못했습니다."); isGrantModalOpen.value = false;
}
} else { } else {
selectedUser.value = user; console.warn("❌ 연차 내역을 불러오지 못했습니다.");
isGrantModalOpen.value = true;
isModalOpen.value = false;
} }
} catch (error) { } else {
console.error("🚨 연차 데이터 불러오기 실패:", error); selectedUser.value = user;
isGrantModalOpen.value = true;
isModalOpen.value = false;
} }
}; } catch (error) {
console.error("🚨 연차 데이터 불러오기 실패:", error);
}
};
const fetchUserList = async () => { const fetchUserList = async () => {
try { try {
@ -186,10 +188,11 @@
}; };
// computed: modalYear // computed: modalYear
const filteredMyVacations = computed(() => { const filteredMyVacations = computed(() => {
const filtered = myVacations.value.filter(vac => { const filtered = myVacations.value.filter(vac => {
console.log(vac) // vac.date vac.LOCVACUDT
const year = vac.date ? vac.date.split("T")[0].substring(0, 4) : null; 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); console.log("vacation year:", year, "modalYear:", modalYear.value);
return year === String(modalYear.value); return year === String(modalYear.value);
}); });
@ -199,12 +202,10 @@
const filteredReceivedVacations = computed(() => { const filteredReceivedVacations = computed(() => {
return receivedVacations.value.filter(vac => { return receivedVacations.value.filter(vac => {
console.log( const dateStr = vac.date || vac.LOCVACUDT;
vac.date, const year = dateStr ? dateStr.split("T")[0].substring(0, 4) : null;
vac.date ? vac.date.split("T")[0].substring(0, 4) : null, console.log("vacation year:", year, "modalYear:", modalYear.value);
modalYear.value return dateStr && year === String(modalYear.value);
);
return vac.date && vac.date.split("T")[0].substring(0, 4) === String(modalYear.value);
}); });
}); });