From 8b56ce4e428659a2805c1b0074623a8bccab8564 Mon Sep 17 00:00:00 2001 From: Dang Date: Tue, 18 Feb 2025 14:26:24 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EC=9E=91=EC=97=85=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EC=84=A4=EB=AA=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/wordDict/DictCard.vue | 13 +++++++------ src/components/wordDict/DictWrite.vue | 7 ++++++- src/views/wordDict/wordDict.vue | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/wordDict/DictCard.vue b/src/components/wordDict/DictCard.vue index 8004a55..36825f5 100644 --- a/src/components/wordDict/DictCard.vue +++ b/src/components/wordDict/DictCard.vue @@ -87,7 +87,7 @@ const localCateList = ref([...props.cateList]); const selectedCategory = ref(''); // cateList emit -const emit = defineEmits(['update:cateList']); +const emit = defineEmits(['update:cateList','refreshWordList']); // 글 수정 상태 const isWriteVisible = ref(false); @@ -126,6 +126,7 @@ const addCategory = (data) => { } } + // 용어집 수정 const editWord = (data) => { console.log('📌 수정할 데이터:', data); @@ -142,15 +143,15 @@ const editWord = (data) => { axios.patch('worddict/updateWord', { WRDDICSEQ: data.id, - WRDDICCAT: 600104, + WRDDICCAT: data.category, WRDDICTTL: data.title, - WRDDICRIK: $common.deltaAsJson(data.content), + WRDDICCON: $common.deltaAsJson(data.content), }) .then((res) => { - if (res.data.data === '1') { + if (res.data.data === 1) { toastStore.onToast('✅ 용어가 수정되었습니다.', 's'); - isWriteVisible.value = false; // 성공 시에만 닫기 - // getwordList(); // 목록 갱신 + isWriteVisible.value = false; + emit('refreshWordList'); } else { console.warn('⚠️ 서버 응답이 예상과 다릅니다:', res.data); toastStore.onToast('용어 수정이 정상적으로 처리되지 않았습니다.', 'e'); diff --git a/src/components/wordDict/DictWrite.vue b/src/components/wordDict/DictWrite.vue index b6dd169..65bdceb 100644 --- a/src/components/wordDict/DictWrite.vue +++ b/src/components/wordDict/DictWrite.vue @@ -73,6 +73,11 @@ const addCategoryAlert = ref(false); //선택 카테고리 const selectCategory = ref(''); +// 카테고리 상태 +const selectedCategory = computed(() => + selectCategory.value === '' ? props.formValue : selectCategory.value +); + const props = defineProps({ dataList: { type: Array, @@ -133,7 +138,7 @@ const saveWord = () => { const wordData = { id: props.NumValue || null, title: wordTitle.value, - category: selectCategory.value, + category: selectedCategory.value, content: content.value, }; diff --git a/src/views/wordDict/wordDict.vue b/src/views/wordDict/wordDict.vue index 9e083fe..68a060b 100644 --- a/src/views/wordDict/wordDict.vue +++ b/src/views/wordDict/wordDict.vue @@ -49,6 +49,7 @@ :key="item.WRDDICSEQ" :item="item" :cateList="cateList" + @refreshWordList="getwordList" /> From 2c28645488112b1c03d1fea534b590fa776b1ecf Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 18 Feb 2025 14:30:14 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EB=A8=B8=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/modal/VacationModal.vue | 198 ++++++++++++---------- src/views/board/BoardList.vue | 2 + src/views/board/BoardView.vue | 54 +++++- src/views/vacation/VacationManagement.vue | 1 + 4 files changed, 161 insertions(+), 94 deletions(-) diff --git a/src/components/modal/VacationModal.vue b/src/components/modal/VacationModal.vue index d60da1a..e1b705b 100644 --- a/src/components/modal/VacationModal.vue +++ b/src/components/modal/VacationModal.vue @@ -13,13 +13,21 @@ class="vacation-item" > - {{ totalUsedVacationCount - usedVacations.findIndex(v => v.date === vacation.date) }} ) + {{ totalUsedVacationCount - usedVacations.findIndex(v => v.date === vacation.date) }}) {{ vacation.type === 'used' ? '-' : '+' }} - {{ formatDate(vacation.date) }} + + {{ formatDate(vacation.date) }} + + ({{ vacation.halfDay ? '반차' : '풀 연차' }}) + (보낸 연차) + + @@ -57,113 +65,123 @@ const totalUsedVacationCount = computed(() => props.myVacations.length); // ✅ 사용한 연차 + 받은 연차 통합 후 내림차순 정렬 - const usedVacations = computed(() => props.myVacations.map(v => ({ ...v, type: "used" }))); - const receivedVacations = computed(() => props.receivedVacations - .filter(v => !v.senderId) // ✅ 보낸 사람이 있는 경우 리스트에서 제외 - .map(v => ({ ...v, type: "received" })) + const usedVacations = computed(() => + props.myVacations.map(v => ({ ...v, type: "used" })) ); - const mergedVacations = computed(() => { - return [...usedVacations.value, ...receivedVacations.value].sort( - (a, b) => new Date(b.date) - new Date(a.date) + const receivedVacations = computed(() => + props.receivedVacations.map(v => ({ ...v, type: "received" })) ); + + // ✅ 정확한 정렬 및 리스트 병합 + const mergedVacations = computed(() => { + return [...usedVacations.value, ...receivedVacations.value].sort( + (a, b) => new Date(b.date) - new Date(a.date) + ); }); // ✅ 날짜 형식 변환 (YYYY-MM-DD) const formatDate = (dateString) => { - const date = new Date(dateString); - return date.toISOString().split("T")[0]; // YYYY-MM-DD 형식 + const date = new Date(dateString); + return date.toISOString().split("T")[0]; // YYYY-MM-DD 형식 }; const closeModal = () => { - emit("close"); + emit("close"); }; + + /* 연차 데이터 없음 */ + .no-data { + text-align: center; + font-size: 14px; + color: gray; + margin-top: 10px; + } + diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index a5e4135..34740d2 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -190,6 +190,8 @@ const fetchGeneralPosts = async (page = 1) => { console.log(data) const totalPosts = data.data.total; // 전체 게시물 개수 받아오기 + console.log('📌 API 응답 데이터:', data.data); + generalList.value = data.data.list.map((post, index) => ({ realId: post.id, id: totalPosts - ((page - 1) * selectedSize.value) - index, diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index b6c68f4..2eb5e83 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -94,7 +94,11 @@ @updateReaction="handleUpdateReaction" @submitComment="handleCommentReply" /> - + @@ -103,7 +107,7 @@ diff --git a/src/components/modal/VacationModal.vue b/src/components/modal/VacationModal.vue index e1b705b..fd27de0 100644 --- a/src/components/modal/VacationModal.vue +++ b/src/components/modal/VacationModal.vue @@ -1,49 +1,41 @@ + - - const closeModal = () => { - emit("close"); - }; - - - +} + diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 2eb5e83..2559318 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -221,12 +221,12 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) = }; // 댓글 목록 조회 -const fetchComments = async (pageNum = 1) => { +const fetchComments = async (page = 1) => { try { const response = await axios.get(`board/${currentBoardId.value}/comments`, { params: { LOCBRDSEQ: currentBoardId.value, - pageNum: pageNum + page } }); console.log("목록 API 응답 데이터:", response.data); From 6f436579410797c3d94efcd1afa8e9c019ceab9a Mon Sep 17 00:00:00 2001 From: yoon Date: Tue, 18 Feb 2025 15:04:25 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EB=AF=B8=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/list/ProjectCard.vue | 2 +- src/components/list/ProjectCardList.vue | 27 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/list/ProjectCard.vue b/src/components/list/ProjectCard.vue index a690309..7ea65c0 100644 --- a/src/components/list/ProjectCard.vue +++ b/src/components/list/ProjectCard.vue @@ -63,7 +63,7 @@