Skip to content

Commit 3cabbd8

Browse files
authored
Merge pull request #183 from TaskFlow-CLAP/CLAP-409
Clap-409 수정요구 Moya
2 parents 5d55ce4 + 2a68f1a commit 3cabbd8

File tree

14 files changed

+83
-17
lines changed

14 files changed

+83
-17
lines changed

src/api/admin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ export const getMemberDetailAdmin = async (id: string) => {
4646
}
4747

4848
export const updateMemberAdmin = async (id: string, data: UserUpdateValue) => {
49-
const response = await axiosInstance.post(`api/managements/members/${id}`, data)
49+
const response = await axiosInstance.patch(`api/managements/members/${id}`, data)
5050
return response.data
5151
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<svg
3+
class="animate-spin"
4+
xmlns="http://www.w3.org/2000/svg"
5+
width="64"
6+
height="64"
7+
viewBox="0 0 64 64"
8+
fill="none">
9+
<path
10+
opacity="0.2"
11+
fill-rule="evenodd"
12+
clip-rule="evenodd"
13+
d="M31.9999 50.6667C34.4513 50.6667 36.8786 50.1839 39.1433 49.2458C41.4081 48.3077 43.4659 46.9327 45.1992 45.1994C46.9326 43.466 48.3076 41.4082 49.2457 39.1435C50.1838 36.8787 50.6666 34.4514 50.6666 32C50.6666 29.5487 50.1838 27.1214 49.2457 24.8566C48.3076 22.5919 46.9326 20.5341 45.1992 18.8007C43.4659 17.0674 41.4081 15.6924 39.1433 14.7543C36.8786 13.8162 34.4513 13.3334 31.9999 13.3334C27.0492 13.3334 22.3013 15.3 18.8006 18.8007C15.2999 22.3014 13.3333 27.0493 13.3333 32C13.3333 36.9507 15.2999 41.6987 18.8006 45.1994C22.3013 48.7 27.0492 50.6667 31.9999 50.6667ZM31.9999 58.6667C46.7279 58.6667 58.6666 46.728 58.6666 32C58.6666 17.272 46.7279 5.33337 31.9999 5.33337C17.2719 5.33337 5.33325 17.272 5.33325 32C5.33325 46.728 17.2719 58.6667 31.9999 58.6667Z"
14+
fill="#18181B" />
15+
<path
16+
d="M5.33325 32C5.33325 17.272 17.2719 5.33337 31.9999 5.33337V13.3334C27.0492 13.3334 22.3013 15.3 18.8006 18.8007C15.2999 22.3014 13.3333 27.0493 13.3333 32H5.33325Z"
17+
fill="#71717A" />
18+
</svg>
19+
</template>

src/components/common/ModalView.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<CommonIcons
2020
v-if="type == 'warningType'"
2121
:name="warningIcon" />
22-
22+
<LoadingIcon v-if="type == 'loadingType'" />
2323
<div
2424
v-if="$slots.header"
2525
class="flex text-2xl font-semibold justify-center whitespace-pre-wrap text-center">
@@ -84,6 +84,7 @@ import { failIcon, successIcon, warningIcon } from '@/constants/iconPath'
8484
import { preventEnter } from '@/utils/preventEnter'
8585
import { onUnmounted, ref, watch } from 'vue'
8686
import CommonIcons from './CommonIcons.vue'
87+
import LoadingIcon from './LoadingIcon.vue'
8788
8889
const { isOpen, type, modelValue } = defineProps<{
8990
isOpen: boolean

src/components/request-approve/RequestApprove.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ const handleSubmit = async () => {
157157
isInvalidate.value = ''
158158
return
159159
}
160-
console.log(isTimeFilled.value, isTimeComplete.value, isDueDateValid.value)
161160
162161
const requestData = {
163162
categoryId: category2.value.subCategoryId,

src/components/request-task/ReRequestTask.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
:is-invalidate="isInvalidate"
2626
:placeholderText="'부가 정보를 입력해주세요'"
2727
:limit-length="200" />
28-
<RequestTaskFileInput v-model="file" />
28+
<RequestTaskFileInput
29+
v-model="file"
30+
:isEdit="true" />
2931
<FormButtonContainer
3032
:handleCancel="handleCancel"
3133
:handleSubmit="handleSubmit"

src/components/request-task/RequestTask.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
:is-invalidate="isInvalidate"
2626
:placeholderText="'부가 정보를 입력해주세요'"
2727
:limit-length="200" />
28-
<RequestTaskFileInput v-model="file" />
28+
<RequestTaskFileInput
29+
v-model="file"
30+
:isUploading="isUploading" />
2931
<FormButtonContainer
3032
:handleCancel="handleCancel"
3133
:handleSubmit="handleSubmit"
@@ -38,11 +40,10 @@
3840
<template #header>작업이 요청되었습니다</template>
3941
</ModalView>
4042
<ModalView
41-
:isOpen="isModalVisible === 'fail'"
42-
:type="'failType'"
43-
@close="handleCancel">
44-
<template #header>작업요청을 실패했습니다</template>
45-
<template #body>잠시후 시도해주세요</template>
43+
:isOpen="isModalVisible === 'loading'"
44+
type="loadingType">
45+
<template #header>작업을 요청 중입니다...</template>
46+
<template #body>잠시만 기다려주세요</template>
4647
</ModalView>
4748
</div>
4849
</template>
@@ -66,9 +67,11 @@ const category2 = ref<SubCategory | null>(null)
6667
const title = ref('')
6768
const description = ref('')
6869
const file = ref(null as File[] | null)
70+
6971
const isInvalidate = ref('')
7072
const isModalVisible = ref('')
7173
const isSubmitting = ref(false)
74+
const isUploading = ref(false)
7275
7376
const mainCategoryArr = ref<Category[]>([])
7477
const subCategoryArr = ref<SubCategory[]>([])
@@ -127,6 +130,8 @@ const handleSubmit = async () => {
127130
}
128131
129132
isSubmitting.value = true
133+
isUploading.value = true
134+
isModalVisible.value = 'loading'
130135
131136
const formData = new FormData()
132137
const taskInfo = {
@@ -144,5 +149,6 @@ const handleSubmit = async () => {
144149
await postTaskRequest(formData)
145150
isModalVisible.value = 'success'
146151
isSubmitting.value = false
152+
isUploading.value = false
147153
}
148154
</script>

src/components/request-task/RequestTaskFileInput.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<label v-if="hasFiles">
1111
<RequestTaskFileInputAfter
1212
:files="modelValue"
13+
:isEdit
1314
:removeFile="removeFile" />
1415
</label>
1516
<div
@@ -50,6 +51,7 @@ import RequestTaskFileInputAfter from './RequestTaskFileInputAfter.vue'
5051
5152
const { modelValue } = defineProps<{
5253
modelValue: File[] | null
54+
isEdit?: boolean
5355
}>()
5456
const emit = defineEmits(['update:modelValue'])
5557
@@ -61,10 +63,21 @@ const handleModal = () => {
6163
isModalVisible.value = !isModalVisible.value
6264
}
6365
66+
const truncateFilename = (name: string, maxLength: number) => {
67+
return [...name].slice(0, maxLength).join('')
68+
}
69+
6470
const handleFileUpload = (event: Event) => {
6571
const target = event.target as HTMLInputElement
6672
if (target.files && target.files.length > 0) {
67-
const newFiles = Array.from(target.files).filter(file => file.size <= 5 * 1024 * 1024)
73+
const newFiles = Array.from(target.files)
74+
.map(file => {
75+
const truncatedName = truncateFilename(file.name, 35)
76+
const newFile = new File([file], truncatedName, { type: file.type })
77+
return newFile.size <= 5 * 1024 * 1024 ? newFile : null
78+
})
79+
.filter(file => file !== null) as File[]
80+
6881
if (newFiles.length !== target.files.length) {
6982
handleModal()
7083
return
@@ -83,7 +96,13 @@ const handleDrop = (event: DragEvent) => {
8396
isDragging.value = false
8497
const files = event.dataTransfer?.files
8598
if (files && files.length > 0) {
86-
const newFiles = Array.from(files).filter(file => file.size <= 5 * 1024 * 1024)
99+
const newFiles = Array.from(files)
100+
.map(file => {
101+
const truncatedName = truncateFilename(file.name, 35)
102+
const newFile = new File([file], truncatedName, { type: file.type })
103+
return newFile.size <= 5 * 1024 * 1024 ? newFile : null
104+
})
105+
.filter(file => file !== null) as File[]
87106
if (newFiles.length !== files.length) {
88107
handleModal()
89108
return

src/components/request-task/RequestTaskFileInputAfter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class="flex w-full justify-between items-center h-8 text-xs border-b border-b-border-2 px-4 shrink-0">
2020
<p class="flex truncate mr-3">{{ file.name }}</p>
2121
<div class="flex gap-6">
22-
<p class="w-[60px]">{{ formatFileSize(file.size) }}</p>
22+
<p class="w-[60px]">{{ isEdit ? file.size : formatFileSize(file.size) }}</p>
2323
<p class="w-36">{{ new Date().toLocaleString() }}</p>
2424
<div class="w-10 flex items-center justify-center cursor-pointer">
2525
<CommonIcons
@@ -47,5 +47,5 @@ import type { RequestTaskFileInputProps } from '@/types/user'
4747
import { formatFileSize } from '@/utils/unit'
4848
import CommonIcons from '../common/CommonIcons.vue'
4949
50-
const { files, removeFile } = defineProps<RequestTaskFileInputProps>()
50+
const { files, removeFile, isEdit } = defineProps<RequestTaskFileInputProps>()
5151
</script>

src/components/task-detail/TaskDetailHistory.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:history="historyData"
66
:taskId="taskId"
77
:requestor-name="requestorName" />
8+
89
<div class="flex flex-col w-full items-center mt-8 gap-[22px]">
910
<div
1011
class="flex w-full flex-col items-center gap-[22px]"

src/components/task-detail/TaskDetailHistoryChat.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div :class="['flex gap-2', isRequestor ? 'flex-row' : 'flex-row-reverse']">
1919
<p
2020
:class="[
21-
'flex max-w-[400px] flex-wrap px-4 py-3 text-base rounded-lg font-normal',
21+
'flex max-w-[400px] flex-wrap break-all px-4 py-3 text-base rounded-lg font-normal',
2222
isRequestor ? 'bg-background-2' : 'bg-primary2'
2323
]">
2424
{{ history.details.commentDetails?.comment || history.details.taskDetails?.value }}

0 commit comments

Comments
 (0)