diff --git a/src/components/common/EditInformation.vue b/src/components/common/EditInformation.vue index 0dd5b36..7a4b7b2 100644 --- a/src/components/common/EditInformation.vue +++ b/src/components/common/EditInformation.vue @@ -56,8 +56,15 @@ class="hidden" />
-

이름

- {{ name.length }} / 10 +
+

이름

+

*

+ {{ nameError }} +
-
- {{ nameError }} -
+ {{ name.length }} / 10

아이디

diff --git a/src/components/common/ModalView.vue b/src/components/common/ModalView.vue index 93acc36..fc2a2f1 100644 --- a/src/components/common/ModalView.vue +++ b/src/components/common/ModalView.vue @@ -81,9 +81,9 @@ diff --git a/src/components/request-task/RequestTask.vue b/src/components/request-task/RequestTask.vue index 8fc2200..69cb504 100644 --- a/src/components/request-task/RequestTask.vue +++ b/src/components/request-task/RequestTask.vue @@ -18,11 +18,13 @@ v-model="title" :placeholderText="'제목을 입력해주세요'" :label-name="'제목'" - :is-invalidate="isInvalidate" /> + :is-invalidate="isInvalidate" + :limit-length="30" /> + :placeholderText="'부가 정보를 입력해주세요'" + :limit-length="200" /> { if (file.value && file.value.length > 0) { file.value.forEach(f => formData.append('attachment', f)) } - try { - await postTaskRequest(formData) - isModalVisible.value = 'success' - } finally { - isSubmitting.value = false - } + await postTaskRequest(formData) + isModalVisible.value = 'success' + isSubmitting.value = false } diff --git a/src/components/request-task/RequestTaskFileInput.vue b/src/components/request-task/RequestTaskFileInput.vue index ef79ca3..8b83e29 100644 --- a/src/components/request-task/RequestTaskFileInput.vue +++ b/src/components/request-task/RequestTaskFileInput.vue @@ -79,6 +79,8 @@ const handleFileUpload = (event: Event) => { } const handleDrop = (event: DragEvent) => { + event.preventDefault() + isDragging.value = false const files = event.dataTransfer?.files if (files && files.length > 0) { const newFiles = Array.from(files).filter(file => file.size <= 5 * 1024 * 1024) diff --git a/src/components/request-task/RequestTaskInput.vue b/src/components/request-task/RequestTaskInput.vue index b90d26e..675477e 100644 --- a/src/components/request-task/RequestTaskInput.vue +++ b/src/components/request-task/RequestTaskInput.vue @@ -4,12 +4,20 @@

{{ labelName }}

*

{{ labelName }}을 입력해주세요

+

+ {{ labelName }}을 입력해주세요 +

회원아이디가 중복되었습니다

제목은 30자 이내로 적어주세요

작업코드를 입력해주세요

사용할 수 없는 작업코드입니다

카테고리명을 입력해주세요

-

잘못된 형식의 아이디입니다

+

+ 잘못된 형식의 아이디입니다. +

+

+ 잘못된 형식의 도메인입니다. +

+

+ ({{ inputLength }}/{{ limitLength }}) +

diff --git a/src/components/request-task/RequestTaskTextArea.vue b/src/components/request-task/RequestTaskTextArea.vue index 6532775..2da712c 100644 --- a/src/components/request-task/RequestTaskTextArea.vue +++ b/src/components/request-task/RequestTaskTextArea.vue @@ -1,6 +1,6 @@ @@ -18,11 +23,14 @@ import type { RequestTaskTextAreaProps } from '@/types/user' import { computed } from 'vue' -const { modelValue, placeholderText, isInvalidate } = defineProps() +const { modelValue, placeholderText, isInvalidate, limitLength } = + defineProps() const emit = defineEmits(['update:modelValue']) const isInvalidateState = computed(() => isInvalidate) const updateValue = (value: string) => { emit('update:modelValue', value) } + +const inputLength = computed(() => modelValue.length) diff --git a/src/components/requested/RequestedListCard.vue b/src/components/requested/RequestedListCard.vue index ac0961a..6790483 100644 --- a/src/components/requested/RequestedListCard.vue +++ b/src/components/requested/RequestedListCard.vue @@ -107,7 +107,7 @@ const rejectRequest = async () => { modalError.value = '반려 사유를 입력해주세요' return } - await axiosInstance.patch(`/api/tasks/${info.taskId}/terminate`, rejectReason) + await axiosInstance.patch(`/api/tasks/${info.taskId}/terminate`, { reason: rejectReason.value }) toggleModal('success') } diff --git a/src/components/task-detail/TaskDetailHistory.vue b/src/components/task-detail/TaskDetailHistory.vue index cd67649..cc3ca58 100644 --- a/src/components/task-detail/TaskDetailHistory.vue +++ b/src/components/task-detail/TaskDetailHistory.vue @@ -40,7 +40,9 @@
diff --git a/src/components/task-detail/TaskDetailHistoryChat.vue b/src/components/task-detail/TaskDetailHistoryChat.vue index f70ef91..de63887 100644 --- a/src/components/task-detail/TaskDetailHistoryChat.vue +++ b/src/components/task-detail/TaskDetailHistoryChat.vue @@ -21,7 +21,7 @@ 'flex max-w-[400px] flex-wrap px-4 py-3 text-base rounded-lg font-normal', isRequestor ? 'bg-background-2' : 'bg-primary2' ]"> - {{ history.details.commentDetails?.comment }} + {{ history.details.commentDetails?.comment || history.details.taskDetails?.value }}

{ } const usernameRegex = /^[a-z]{3,10}\.[a-z]{1,5}$/ +const emailRegex = /^@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/ const handleSubmit = async () => { try { + if (!userRegistrationForm.value.name) { + isInvalidate.value = 'nameEmpty' + return + } if (!usernameRegex.test(userRegistrationForm.value.nickname)) { isInvalidate.value = 'wrongNickname' return } + if (!emailRegex.test(userRegistrationForm.value.email)) { + isInvalidate.value = 'wrongEmail' + return + } const formData = { ...userRegistrationForm.value, isReviewer: isManager.value ? userRegistrationForm.value.isReviewer : false, diff --git a/src/types/user.ts b/src/types/user.ts index 305ed3c..c68ad16 100644 --- a/src/types/user.ts +++ b/src/types/user.ts @@ -32,6 +32,7 @@ export interface RequestTaskInputProps { isEdit?: boolean isInvalidate?: string isDisbled?: boolean + limitLength?: number } export interface RequestTaskFileInputProps { @@ -43,6 +44,7 @@ export interface RequestTaskTextAreaProps { modelValue: string placeholderText: string isInvalidate?: string + limitLength?: number } export interface AttachmentResponse { diff --git a/src/utils/date.ts b/src/utils/date.ts index 2ecd860..c95be31 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -111,15 +111,6 @@ export const formatDateAndTime = (dateString: string) => { return `${year}.${month}.${day} ${period} ${hours}시 ${minutes}분` } -export const formatOnlyTime = (timeString: string) => { - const [hours, minutes] = timeString.split(':').map(Number) - - const period = hours < 12 ? '오전' : '오후' - const formattedHours = hours % 12 || 12 - - return `${period} ${formattedHours}시 ${String(minutes).padStart(2, '0')}분` -} - export const formatTimeAgo = (createdAt: string) => { const now = new Date() const createdDate = new Date(createdAt) diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 0288027..3bc9b53 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -107,7 +107,7 @@ const handleLogin = async () => { '로그인 시도 5회 초과로 계정이 정지되었습니다\n30분 후 다시 시도해주세요' } else { messageHeader.value = '일치하는 정보가 없습니다' - messageBody.value = '닉네임과 비밀번호를 다시 확인해주세요' + messageBody.value = '아이디와 비밀번호를 다시 확인해주세요' } isModalVisible.value = !isModalVisible.value break