This commit is contained in:
parent
00acd58995
commit
f2ad06756b
@ -182,6 +182,7 @@ const handleSizeChange = () => {
|
||||
|
||||
// 일반 게시물 데이터 로드
|
||||
const fetchGeneralPosts = async (page = 1) => {
|
||||
try {
|
||||
const { data } = await axios.get("board/general", {
|
||||
params: {
|
||||
page,
|
||||
@ -222,10 +223,13 @@ const fetchGeneralPosts = async (page = 1) => {
|
||||
navigateLastPage: data.data.navigateLastPage
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
};
|
||||
|
||||
// 공지사항 데이터 로드
|
||||
const fetchNoticePosts = async () => {
|
||||
try {
|
||||
const { data } = await axios.get("board/notices", {
|
||||
params: { searchKeyword: searchText.value }
|
||||
});
|
||||
@ -243,6 +247,8 @@ const fetchNoticePosts = async () => {
|
||||
commentCount : post.commentCount
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
};
|
||||
|
||||
// Enter 키를 눌렀을 때
|
||||
|
||||
@ -264,6 +264,7 @@ async function loadCalendarData(year, month) {
|
||||
/* 프로필 구역 */
|
||||
// 프로필 클릭 시 모달 열기
|
||||
const handleProfileClick = async (user) => {
|
||||
try {
|
||||
if (isModalOpen.value && user.MEMBERSEQ === userStore.user.id) {
|
||||
return;
|
||||
}
|
||||
@ -280,6 +281,8 @@ const handleProfileClick = async (user) => {
|
||||
selectedUser.value = user;
|
||||
isGrantModalOpen.value = true;
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
};
|
||||
// 프로필 사원 리스트
|
||||
const fetchUserList = async () => {
|
||||
@ -300,11 +303,11 @@ const fetchUserList = async () => {
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error("📌 사용자 목록 불러오기 오류:", error);
|
||||
}
|
||||
};
|
||||
// 사원별 남은 연차 개수
|
||||
const fetchRemainingVacation = async () => {
|
||||
try {
|
||||
const response = await axios.get("vacation/remaining");
|
||||
if (response.status === 200) {
|
||||
remainingVacationData.value = response.data.data.reduce((acc, vacation) => {
|
||||
@ -312,6 +315,8 @@ const fetchRemainingVacation = async () => {
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
};
|
||||
// 로그인한 사원이 사용한 휴가 필터링
|
||||
const filteredMyVacations = computed(() => {
|
||||
@ -403,15 +408,18 @@ async function saveVacationChanges() {
|
||||
/* 휴가 조회 */
|
||||
// 로그인 사용자의 연차 사용 내역
|
||||
async function fetchVacationHistory(year) {
|
||||
try {
|
||||
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 || []
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
// 모든 사원 연차 내역 및 그래프화
|
||||
async function fetchVacationData(year, month) {
|
||||
|
||||
try {
|
||||
const response = await axios.get(`vacation/list/${year}/${month}`);
|
||||
if (response.status === 200) {
|
||||
const vacationList = response.data;
|
||||
@ -436,9 +444,10 @@ async function fetchVacationData(year, month) {
|
||||
console.warn("📌 휴가 데이터를 불러오지 못함");
|
||||
return [];
|
||||
}
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
// 캘린더 이벤트 업데이트
|
||||
function updateCalendarEvents() {
|
||||
const selectedEvents = Array.from(selectedDates.value)
|
||||
@ -499,6 +508,7 @@ const getVacationTypeClass = (type) => {
|
||||
};
|
||||
// 휴가종류
|
||||
const fetchVacationCodes = async () => {
|
||||
try {
|
||||
const response = await axios.get("vacation/codes");
|
||||
if (response.status === 200 && response.data) {
|
||||
vacationCodeMap.value = response.data.data.reduce((acc, item) => {
|
||||
@ -508,6 +518,8 @@ const fetchVacationCodes = async () => {
|
||||
} else {
|
||||
console.warn("❌ 공통 코드 데이터를 불러오지 못했습니다.");
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
};
|
||||
const getVacationType = (typeCode) => {
|
||||
return vacationCodeMap.value[typeCode] || "기타";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user