게시물 닉네임 수정,회원등록 경고문구 css 수정

This commit is contained in:
dyhj625 2025-03-21 10:14:50 +09:00
parent ae9c8735b1
commit 724816eb82
7 changed files with 37 additions and 7 deletions

View File

@ -7,7 +7,6 @@
/* board */ /* board */
.board-content img { .board-content img {
max-width: 100% !important; max-width: 100% !important;
width: 100% !important;
height: auto !important; height: auto !important;
display: block; display: block;
object-fit: contain; object-fit: contain;

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="me-2"> <div class="me-2">
<h6 class="mb-0">{{ profileName }}</h6> <h6 class="mb-0">{{ displayName }}</h6>
<div class="profile-detail"> <div class="profile-detail">
<span>{{ date }}</span> <span>{{ date }}</span>
<template v-if="showDetail"> <template v-if="showDetail">
@ -58,6 +58,10 @@
type: Number, type: Number,
required: false, required: false,
}, },
nickname: {
type: String,
default: '',
},
profileName: { profileName: {
type: String, type: String,
default: '', default: '',
@ -101,6 +105,10 @@
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']); const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
const $common = inject('common'); const $common = inject('common');
const displayName = computed(() => {
return props.nickname?props.nickname : props.name;
});
const isDeletedComment = computed(() => { const isDeletedComment = computed(() => {
return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw; return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw;
}); });

View File

@ -5,7 +5,7 @@
<span :class="isEssential ? 'link-danger' : 'd-none'">*</span> <span :class="isEssential ? 'link-danger' : 'd-none'">*</span>
</label> </label>
<div class="col-md-12"> <div class="col-md-12">
<div v-if="useInputGroup" class="input-group mb-3"> <div v-if="useInputGroup" class="input-group mb-1">
<input <input
:id="name" :id="name"
class="form-control" class="form-control"

View File

@ -101,7 +101,7 @@
<span v-if="isNewPost(post.rawDate)" class="box-new badge text-white ms-2 fs-tiny">N</span> <span v-if="isNewPost(post.rawDate)" class="box-new badge text-white ms-2 fs-tiny">N</span>
</div> </div>
</td> </td>
<td class="text-center">{{ post.author }}</td> <td class="text-center">{{ post.nickname ? post.nickname : post.author }}</td>
<td class="text-center">{{ post.date }}</td> <td class="text-center">{{ post.date }}</td>
<td class="text-center">{{ post.views }}</td> <td class="text-center">{{ post.views }}</td>
</tr> </tr>
@ -219,6 +219,7 @@
date: formatDate(post.date), // date: formatDate(post.date), //
views: post.cnt || 0, views: post.cnt || 0,
hasAttachment: post.hasAttachment, hasAttachment: post.hasAttachment,
nickname: post.nickname || null,
img: post.firstImageUrl || null, img: post.firstImageUrl || null,
commentCount: post.commentCount, commentCount: post.commentCount,
})); }));

View File

@ -12,6 +12,7 @@
:unknown="unknown" :unknown="unknown"
:profileImg="profileImg" :profileImg="profileImg"
:views="views" :views="views"
:nickname="nickname"
:commentNum="commentNum" :commentNum="commentNum"
:date="formattedBoardDate" :date="formattedBoardDate"
:isLike="false" :isLike="false"
@ -151,6 +152,7 @@
const profileName = ref(''); const profileName = ref('');
const boardTitle = ref('제목 없음'); const boardTitle = ref('제목 없음');
const boardContent = ref(''); const boardContent = ref('');
const nickname = ref('');
const date = ref(''); const date = ref('');
const views = ref(0); const views = ref(0);
const likes = ref(0); const likes = ref(0);
@ -257,6 +259,7 @@
boardContent.value = boardData.content || ''; boardContent.value = boardData.content || '';
profileImg.value = boardData.profileImg || ''; profileImg.value = boardData.profileImg || '';
date.value = boardData.date || ''; date.value = boardData.date || '';
nickname.value = boardData.nickname || '';
views.value = boardData.cnt || 0; views.value = boardData.cnt || 0;
likes.value = boardData.likeCount || 0; likes.value = boardData.likeCount || 0;
dislikes.value = boardData.dislikeCount || 0; dislikes.value = boardData.dislikeCount || 0;

View File

@ -42,6 +42,15 @@
<!-- 비밀번호 필드 (익명게시판 선택 활성화) --> <!-- 비밀번호 필드 (익명게시판 선택 활성화) -->
<div v-if="categoryValue === 300102" class="mb-4"> <div v-if="categoryValue === 300102" class="mb-4">
<FormInput
title="닉네임"
name="nickname"
:is-essential="true"
:is-alert="nicknameAlert"
v-model="nickname"
@update:alert="nicknameAlert = $event"
@input="validateNickname"
/>
<FormInput <FormInput
title="비밀번호" title="비밀번호"
name="pw" name="pw"
@ -112,12 +121,14 @@
const toastStore = useToastStore(); const toastStore = useToastStore();
const categoryList = ref([]); const categoryList = ref([]);
const title = ref(''); const title = ref('');
const nickname = ref("");
const password = ref(''); const password = ref('');
const categoryValue = ref(null); const categoryValue = ref(null);
const content = ref({ ops: [] }); const content = ref({ ops: [] });
const isFileValid = ref(true); const isFileValid = ref(true);
const titleAlert = ref(false); const titleAlert = ref(false);
const nicknameAlert = ref(false);
const passwordAlert = ref(false); const passwordAlert = ref(false);
const contentAlert = ref(false); const contentAlert = ref(false);
const categoryAlert = ref(false); const categoryAlert = ref(false);
@ -172,6 +183,14 @@
titleAlert.value = title.value.trim().length === 0; titleAlert.value = title.value.trim().length === 0;
}; };
const validateNickname = () => {
if (categoryValue.value === 300102) {
nicknameAlert.value = nickname.value.trim().length === 0;
} else {
nicknameAlert.value = false;
}
};
const validatePassword = () => { const validatePassword = () => {
if (categoryValue.value === 300102) { if (categoryValue.value === 300102) {
password.value = password.value.replace(/\s/g, ''); // password.value = password.value.replace(/\s/g, ''); //
@ -199,11 +218,12 @@
/** 글쓰기 */ /** 글쓰기 */
const write = async () => { const write = async () => {
validateTitle(); validateTitle();
validateNickname();
validatePassword(); validatePassword();
validateContent(); validateContent();
categoryAlert.value = categoryValue.value == null; categoryAlert.value = categoryValue.value == null;
if (titleAlert.value || passwordAlert.value || contentAlert.value || categoryAlert.value || !isFileValid.value) { if (titleAlert.value || nicknameAlert.value || passwordAlert.value || contentAlert.value || categoryAlert.value || !isFileValid.value) {
return; return;
} }
@ -211,6 +231,7 @@
const boardData = { const boardData = {
LOCBRDTTL: title.value, LOCBRDTTL: title.value,
LOCBRDCON: JSON.stringify(content.value), // Delta JSON LOCBRDCON: JSON.stringify(content.value), // Delta JSON
LOCBRDNIC: categoryValue.value === 300102 ? nickname.value : null,
LOCBRDPWD: categoryValue.value === 300102 ? password.value : null, LOCBRDPWD: categoryValue.value === 300102 ? password.value : null,
LOCBRDTYP: categoryValue.value, LOCBRDTYP: categoryValue.value,
}; };

View File

@ -180,7 +180,6 @@ function handleDateClick(info) {
// //
if (currentValue && currentValue !== "delete") { if (currentValue && currentValue !== "delete") {
console.log("🛑 활성화된 날짜 비활성화:", clickedDateStr);
selectedDates.value.delete(clickedDateStr); selectedDates.value.delete(clickedDateStr);
updateCalendarEvents(); updateCalendarEvents();
return; return;
@ -203,7 +202,6 @@ function handleDateClick(info) {
// - // -
if (isMyVacation) { if (isMyVacation) {
console.log("🗑 기존 휴가 삭제 후 새로운 상태 추가:", clickedDateStr);
selectedDates.value.set(clickedDateStr, "delete"); selectedDates.value.set(clickedDateStr, "delete");
} }