diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 0e1fbef..07e2327 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -68,7 +68,7 @@ diff --git a/src/components/editor/QEditor.vue b/src/components/editor/QEditor.vue index 84fee83..3ff77e9 100644 --- a/src/components/editor/QEditor.vue +++ b/src/components/editor/QEditor.vue @@ -46,7 +46,6 @@
-
내용을 확인해주세요.
@@ -64,6 +63,10 @@ const props = defineProps({ type: Boolean, default: false, }, + initialData: { + type: String, + default: () => null, + }, }); const editor = ref(null); // 에디터 DOM 참조 @@ -108,8 +111,14 @@ onMounted(() => { watch([font, fontSize], () => { quillInstance.format('font', font.value); quillInstance.format('size', fontSize.value); + }); + // 초기 데이터가 있을 경우, HTML 형식으로 삽입 + if (props.initialData) { + quillInstance.setContents(JSON.parse(props.initialData)); + } + // 이미지 업로드 기능 처리 let imageUrls = new Set(); // 업로드된 이미지 URL을 추적 quillInstance.getModule('toolbar').addHandler('image', () => { diff --git a/src/components/modal/VacationGrantModal.vue b/src/components/modal/VacationGrantModal.vue index c6e1476..37269ff 100644 --- a/src/components/modal/VacationGrantModal.vue +++ b/src/components/modal/VacationGrantModal.vue @@ -8,13 +8,13 @@

해당 직원에게 부여할 연차 개수를 선택하세요. (남은 개수: {{ availableQuota }}개)

- + {{ grantCount }}
@@ -26,65 +26,60 @@ import axios from "@api"; const props = defineProps({ - isOpen: Boolean, // 모달 상태 - targetUser: Object, // 선택한 사용자 정보 + isOpen: Boolean, + targetUser: Object, }); const emit = defineEmits(["close", "updateVacation"]); const grantCount = ref(0); - const maxQuota = 2; // 1년에 보낼 수 있는 최대 개수 - const sentCount = ref(0); // 현재까지 보낸 개수 - const availableQuota = ref(2); // 남은 개수 + const maxQuota = 2; + const sentCount = ref(0); + const availableQuota = ref(2); - // ✅ 해당 사용자에게 이미 보낸 연차 개수 조회 const fetchSentVacationCount = async () => { try { const payload = { receiverId: props.targetUser.MEMBERSEQ }; - - const response = await axios.get(`vacation/sent`,{ params: payload }); - console.log(response.data.data[0].count) - sentCount.value = response.data.data[0].count || 0; // 이미 보낸 개수 - availableQuota.value = Math.max(maxQuota - sentCount.value, 0); // 남은 개수 (0 이하 방지) - console.log(`✅ 보낸 개수: ${sentCount.value}, 남은 개수: ${availableQuota.value}`); + const response = await axios.get("vacation/sent", { params: payload }); + sentCount.value = response.data.data[0].count || 0; + availableQuota.value = Math.max(maxQuota - sentCount.value, 0); + grantCount.value = availableQuota.value; // ✅ 남은 개수로 기본값 설정 } catch (error) { console.error("🚨 연차 전송 기록 조회 실패:", error); availableQuota.value = maxQuota; + grantCount.value = maxQuota; // 기본값 설정 } }; - // ✅ 연차 개수 증가 const increaseCount = () => { if (grantCount.value < availableQuota.value) { grantCount.value++; } }; - // ✅ 연차 개수 감소 const decreaseCount = () => { if (grantCount.value > 0) { grantCount.value--; } }; - // ✅ 연차 부여 저장 요청 (saveVacations API 호출) const saveVacationGrant = async () => { try { const payload = [ { - date: new Date().toISOString().split("T")[0], // 오늘 날짜 - type: "700103", // 연차 코드 - senderId: props.targetUser.senderId, // 보내는 사람 ID - receiverId: props.targetUser.MEMBERSEQ, // 받는 사람 ID - count: grantCount.value, // 부여 개수 + date: new Date().toISOString().split("T")[0], + type: "700103", + senderId: props.targetUser.senderId, + receiverId: props.targetUser.MEMBERSEQ, + count: grantCount.value, }, ]; - const response = await axios.post("vacation/save", payload); - + const response = await axios.post("vacation", payload); + console.log(response) if (response.data && response.data.status === "OK") { alert("✅ 연차가 부여되었습니다."); - await fetchSentVacationCount(); // ✅ 보낸 개수 업데이트 - emit("updateVacation"); // ✅ 연차 정보 갱신 요청 + await fetchSentVacationCount(); + emit("updateVacation"); closeModal(); } else { alert("🚨 연차 추가 중 오류가 발생했습니다."); @@ -95,36 +90,30 @@ } }; - // ✅ 모달 닫기 const closeModal = () => { emit("close"); }; - // ✅ 모달이 열릴 때 초기 값 설정 및 보낸 개수 조회 watch( () => props.isOpen, async (newVal) => { if (newVal && props.targetUser && props.targetUser.MEMBERSEQ) { console.log("🟢 모달이 열렸습니다. 데이터를 로드합니다."); - grantCount.value = 0; // 초기화 - await fetchSentVacationCount(); // 보낸 개수 불러오기 + await fetchSentVacationCount(); } } ); - // ✅ targetUser가 변경될 때도 fetchSentVacationCount 호출 watch( () => props.targetUser, async (newUser) => { if (newUser && newUser.MEMBERSEQ) { - console.log(`🔄 새로운 대상(${newUser.name})이 선택되었습니다.`); await fetchSentVacationCount(); } }, { deep: true } ); - // ✅ 컴포넌트가 마운트될 때도 보낸 개수 불러오기 onMounted(async () => { if (props.isOpen && props.targetUser && props.targetUser.MEMBERSEQ) { await fetchSentVacationCount(); @@ -132,6 +121,7 @@ }); + diff --git a/src/components/pagination/Pagination.vue b/src/components/pagination/Pagination.vue index 8eb7234..955ee44 100644 --- a/src/components/pagination/Pagination.vue +++ b/src/components/pagination/Pagination.vue @@ -66,51 +66,55 @@ const props = defineProps({ currentPage: { type: Number, - required: true + required: false }, pages: { type: Number, - required: true + required: false }, prePage: { type: Number, - required: true + required: false }, nextPage: { type: Number, - required: true + required: false }, isFirstPage: { type: Boolean, - required: true + required: false }, isLastPage: { type: Boolean, - required: true + required: false }, hasPreviousPage: { type: Boolean, - required: true + required: false }, hasNextPage: { type: Boolean, - required: true + required: false }, navigatePages: { type: Number, - required: true + required: false }, navigatepageNums: { type: Array, - required: true + required: false }, navigateFirstPage: { type: Number, - required: true + required: false }, navigateLastPage: { type: Number, - required: true + required: false + }, + PageData:{ + type:Array, + required:false, } }); diff --git a/src/components/voteboard/voteCard.vue b/src/components/voteboard/voteCard.vue index 71a6542..6662bad 100644 --- a/src/components/voteboard/voteCard.vue +++ b/src/components/voteboard/voteCard.vue @@ -2,32 +2,46 @@
- + user
- +
-
+
-
회식장소 고릅시다.
-
24.12.12 11:02 ~ 24.12.12 16:02
+
{{ data.localVote.LOCVOTTTL }}
+
{{ data.localVote.formatted_LOCVOTRDT }} ~ {{ data.localVote.formatted_LOCVOTEDT }}
- + - + - +
@@ -41,8 +55,25 @@ import DeleteBtn from '@c/button/DeleteBtn.vue'; import voteUserList from '@c/voteboard/voteUserList.vue'; import voteResultList from '@c/voteboard/voteResultList.vue'; import voteCardCheck from '@c/voteboard/voteCardCheck.vue'; -import voteRevoteEnd from '@c/voteboard/voteRevoteEnd.vue'; +import { useUserInfoStore } from '@s/useUserInfoStore'; +import $api from '@api'; +const props = defineProps({ + data: { + type: Object, + required: true, + }, +}); +const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ''); + +const userStore = useUserInfoStore(); +const emit = defineEmits(['addContents','checkedNames']); +const addContents = (itemList, voteId) =>{ + emit('addContents',itemList,voteId) +} +const checkedNames = (numList) =>{ + emit('checkedNames',numList); +} diff --git a/src/components/voteboard/voteCompleteUserList.vue b/src/components/voteboard/voteCompleteUserList.vue index e7d3203..d754513 100644 --- a/src/components/voteboard/voteCompleteUserList.vue +++ b/src/components/voteboard/voteCompleteUserList.vue @@ -1,11 +1,10 @@