From 6e4382f473d571a16a3c85c8c16dcee6371cfe22 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 21 Feb 2025 14:34:35 +0900 Subject: [PATCH] =?UTF-8?q?board-comment=20=EB=8B=A4=EC=8B=9C=EB=A8=B8?= =?UTF-8?q?=EC=A7=80=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardProfile.vue | 2 +- src/views/board/BoardList.vue | 6 +- src/views/board/BoardView.vue | 28 +- src/views/vacation/VacationManagement.vue | 653 +++++++++++----------- 4 files changed, 337 insertions(+), 352 deletions(-) diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index 796ab40..766bc31 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -61,7 +61,7 @@ const props = defineProps({ }, profileName: { type: String, - default: null, + default: '์ต๋ช…', }, unknown: { type: Boolean, diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 3816ff6..d42480a 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -61,7 +61,7 @@ ๐Ÿ“Œ {{ notice.title }} - N + N {{ notice.author }} {{ notice.date }} @@ -78,7 +78,7 @@ {{ post.title }} - N + N {{ post.author }} {{ post.date }} @@ -199,6 +199,7 @@ const fetchGeneralPosts = async (page = 1) => { id: totalPosts - ((page - 1) * selectedSize.value) - index, title: post.title, author: post.author || '์ต๋ช…', + rawDate: post.date, date: formatDate(post.date), // ๋‚ ์งœ ๋ณ€ํ™˜ ์ ์šฉ views: post.cnt || 0, hasAttachment: post.hasAttachment || false, @@ -239,6 +240,7 @@ const fetchNoticePosts = async () => { title: post.title, author: post.author || '๊ด€๋ฆฌ์ž', date: formatDate(post.date), + rawDate: post.date, views: post.cnt || 0, hasAttachment: post.hasAttachment || false, img: post.firstImageUrl || null diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index e52e404..b322fa4 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -149,7 +149,7 @@ const comments = ref([]); const route = useRoute(); const router = useRouter(); const currentBoardId = ref(Number(route.params.id)); -const unknown = computed(() => profileName.value === null); +const unknown = computed(() => profileName.value === '์ต๋ช…'); const currentUserId = ref('๊น€์ž๋ฐ”'); // ํ˜„์žฌ ๋กœ๊ทธ์ธํ•œ ์‚ฌ์šฉ์ž id const authorId = ref(null); // ์ž‘์„ฑ์ž id @@ -189,15 +189,15 @@ const fetchBoardDetails = async () => { // API ์‘๋‹ต ๋ฐ์ดํ„ฐ ๋ฐ˜์˜ // const boardDetail = data.boardDetail || {}; - - profileName.value = data.author || null; - + + profileName.value = data.author || '์ต๋ช…'; + // ์ต๋ช…ํ™•์ธํ•˜๊ณ  ์‹ถ์„๋•Œ // profileName.value = 'null; - + // ๊ฒŒ์‹œ๊ธ€์˜ ์ž‘์„ฑ์ž ์—ฌ๋ถ€๋ฅผ ํ™•์ธ : ํ˜„์žฌ ๋กœ๊ทธ์ธํ•œ ์‚ฌ์šฉ์ž๊ฐ€ ์ด ๊ฒŒ์‹œ๊ธ€์˜ ์ž‘์„ฑ์ž์ธ์ง€ ์—ฌ๋ถ€ authorId.value = data.author; - + boardTitle.value = data.title || '์ œ๋ชฉ ์—†์Œ'; boardContent.value = data.content || ''; date.value = data.date || ''; @@ -206,7 +206,7 @@ const fetchBoardDetails = async () => { dislikes.value = data.dislikeCount || 0; attachment.value = data.hasAttachment || null; commentNum.value = data.commentCount || 0; - + } catch (error) { alert('๊ฒŒ์‹œ๋ฌผ ๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.'); } @@ -272,12 +272,12 @@ const fetchComments = async (page = 1) => { page } }); - + const commentsList = response.data.data.list.map(comment => ({ commentId: comment.LOCCMTSEQ, // ๋Œ“๊ธ€ ID boardId: comment.LOCBRDSEQ, parentId: comment.LOCCMTPNT, // ๋ถ€๋ชจ ID - author: comment.author || null, + author: comment.author || '์ต๋ช…', content: comment.LOCCMTRPY, likeCount: comment.likeCount || 0, dislikeCount: comment.dislikeCount || 0, @@ -458,7 +458,7 @@ const editComment = (comment) => { // c.isCommentPassword = false; // }); - // if (comment.unknown) { + // if (comment.unknown) { // comment.isCommentPassword = true; // } else { // comment.isEditTextarea = true; @@ -565,10 +565,10 @@ const submitCommentPassword = async (comment, password) => { if (response.data.code === 200 && response.data.data === true) { comment.isCommentPassword = false; - + if (lastCommentClickedButton.value === "edit") { comment.isEditTextarea = true; - // handleSubmitEdit(comment, comment.content); + // handleSubmitEdit(comment, comment.content); } else if (lastCommentClickedButton.value === "delete") { deleteReplyComment(comment) @@ -620,7 +620,7 @@ const deleteReplyComment = async (comment) => { if (response.data.code === 200) { // console.log("๋Œ“๊ธ€ ์‚ญ์ œ ์„ฑ๊ณต!"); - await fetchComments(); + await fetchComments(); } else { // console.log("๋Œ“๊ธ€ ์‚ญ์ œ ์‹คํŒจ:", response.data.message); alert("๋Œ“๊ธ€ ์‚ญ์ œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค."); @@ -641,7 +641,7 @@ const handleSubmitEdit = async (comment, editedContent) => { // ์ˆ˜์ • ์„ฑ๊ณต ์‹œ ์—…๋ฐ์ดํŠธ comment.content = editedContent; - comment.isEditTextarea = false; + comment.isEditTextarea = false; } catch (error) { console.error("๋Œ“๊ธ€ ์ˆ˜์ • ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ:", error); } diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index 80e4fc8..19647f7 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -1,307 +1,304 @@ + - + onMounted(async () => { + await fetchUserList(); + await fetchVacationCodes(); + const today = new Date(); + const year = today.getFullYear(); + const month = String(today.getMonth() + 1).padStart(2, "0"); + await loadCalendarData(year, month); + }); + - +