diff --git a/public/img/mbti/enfj.png b/public/img/mbti/enfj.png new file mode 100644 index 0000000..2d85491 Binary files /dev/null and b/public/img/mbti/enfj.png differ diff --git a/public/img/mbti/enfp.png b/public/img/mbti/enfp.png new file mode 100644 index 0000000..abc6c69 Binary files /dev/null and b/public/img/mbti/enfp.png differ diff --git a/public/img/mbti/entj.png b/public/img/mbti/entj.png new file mode 100644 index 0000000..7ef1341 Binary files /dev/null and b/public/img/mbti/entj.png differ diff --git a/public/img/mbti/entp.png b/public/img/mbti/entp.png new file mode 100644 index 0000000..84b2a11 Binary files /dev/null and b/public/img/mbti/entp.png differ diff --git a/public/img/mbti/esfj.png b/public/img/mbti/esfj.png new file mode 100644 index 0000000..0548975 Binary files /dev/null and b/public/img/mbti/esfj.png differ diff --git a/public/img/mbti/esfp.png b/public/img/mbti/esfp.png new file mode 100644 index 0000000..a3932e6 Binary files /dev/null and b/public/img/mbti/esfp.png differ diff --git a/public/img/mbti/est.png b/public/img/mbti/est.png new file mode 100644 index 0000000..720aa00 Binary files /dev/null and b/public/img/mbti/est.png differ diff --git a/public/img/mbti/estp.png b/public/img/mbti/estp.png new file mode 100644 index 0000000..036e95f Binary files /dev/null and b/public/img/mbti/estp.png differ diff --git a/public/img/mbti/infj.png b/public/img/mbti/infj.png new file mode 100644 index 0000000..4660186 Binary files /dev/null and b/public/img/mbti/infj.png differ diff --git a/public/img/mbti/infp.png b/public/img/mbti/infp.png new file mode 100644 index 0000000..442b8dd Binary files /dev/null and b/public/img/mbti/infp.png differ diff --git a/public/img/mbti/intj.png b/public/img/mbti/intj.png new file mode 100644 index 0000000..39b06a2 Binary files /dev/null and b/public/img/mbti/intj.png differ diff --git a/public/img/mbti/intp.png b/public/img/mbti/intp.png new file mode 100644 index 0000000..8dbb981 Binary files /dev/null and b/public/img/mbti/intp.png differ diff --git a/public/img/mbti/isfj.png b/public/img/mbti/isfj.png new file mode 100644 index 0000000..7dad009 Binary files /dev/null and b/public/img/mbti/isfj.png differ diff --git a/public/img/mbti/isfp.png b/public/img/mbti/isfp.png new file mode 100644 index 0000000..61e4bad Binary files /dev/null and b/public/img/mbti/isfp.png differ diff --git a/public/img/mbti/istj.png b/public/img/mbti/istj.png new file mode 100644 index 0000000..4924396 Binary files /dev/null and b/public/img/mbti/istj.png differ diff --git a/public/img/mbti/istp.png b/public/img/mbti/istp.png new file mode 100644 index 0000000..276f39c Binary files /dev/null and b/public/img/mbti/istp.png differ diff --git a/src/components/input/FormInput.vue b/src/components/input/FormInput.vue index a51c16c..d1ad6fd 100644 --- a/src/components/input/FormInput.vue +++ b/src/components/input/FormInput.vue @@ -15,6 +15,7 @@ :disabled="disabled" :min="min" @focusout="$emit('focusout', modelValue)" + @input="handleInput" />
{{ title }}을 확인해주세요. @@ -92,11 +93,6 @@ const inputValue = ref(props.modelValue); // 부모로 데이터 업데이트 watch(inputValue, (newValue) => { emits('update:modelValue', newValue); - - // 값이 입력될 때 `alert`를 false로 설정 - if (newValue.trim() !== '') { - emits('update:alert', false); - } }); // 초기값 동기화 @@ -106,6 +102,13 @@ watch(() => props.modelValue, (newValue) => { } }); +const handleInput = (event) => { + const newValue = event.target.value.slice(0, props.maxlength); + + if (newValue.trim() !== '') { + emits('update:alert', false); + } +}; diff --git a/src/components/input/FormSelect.vue b/src/components/input/FormSelect.vue index 1115ea7..1da67e5 100644 --- a/src/components/input/FormSelect.vue +++ b/src/components/input/FormSelect.vue @@ -4,19 +4,30 @@ {{ title }} * -
- + + +
+
+ + MBTI image
{{ title }}을 확인해주세요.
\ No newline at end of file + + +const selected = computed(() => { + const selectedItem = props.data.find(item => + props.isCommon ? item.value === selectData.value : props.data.indexOf(item) === selectData.value + ); + return selectedItem ? selectedItem.label : null; +}); + + diff --git a/src/components/user/FindPassword.vue b/src/components/user/FindPassword.vue index 0260908..09866eb 100644 --- a/src/components/user/FindPassword.vue +++ b/src/components/user/FindPassword.vue @@ -68,20 +68,21 @@ :is-alert="passwordcheckAlert" @update:data="passwordcheck = $event" @update:alert="passwordcheckAlert = $event" - @blur="checkPw" + @input="checkPw" :value="passwordcheck" /> {{ passwordcheckError }} -
- -

{{ pwErrMsg }}

+
+ +
+

{{ pwErrMsg }}

diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue index 2953ea3..5a5b557 100644 --- a/src/components/user/RegisterForm.vue +++ b/src/components/user/RegisterForm.vue @@ -92,6 +92,7 @@ :is-row="false" :is-label="true" :is-common="true" + :is-color="true" :data="colorList" @update:data="color = $event" class="w-50" @@ -118,6 +119,7 @@ :is-row="false" :is-label="true" :is-common="true" + :is-mbti="true" :data="mbtiList" @update:data="mbti = $event" class="w-50" diff --git a/src/views/board/BoardWrite.vue b/src/views/board/BoardWrite.vue index b337d6c..45d2657 100644 --- a/src/views/board/BoardWrite.vue +++ b/src/views/board/BoardWrite.vue @@ -9,12 +9,15 @@
+ @@ -32,16 +35,19 @@ :id="`category-${index}`" :value="category.CMNCODVAL" v-model="categoryValue" + @change="categoryAlert = false" />
-
카테고리를 선택해주세요.
+
+ 카테고리를 선택해주세요. +
- +
@@ -61,14 +69,16 @@ @update:isValid="isFileValid = $event" /> +
-
@@ -115,10 +125,9 @@ const fetchCategories = async () => { try { const response = await axios.get('board/categories'); categoryList.value = response.data.data; - // "자유" 카테고리 찾기 (CMNCODNAM이 '자유'인 것 선택) const freeCategory = categoryList.value.find(category => category.CMNCODNAM === '자유'); if (freeCategory) { - categoryValue.value = freeCategory.CMNCODVAL; // 기본 선택값 설정 + categoryValue.value = freeCategory.CMNCODVAL; } } catch (error) { console.error('카테고리 불러오기 오류:', error); @@ -129,15 +138,44 @@ onMounted(() => { fetchCategories(); }); +// 제목 유효성 검사: 공백만 입력하면 경고 유지, 문자 포함 시 정상 +const validateTitle = () => { + titleAlert.value = title.value.trim().length === 0; +}; + +// 비밀번호 유효성 검사: 공백 입력 방지 +const validatePassword = () => { + password.value = password.value.replace(/\s/g, ""); // 공백 제거 + passwordAlert.value = password.value.length === 0; +}; + +// 에디터에서 업데이트된 데이터를 반영하는 함수 +const updateContent = (data) => { + let rawText = ''; + + if (typeof data === 'object' && data.ops) { + rawText = data.ops.map(op => (typeof op.insert === 'string' ? op.insert : '')).join('').trim(); + } else if (typeof data === 'string') { + rawText = data.replace(/(<([^>]+)>)/gi, "").trim(); + } else { + rawText = ''; + } + + content.value = rawText.length > 0 ? data : ""; + contentAlert.value = rawText.length === 0; +}; + +/** 페이지 이동 (목록으로 이동) */ const goList = () => { router.push('/board'); }; const write = async () => { - titleAlert.value = !title.value; - passwordAlert.value = categoryValue.value === 300102 && !password.value; - contentAlert.value = !content.value; + validateTitle(); + validatePassword(); + categoryAlert.value = !categoryValue.value; + contentAlert.value = content.value.length === 0; if (titleAlert.value || passwordAlert.value || contentAlert.value || categoryAlert.value || !isFileValid.value) { return; @@ -154,26 +192,6 @@ const write = async () => { const { data: boardResponse } = await axios.post('board', boardData); const boardId = boardResponse.data; - if (attachFiles.value && attachFiles.value.length > 0) { - for (const file of attachFiles.value) { - const formData = new FormData(); - const fileNameWithoutExt = file.name.replace(/\.[^/.]+$/, ''); - - formData.append('CMNBRDSEQ', boardId); - formData.append('CMNFLEORG', fileNameWithoutExt); - formData.append('CMNFLEEXT', file.name.split('.').pop()); - formData.append('CMNFLESIZ', file.size); - formData.append('CMNFLEPAT', 'boardfile'); - formData.append('file', file); - - await axios.post(`board/${boardId}/attachments`, formData, { - headers: { - 'Content-Type': 'multipart/form-data', - }, - }); - } - } - toastStore.onToast('게시물이 작성되었습니다.', 's'); goList(); } catch (error) {