Merge remote-tracking branch 'origin/main' into board-comment

This commit is contained in:
kimdaae328 2025-02-21 13:08:51 +09:00
commit 4076507fb7
5 changed files with 57 additions and 60 deletions

View File

@ -5,11 +5,6 @@
display: block !important;
}
/* 게시판리스트 */
.bg-label-gray td {
color: #DC3545 !important;
}
/* 휴가 */
.half-day-buttons {

View File

@ -0,0 +1,18 @@
// src/api/holiday.js
import axios from "@api";
export 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 [];
}
}

View File

@ -13,6 +13,7 @@
:maxLength="maxlength"
:placeholder="title"
:disabled="disabled"
:min="min"
/>
<div class="invalid-feedback" :class="isAlert ? 'display-block' : ''">
{{ title }} 확인해주세요.
@ -64,6 +65,10 @@ const props = defineProps({
disabled: {
type: Boolean,
default: false,
},
min: {
type: String,
default: false,
}
});

View File

@ -42,11 +42,11 @@
<table class="datatables-users table border-top dataTable dtr-column">
<thead>
<tr>
<th style="width: 11%;" class="text-center">번호</th>
<th style="width: 45%;" class="text-center">제목</th>
<th style="width: 10%;" class="text-center">작성자</th>
<th style="width: 15%;" class="text-center">작성일</th>
<th style="width: 9%;" class="text-center">조회수</th>
<th style="width: 11%;" class="text-center fw-bold">번호</th>
<th style="width: 45%;" class="text-center fw-bold">제목</th>
<th style="width: 10%;" class="text-center fw-bold">작성자</th>
<th style="width: 15%;" class="text-center fw-bold">작성일</th>
<th style="width: 9%;" class="text-center fw-bold">조회수</th>
</tr>
</thead>
<tbody>
@ -54,7 +54,7 @@
<template v-if="pagination.currentPage === 1 && !showNotices">
<tr v-for="(notice, index) in noticeList"
:key="'notice-' + index"
class="bg-label-gray"
class="bg-label-gray fw-bold"
@click="goDetail(notice.id)">
<td class="text-center">공지</td>
<td>

View File

@ -60,6 +60,7 @@ import { useUserStore } from "@s/userList";
import VacationModal from "@c/modal/VacationModal.vue"
import { useUserInfoStore } from "@s/useUserInfoStore";
import VacationGrantModal from "@c/modal/VacationGrantModal.vue";
import { fetchHolidays } from "@c/calendar/holiday.js";
const userStore = useUserInfoStore();
const userListStore = useUserStore();
@ -73,6 +74,32 @@ const remainingVacationData = ref({});
const isGrantModalOpen = ref(false);
const selectedUser = ref(null);
// FullCalendar
const fullCalendarRef = ref(null);
const calendarEvents = ref([]); // FullCalendar (API + )
const selectedDates = ref(new Map()); //
const halfDayType = ref(null);
const vacationCodeMap = ref({}); //
// (YYYY-MM-DD ) ( )
const holidayDates = ref(new Set());
const fetchedEvents = ref([]); // API (, )
// FullCalendar (events calendarEvents )
const calendarOptions = reactive({
plugins: [dayGridPlugin, interactionPlugin],
initialView: "dayGridMonth",
headerToolbar: {
left: "today",
center: "title",
right: "prev,next",
},
locale: "ko",
selectable: false,
dateClick: handleDateClick,
datesSet: handleMonthChange,
events: calendarEvents,
});
onMounted(async () => {
await userStore.userInfo();
@ -138,33 +165,6 @@ const fetchUserList = async () => {
}
};
// FullCalendar
const fullCalendarRef = ref(null);
const calendarEvents = ref([]); // FullCalendar (API + )
const fetchedEvents = ref([]); // API (, )
const selectedDates = ref(new Map()); //
const halfDayType = ref(null);
const vacationCodeMap = ref({}); //
// (YYYY-MM-DD ) ( )
const holidayDates = ref(new Set());
// FullCalendar (events calendarEvents )
const calendarOptions = reactive({
plugins: [dayGridPlugin, interactionPlugin],
initialView: "dayGridMonth",
headerToolbar: {
left: "today",
center: "title",
right: "prev,next",
},
locale: "ko",
selectable: false,
dateClick: handleDateClick,
datesSet: handleMonthChange,
events: calendarEvents,
});
const fetchVacationCodes = async () => {
try {
const response = await axios.get("vacation/codes");
@ -363,29 +363,10 @@ halfDayType.value = halfDayType.value === type ? null : type;
}
}
/**
* 공휴일 데이터 요청 이벤트 변환
*/
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) {
function handleMonthChange(viewInfo) {
const currentDate = viewInfo.view.currentStart;
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, "0");
@ -421,7 +402,5 @@ await loadCalendarData(year, month);
</script>
<style>
.fc-bg-event{
}
</style>