Merge branch 'board-comment' of http://192.168.0.251:3000/localnet/localhost-front into board-comment

This commit is contained in:
kimdaae328 2025-02-25 11:12:38 +09:00
commit 1500ea25e0
2 changed files with 15 additions and 15 deletions

View File

@ -48,7 +48,7 @@
<PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/> <PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/>
<BoardCommentArea v-if="isComment" @submitComment="submitComment"/> <BoardCommentArea v-if="isComment" @submitComment="submitComment"/>
<!-- 대댓글 --> <!-- 대댓글 -->
<ul v-if="comment.children && comment.children.length" class="list-unstyled"> <ul v-if="comment.children && comment.children.length" class="list-unstyled">
<li <li
@ -61,7 +61,7 @@
<BoardComment <BoardComment
:comment="child" :comment="child"
:unknown="unknown" :unknown="unknown"
:isPlusButton="false" :isPlusButton="false"
:isLike="true" :isLike="true"
:isCommentProfile="true" :isCommentProfile="true"
:isCommentAuthor="child.isCommentAuthor" :isCommentAuthor="child.isCommentAuthor"
@ -149,7 +149,7 @@ const handleUpdateReaction = (reactionData) => {
// //
const logPasswordAndEmit = () => { const logPasswordAndEmit = () => {
emit('submitPassword', props.comment, password.value); emit('submitPassword', props.comment, password.value);
password.value = ""; password.value = "";
}; };
watch(() => props.comment.isEditTextarea, (newVal) => { watch(() => props.comment.isEditTextarea, (newVal) => {

View File

@ -59,10 +59,10 @@
</ul> --> </ul> -->
</div> </div>
</div> </div>
<!-- HTML 콘텐츠 렌더링 --> <!-- HTML 콘텐츠 렌더링 -->
<div class="board-content text-body" style="line-height: 1.6;" v-html="$common.contentToHtml(boardContent)"></div> <div class="board-content text-body" style="line-height: 1.6;" v-html="$common.contentToHtml(boardContent)"></div>
<!-- 좋아요 버튼 --> <!-- 좋아요 버튼 -->
<div class="row justify-content-center my-10"> <div class="row justify-content-center my-10">
<BoardRecommendBtn <BoardRecommendBtn
@ -78,11 +78,11 @@
</div> </div>
<p>현재 로그인한 사용자 ID: {{ currentUserId }}</p> <p>현재 로그인한 사용자 ID: {{ currentUserId }}</p>
<p>게시글 작성자: {{ authorId }}</p> <p>게시글 작성자: {{ authorId }}</p>
<p>isAuthor : {{ isAuthor }}</p> <p>isAuthor : {{ isAuthor }}</p>
<!-- <p>use이미지:{{userStore.user.img}}</p> --> <!-- <p>use이미지:{{userStore.user.img}}</p> -->
<!-- <img :src="`http://localhost:10325/upload/img/profile/${userStore.user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/> --> <!-- <img :src="`http://localhost:10325/upload/img/profile/${userStore.user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/> -->
<!-- 첨부파일 목록 --> <!-- 첨부파일 목록 -->
<!-- <ul v-if="attachments.length" class="attachments mt-4 list-unstyled"> <!-- <ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
<li v-for="(attachment, index) in attachments" :key="index" class="mb-2"> <li v-for="(attachment, index) in attachments" :key="index" class="mb-2">
@ -217,8 +217,8 @@ const fetchBoardDetails = async () => {
// //
// profileName.value = ''; // profileName.value = '';
authorId.value = data.authorId; // id authorId.value = data.authorId; // id
boardTitle.value = data.title || '제목 없음'; boardTitle.value = data.title || '제목 없음';
boardContent.value = data.content || ''; boardContent.value = data.content || '';
@ -228,7 +228,7 @@ const fetchBoardDetails = async () => {
dislikes.value = data.dislikeCount || 0; dislikes.value = data.dislikeCount || 0;
attachment.value = data.hasAttachment || null; attachment.value = data.hasAttachment || null;
commentNum.value = data.commentCount || 0; commentNum.value = data.commentCount || 0;
} catch (error) { } catch (error) {
alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.'); alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.');
} }
@ -587,7 +587,7 @@ const submitPassword = async () => {
// ( ) // ( )
const submitCommentPassword = async (comment, password) => { const submitCommentPassword = async (comment, password) => {
if (!password) { if (!password) {
passwordCommentAlert.value = "비밀번호를 입력해주세요."; passwordCommentAlert.value = "비밀번호를 입력해주세요.";
return; return;
@ -602,12 +602,12 @@ const submitCommentPassword = async (comment, password) => {
if (response.data.code === 200 && response.data.data === true) { if (response.data.code === 200 && response.data.data === true) {
passwordCommentAlert.value = ""; passwordCommentAlert.value = "";
comment.isCommentPassword = false; comment.isCommentPassword = false;
if (lastCommentClickedButton.value === "edit") { if (lastCommentClickedButton.value === "edit") {
comment.isEditTextarea = true; comment.isEditTextarea = true;
passwordCommentAlert.value = ""; passwordCommentAlert.value = "";
// handleSubmitEdit(comment, comment.content); // handleSubmitEdit(comment, comment.content);
} else if (lastCommentClickedButton.value === "delete") { } else if (lastCommentClickedButton.value === "delete") {
passwordCommentAlert.value = ""; passwordCommentAlert.value = "";
@ -660,7 +660,7 @@ const deleteReplyComment = async (comment) => {
if (response.data.code === 200) { if (response.data.code === 200) {
// console.log(" !"); // console.log(" !");
await fetchComments(); await fetchComments();
} else { } else {
// console.log(" :", response.data.message); // console.log(" :", response.data.message);
alert("댓글 삭제에 실패했습니다."); alert("댓글 삭제에 실패했습니다.");