1818 v-model =" title"
1919 :placeholderText =" '제목을 입력해주세요'"
2020 :label-name =" '제목'"
21- :is-invalidate =" isInvalidate === 'input' ? 'input' : ''" />
21+ :is-invalidate =" isInvalidate === 'input' ? 'input' : ''"
22+ :limit-length =" 30" />
2223 <RequestTaskTextArea
2324 v-model =" description"
2425 :is-invalidate =" isInvalidate"
25- :placeholderText =" '부가 정보를 입력해주세요'" />
26- <RequestTaskFileInput v-model =" file" />
26+ :placeholderText =" '부가 정보를 입력해주세요'"
27+ :limit-length =" 200" />
28+ <RequestTaskFileInput
29+ v-model =" file"
30+ :isUploading =" isUploading" />
2731 <FormButtonContainer
2832 :handleCancel =" handleCancel"
2933 :handleSubmit =" handleSubmit"
3640 <template #header >작업이 요청되었습니다</template >
3741 </ModalView >
3842 <ModalView
39- :isOpen =" isModalVisible === 'fail'"
40- :type =" 'failType'"
41- @close =" handleCancel" >
42- <template #header >작업요청을 실패했습니다</template >
43- <template #body >잠시후 시도해주세요</template >
43+ :isOpen =" isModalVisible === 'loading'"
44+ type =" loadingType" >
45+ <template #header >작업을 요청 중입니다...</template >
46+ <template #body >잠시만 기다려주세요</template >
4447 </ModalView >
4548 </div >
4649</template >
@@ -64,9 +67,11 @@ const category2 = ref<SubCategory | null>(null)
6467const title = ref (' ' )
6568const description = ref (' ' )
6669const file = ref (null as File [] | null )
70+
6771const isInvalidate = ref (' ' )
6872const isModalVisible = ref (' ' )
6973const isSubmitting = ref (false )
74+ const isUploading = ref (false )
7075
7176const mainCategoryArr = ref <Category []>([])
7277const subCategoryArr = ref <SubCategory []>([])
@@ -125,6 +130,8 @@ const handleSubmit = async () => {
125130 }
126131
127132 isSubmitting .value = true
133+ isUploading .value = true
134+ isModalVisible .value = ' loading'
128135
129136 const formData = new FormData ()
130137 const taskInfo = {
@@ -139,11 +146,9 @@ const handleSubmit = async () => {
139146 if (file .value && file .value .length > 0 ) {
140147 file .value .forEach (f => formData .append (' attachment' , f ))
141148 }
142- try {
143- await postTaskRequest (formData )
144- isModalVisible .value = ' success'
145- } finally {
146- isSubmitting .value = false
147- }
149+ await postTaskRequest (formData )
150+ isModalVisible .value = ' success'
151+ isSubmitting .value = false
152+ isUploading .value = false
148153}
149154 </script >
0 commit comments