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