44 :isOpen =" isModalVisible"
55 :type =" 'successType'"
66 @close =" handleCancel" >
7- <template #header > 정보가 수정되었습니다 </template >
7+ <template #header >정보가 수정되었습니다</template >
88 </ModalView >
99
1010 <ModalView
1111 :isOpen =" isWarnningModalVisible"
1212 :type =" 'warningType'"
1313 @click =" changePw"
1414 @close =" warningModalToggle" >
15- <template #header > 정보가 저장되지 않았습니다 </template >
16- <template #body > 수정 사항을 삭제하고 이동하시겠습니까? </template >
15+ <template #header >정보가 저장되지 않았습니다</template >
16+ <template #body >수정 사항을 삭제하고 이동하시겠습니까?</template >
1717 </ModalView >
1818
1919 <div class =" profile" >
5151 <span class =" absolute top-1 right-2 text-xs text-gray-500" > {{ name.length }} / 10 </span >
5252 <input
5353 :class =" [
54- 'block w-full px-4 py-4 border rounded focus:outline-none h-11 mt-2 text-black ',
55- isInvalid ? 'border-red-1' : 'border-border-1'
54+ 'block w-full px-4 py-4 border rounded focus:outline-none h-11 mt-2',
55+ isInvalid || isFull ? 'border-red-1' : 'border-border-1'
5656 ]"
5757 placeholder =" 이름을 입력해주세요"
5858 v-model =" name"
5959 maxlength =" 10"
6060 ref =" nameInput"
6161 @blur =" validateName" />
62- <span
63- v-show =" isInvalid"
64- class =" text-red-1 text-xs font-bold mt-1"
65- >이름에는 특수문자가 포함될 수 없습니다.</span
66- >
62+ <div class =" mb-1" >
63+ <span
64+ v-show =" isInvalid"
65+ class =" absolute text-red-1 text-xs font-bold mt-1"
66+ >이름에는 특수문자가 포함될 수 없습니다.</span
67+ >
68+ <span
69+ v-show =" isFull"
70+ class =" absolute text-red-1 text-xs font-bold mt-1"
71+ >이름은 1글자 이상, 10글자이하만 가능합니다.</span
72+ >
73+ </div >
6774 </div >
6875 <div class =" flex flex-col" >
6976 <p class =" text-body text-xs font-bold" >아이디</p >
70- <p class =" mt-2 text-black " >{{ info.nickname }}</p >
77+ <p class =" mt-2" >{{ info.nickname }}</p >
7178 </div >
7279 <div class =" flex flex-col" >
7380 <p class =" text-body text-xs font-bold" >이메일</p >
74- <p class =" mt-2 text-black " >{{ info.email }}</p >
81+ <p class =" mt-2" >{{ info.email }}</p >
7582 </div >
7683 <div class =" flex flex-col" >
7784 <p class =" text-body text-xs font-bold" >부서</p >
78- <p class =" mt-2 text-black " >{{ info.departmentName }}</p >
85+ <p class =" mt-2" >{{ info.departmentName }}</p >
7986 </div >
8087 <div
8188 v-if =" info.departmentRole"
8289 class =" flex flex-col" >
8390 <p class =" text-body text-xs font-bold" >직무</p >
84- <p class =" mt-2 text-black " >{{ info.departmentRole }}</p >
91+ <p class =" mt-2" >{{ info.departmentRole }}</p >
8592 </div >
8693 <div >
8794 <p class =" text-body text-xs font-bold" >알림 수신 여부</p >
8895 <div class =" flex flex-col mt-2 gap-2" >
89- <FormCheckbox
90- v-model =" agitCheck"
91- :checkButtonName =" '아지트'"
92- :isChecked =" agitCheck" />
9396 <FormCheckbox
9497 v-model =" kakaoWorkCheck"
9598 :checkButtonName =" '카카오워크'"
@@ -134,7 +137,6 @@ const memberStore = useMemberStore()
134137const { info } = storeToRefs (memberStore )
135138
136139const name = ref (info .value .name )
137- const agitCheck = ref (info .value .notificationSettingInfo .agit )
138140const emailCheck = ref (info .value .notificationSettingInfo .email )
139141const kakaoWorkCheck = ref (info .value .notificationSettingInfo .kakaoWork )
140142const imageDelete = ref (info .value .profileImageUrl == null ? true : false )
@@ -143,6 +145,7 @@ const selectedFile = ref<File | null>(null)
143145const previewUrl = ref <string | null >(null )
144146
145147const isInvalid = ref (false )
148+ const isFull = ref (false )
146149const nameInput = ref <HTMLInputElement | null >(null )
147150
148151const isModalVisible = ref (false )
@@ -151,7 +154,6 @@ const isWarnningModalVisible = ref(false)
151154watchEffect (() => {
152155 if (info .value ) {
153156 name .value = info .value .name
154- agitCheck .value = info .value .notificationSettingInfo .agit
155157 emailCheck .value = info .value .notificationSettingInfo .email
156158 kakaoWorkCheck .value = info .value .notificationSettingInfo .kakaoWork
157159 }
@@ -160,8 +162,13 @@ watchEffect(() => {
160162const validateName = () => {
161163 const regex = / [!@#$%^&*(),. ?":{}|<>] / g
162164 isInvalid .value = regex .test (name .value )
165+ if (name .value .length > 10 || name .value .length < 1 ) {
166+ isFull .value = true
167+ } else {
168+ isFull .value = false
169+ }
163170
164- if (isInvalid .value ) {
171+ if (isInvalid .value || isFull . value ) {
165172 nextTick (() => {
166173 nameInput .value ?.focus ()
167174 })
@@ -175,7 +182,6 @@ const handlePwChange = () => {
175182 if (
176183 selectedFile .value ||
177184 info .value .name != name .value ||
178- info .value .notificationSettingInfo .agit != agitCheck .value ||
179185 info .value .notificationSettingInfo .kakaoWork != kakaoWorkCheck .value ||
180186 info .value .notificationSettingInfo .email != emailCheck .value
181187 ) {
@@ -186,7 +192,7 @@ const handlePwChange = () => {
186192}
187193
188194const changePw = () => {
189- router .push (' /pw-check' )
195+ router .replace (' /pw-check' )
190196}
191197
192198const warningModalToggle = () => {
@@ -209,12 +215,11 @@ const handleFileDelete = () => {
209215}
210216
211217const handleSubmit = async () => {
212- if (isInvalid .value == false ) {
218+ if (isInvalid .value == false && isFull . value == false ) {
213219 const formData = new FormData ()
214220 const memberInfo = {
215221 name: name .value ,
216222 isProfileImageDeleted: imageDelete .value ,
217- agitNotification: agitCheck .value ,
218223 emailNotification: emailCheck .value ,
219224 kakaoWorkNotification: kakaoWorkCheck .value
220225 }
0 commit comments