From d1aa5fb438c60f25bea28c96ca8a162730907c27 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Tue, 4 Feb 2025 10:57:18 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=EB=82=A0=EC=A7=9C=20=EB=B3=80=ED=99=98?= =?UTF-8?q?=EC=A0=84,=20=EC=A2=8B=EC=95=84=EC=9A=94=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardProfile.vue | 19 ++++++++----------- src/views/board/BoardView.vue | 25 +++++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index d5091f5..f9ab07a 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -7,16 +7,13 @@
{{ profileName }}
- 2024.12.10 10:46 + {{ date }}
@@ -72,17 +69,17 @@ const props = defineProps({ type: Boolean, default: false, }, + date: { + type: String, + required: true, + }, views: { type: Number, default: 0, }, - likes: { + comments: { type: Number, - default: null, - }, - dislikes: { - type: Number, - default: null, + default: 0, }, isChild: { type: Boolean, diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 18df4be..474517d 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -9,8 +9,8 @@ :boardId="currentBoardId" :profileName="profileName" :views="views" - :likes="likes" - :dislikes="dislikes" + :comments="comments" + :date="date" class="pb-6 border-bottom" />
@@ -49,8 +49,8 @@ :bigBtn="true" :boardId="currentBoardId" :commentId="null" - :likeCount="currentLikeCount" - :dislikeCount="currentDislikeCount" + :likeCount="likes" + :dislikeCount="dislikes" @updateReaction="handleUpdateReaction" /> @@ -63,7 +63,7 @@ --> - + - 이미지 -
- -
- {{ category }} -
- -
- {{ title }} - - - -
- -

{{ content }}

- -

- {{ formattedDate }} -

- - {{ views || 0 }} - - - {{ comments }} - - - {{ likes }} - - - {{ dislikes }} - -
-

-
+
+
+ +
+ 이미지 +
+ +
+
+ +
+ {{ category }} +
+ +
+ {{ title }} + + + +
+ +
{{ content }}
+ +
+ {{ formattedDate }} + +
+ + {{ views || 0 }} + + + {{ likes }} + + + {{ comments }} + +
+
+
+
+
- + - +// computed 속성 +const contentColClass = computed(() => { + return props.img ? 'col-sm-10 col-12' : 'col-sm-12'; +}); - + +.card:hover { + transform: scale(1.02); +} + +/* 텍스트 줄임 표시 */ +.str_wrap { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +/* 이미지 스타일 */ +.img-fluid { + border-radius: 8px 0 0 8px; +} + +/* 태그 배지 스타일 */ +.badge { + font-size: 0.8rem; + padding: 5px 10px; +} + diff --git a/src/components/list/BoardCardList.vue b/src/components/list/BoardCardList.vue index 430a73d..5b3c29a 100644 --- a/src/components/list/BoardCardList.vue +++ b/src/components/list/BoardCardList.vue @@ -1,10 +1,9 @@ diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 89eb2e8..1b528c5 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -2,57 +2,96 @@
-
+
-
+
-
- -
- -
+ +
+
- - -
-
- + +
+ +
+ +
+
- - -
-
- -
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
번호제목작성자작성일조회수
{{ post.id }} + {{ post.title }} + + N + {{ post.author }}{{ post.date }}{{ post.views }}
@@ -62,19 +101,28 @@ + + diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index df74285..fae4aa9 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -1,75 +1,63 @@ + - From 69b52169635c95af058c568314f6e95bfd0fd270 Mon Sep 17 00:00:00 2001 From: Dang Date: Tue, 4 Feb 2025 15:59:28 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=EC=9A=A9=EC=96=B4=EC=A7=91=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EB=B0=8F=20=EC=9E=85=EB=A0=A5=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/category/CategoryBtn.vue | 21 ++--- .../wordDict/DictAlphabetFilter.vue | 2 +- src/components/wordDict/DictCard.vue | 2 +- src/components/wordDict/DictWrite.vue | 46 ++++++++-- src/views/wordDict/wordDict.vue | 86 ++++++++----------- 5 files changed, 86 insertions(+), 71 deletions(-) diff --git a/src/components/category/CategoryBtn.vue b/src/components/category/CategoryBtn.vue index 912348c..c98ea10 100644 --- a/src/components/category/CategoryBtn.vue +++ b/src/components/category/CategoryBtn.vue @@ -9,17 +9,17 @@ type="button" class="btn" :class="{ - 'btn-outline-primary': category !== selectedCategory, - 'btn-primary': category === selectedCategory - }" - @click="selectCategory(category)" + 'btn-outline-primary': category.CMNCODVAL !== selectedCategory, + 'btn-primary': category.CMNCODVAL === selectedCategory + }" + @click="selectCategory(category.CMNCODVAL)" >{{ category.CMNCODNAM }} @@ -42,8 +43,4 @@ const selectCategory = (category) => { .cate-list { margin-left: -0.25rem; } - -@media screen and (max-width:450px) { - -} \ No newline at end of file diff --git a/src/components/wordDict/DictAlphabetFilter.vue b/src/components/wordDict/DictAlphabetFilter.vue index e28e459..9a899ba 100644 --- a/src/components/wordDict/DictAlphabetFilter.vue +++ b/src/components/wordDict/DictAlphabetFilter.vue @@ -49,7 +49,7 @@ const selectAlphabet = (alphabet) => { @media (max-width: 768px) { .alphabet-list { - overflow: scroll; + overflow-x: scroll; flex-wrap: nowrap !important; } } diff --git a/src/components/wordDict/DictCard.vue b/src/components/wordDict/DictCard.vue index 1aa65c0..09ecffd 100644 --- a/src/components/wordDict/DictCard.vue +++ b/src/components/wordDict/DictCard.vue @@ -2,7 +2,7 @@
  • - {{ item.category }} + {{ item.category }} {{ item.WRDDICTTL }}
    diff --git a/src/components/wordDict/DictWrite.vue b/src/components/wordDict/DictWrite.vue index 441ffbe..9d040f1 100644 --- a/src/components/wordDict/DictWrite.vue +++ b/src/components/wordDict/DictWrite.vue @@ -1,11 +1,14 @@ \ No newline at end of file diff --git a/src/views/wordDict/wordDict.vue b/src/views/wordDict/wordDict.vue index d6e3392..7efb616 100644 --- a/src/views/wordDict/wordDict.vue +++ b/src/views/wordDict/wordDict.vue @@ -25,12 +25,12 @@
    - +
    - +
    @@ -50,16 +50,9 @@ :item="item" /> - -
    용어집의 용어가 없습니다.
    +
    용어집의 용어가 없습니다.
  • @@ -84,12 +77,17 @@ // 용어집 const wordList = ref([]); + //용어집 총개수 const total = ref(0); + // 카테고리 const cateList = ref([]); + const selectedCategory = ref(''); + //선택된 알파벳 const selectedAlphabet = ref(''); + // 검색 const searchText = ref(''); @@ -98,77 +96,61 @@ // 데이터 로드 onMounted(() => { - getwordList(); //용어목록조회 - getwordCategory(); //카테고리목록조회 + getwordList(); + getwordCategory(); }); + //용어 목록 - const getwordList = (searchKeyword='',indexKeyword='') => { + const getwordList = (searchKeyword='', indexKeyword='', category='') => { axios.get('worddict/getWordList',{ //목록조회시 파라미터 전달 - params: { searchKeyword: searchKeyword - ,indexKeyword:indexKeyword + params: { + searchKeyword : searchKeyword, + indexKeyword :indexKeyword, + category : category } }) .then(res => { - wordList.value = res.data.data.data; // 용어 목록 저장 - total.value = res.data.data.total; // 총 개수 저장 + // 용어 목록 저장 + wordList.value = res.data.data.data; + // 총 개수 저장 + total.value = res.data.data.total; loading.value = false; }) .catch(err => { console.error('데이터 로드 오류:', err); error.value = '데이터를 가져오는 중 문제가 발생했습니다.'; - loading.value = false; // 로딩 종료 + loading.value = false; }); }; // 카테고리 목록 const getwordCategory = () => { axios.get('worddict/getWordCategory') .then(res => { - cateList.value = res.data.data; // 카테고리 목록 저장 + cateList.value = res.data.data; }) .catch(err => { console.error('카테고리 로드 오류:', err); error.value = '카테고리 데이터를 가져오는 중 문제가 발생했습니다.'; }); }; - const handleSelectedAlphabetChange = (newAlphabet) => { - selectedAlphabet.value = newAlphabet; - getwordList(searchText.value,selectedAlphabet.value); - }; // 검색 const search = (e) => { searchText.value = e.trim(); - getwordList(searchText.value,selectedAlphabet.value); + getwordList(searchText.value, selectedAlphabet.value, selectedCategory.value); }; + // 알파벳 선택 + const handleSelectedAlphabetChange = (newAlphabet) => { + selectedAlphabet.value = newAlphabet; + getwordList(searchText.value, selectedAlphabet.value, selectedCategory.value); + }; - // 용어집 및 카테고리 목록 통합 API 호출 - // const fetchAllData = async () => { - // loading.value = true; - // error.value = ''; - // try { - // // 용어집 - // // const wordResponse = await axios.get('worddict/getWordList'); - // //wordList.value = wordResponse.data.data.data; - // //console.log('용어집 데이터:', wordList.value); - - // // 카테고리 - // const categoryResponse = await axios.get('worddict/getWordCategory'); - // cateList.value = categoryResponse.data.data; - // console.log('카테고리 데이터:', cateList.value); - // } catch (err) { - // error.value = '데이터를 가져오는 중 문제가 발생했습니다.'; - // } finally { - // loading.value = false; - // } - // }; - - // 검색 - // const filteredList = computed(() => - // wordList.value.filter(item => - // item.WRDDICTTL.toLowerCase().includes(searchText.value.toLowerCase()) - // ) - // ); + // 카테고리 선택 + const handleSelectedCategoryChange = (category) => { + selectedCategory.value = category; + getwordList(searchText.value, selectedAlphabet.value, selectedCategory.value) + } // 작성 toggle const toggleWriteForm = () => { @@ -190,4 +172,4 @@ margin-bottom: 0.5rem !important; } } - + \ No newline at end of file From 552f307c45986a17280130c0a49dfdb0aa0882a5 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Tue, 4 Feb 2025 16:05:48 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/button/BoardRecommendBtn.vue | 33 ++++++++++--------- src/views/board/BoardView.vue | 36 +++++++++++++++++---- 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/src/components/button/BoardRecommendBtn.vue b/src/components/button/BoardRecommendBtn.vue index b179da3..cc82b5b 100644 --- a/src/components/button/BoardRecommendBtn.vue +++ b/src/components/button/BoardRecommendBtn.vue @@ -62,27 +62,28 @@ watch(() => props.dislikeCount, (newVal) => { }); const handleLike = () => { - likeClicked.value = !likeClicked.value; - likeCount.value += likeClicked.value ? 1 : -1; + // console.log('adadasd') + // likeClicked.value = !likeClicked.value; + // likeCount.value += likeClicked.value ? 1 : -1; emit('updateReaction', { type: 'like', boardId: props.boardId, commentId: props.commentId }); - if(likeClicked.value === true){ - if(dislikeClicked.value === true) { - dislikeClicked.value = false; - dislikeCount.value += -1 - } - } + // if(likeClicked.value === true){ + // if(dislikeClicked.value === true) { + // dislikeClicked.value = false; + // dislikeCount.value += -1 + // } + // } }; const handleDislike = () => { - dislikeClicked.value = !dislikeClicked.value; - dislikeCount.value += dislikeClicked.value ? 1 : -1; + // dislikeClicked.value = !dislikeClicked.value; + // dislikeCount.value += dislikeClicked.value ? 1 : -1; emit('updateReaction', { type: 'dislike', boardId: props.boardId, commentId: props.commentId }); - if(dislikeClicked.value === true){ - if(likeClicked.value === true) { - likeClicked.value = false; - likeCount.value += -1 - } - } + // if(dislikeClicked.value === true){ + // if(likeClicked.value === true) { + // likeClicked.value = false; + // likeCount.value += -1 + // } + // } }; diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index e6aa5cc..8f81baa 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -100,6 +100,8 @@ const date = ref(''); const views = ref(0); const likes = ref(0); const dislikes = ref(0); +const likeClicked = ref(false); +const dislikeClicked = ref(false); const comments = ref(0); const attachment = ref(false); @@ -120,10 +122,9 @@ const fetchBoardDetails = async () => { const data = response.data.data; // API 응답 데이터 반영 - const boardDetail = data.boardDetail || {}; - // console.log('boardDetail:', boardDetail); + // const boardDetail = data.boardDetail || {}; - console.log('API Response:', response.data); + // console.log('API Response:', response.data); profileName.value = data.author || '익명 사용자'; boardTitle.value = data.title || '제목 없음'; @@ -134,7 +135,6 @@ const fetchBoardDetails = async () => { dislikes.value = data.dislikeCount || 0; attachment.value = data.hasAttachment || null; comments.value = data.commentCount || 0; - console.log(date.value) } catch (error) { alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.'); @@ -144,9 +144,33 @@ const fetchBoardDetails = async () => { // 좋아요, 싫어요 const handleUpdateReaction = async ({ type, boardId, commentId }) => { try { - const cmtId = commentId !== null ? commentId : 0; + //이거 왜 한건지 찾아보자 + const response = await axios.post(`/board/${boardId}/${commentId}/reaction`, { type }); - const response = await axios.post(`/board/${boardId}/${cmtId}/reaction`, { type }); + // console.log('API 응답:', response.data); + // console.log(commentId) + + if (response.data.code === 200) { + if (type === 'like') { + likeClicked.value = !likeClicked.value; + likes.value += likeClicked.value ? 1 : -1; + } else if (type === 'dislike') { + dislikeClicked.value = !dislikeClicked.value; + dislikes.value += dislikeClicked.value ? 1 : -1; + } + } else { + alert('반응 업데이트 실패'); + } + // likes.value = response.data.likeCount; + // dislikes.value = response.data.dislikeCount; + + // if (type === 'like') { + // likeClicked.value = !likeClicked.value; + // console.log('aaaa' ,response.data) + + // } else if (type === 'dislike') { + // console.log('싫어') + // } } catch (error) { alert('반응을 업데이트하는 중 오류 발생'); } From 68c096b43f62ec06bfd0370ed1e64347b8001042 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 4 Feb 2025 16:15:47 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardList.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 1b528c5..f5428dc 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -60,6 +60,7 @@ 공지 📌 {{ notice.title }} + N @@ -76,6 +77,7 @@ {{ post.id }} {{ post.title }} + N @@ -190,7 +192,8 @@ const fetchGeneralPosts = async (page = 1) => { author: post.author || '익명', date: formatDate(post.date), // 날짜 변환 적용 views: post.cnt || 0, - hasAttachment: post.hasAttachment || false + hasAttachment: post.hasAttachment || false, + img: post.firstImageUrl || null })); pagination.value = { @@ -228,7 +231,8 @@ const fetchNoticePosts = async () => { author: post.author || '관리자', date: formatDate(post.date), // 날짜 변환 적용 views: post.cnt || 0, - hasAttachment: post.hasAttachment || false + hasAttachment: post.hasAttachment || false, + img: post.firstImageUrl || null })); } } catch (error) { From 67bb83277aaa44fa83e733f66e369c53c39dedf0 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 4 Feb 2025 16:21:07 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=B2=88=ED=98=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardList.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index f5428dc..28aacfc 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -51,7 +51,7 @@ - +