Skip to content

Commit d0aae75

Browse files
committed
Merge branch 'develop' of https://github.com/TaskFlow-CLAP/TaskFlow-FE into CLAP-298
2 parents 992f610 + 80380f6 commit d0aae75

File tree

18 files changed

+160
-134
lines changed

18 files changed

+160
-134
lines changed

src/api/common.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { axiosInstance } from '../utils/axios'
1+
import { axiosInstance, formDataAxiosInstance } from '../utils/axios'
2+
3+
export const patchEditInfo = async (formdata: FormData) => {
4+
const response = await formDataAxiosInstance.patch('/api/members/info', formdata)
5+
return response.data
6+
}
27

38
export const getNotification = async (pageNum: number, sizeNum: number) => {
49
const response = await axiosInstance.get(`/api/notifications?page=${pageNum}&size=${sizeNum}`)
@@ -8,13 +13,11 @@ export const getNotification = async (pageNum: number, sizeNum: number) => {
813

914
export const patchNotificationRead = async (notificationId: number) => {
1015
const response = await axiosInstance.patch(`/api/notification/${notificationId}`)
11-
console.log(notificationId)
1216
return response.data
1317
}
1418

1519
export const getNotifiCount = async () => {
1620
const response = await axiosInstance.get(`/api/notifications/count`)
17-
console.log(response.data)
1821
return response.data
1922
}
2023

src/api/user.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import type { RequestApprovePostTypes } from '@/types/manager'
33
import type { userInfo } from '@/types/user'
44
import { axiosInstance, formDataAxiosInstance } from '@/utils/axios'
55

6-
export const patchEditInfo = async (formdata: userInfo, image: File) => {
7-
const response = await formDataAxiosInstance.post('/api/tasks', formdata, image)
8-
return response.data
9-
}
10-
116
export const postTaskRequest = async (formdata: FormData) => {
127
const response = await formDataAxiosInstance.post('/api/tasks', formdata)
138
return response.data

src/components/EditInformation.vue

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<div class="profile">
1111
<p class="text-body text-xs font-bold">프로필 사진</p>
1212
<img
13-
v-if="previewUrl || info.imageUrl"
14-
:src="previewUrl || info.imageUrl"
13+
v-if="previewUrl || info.profileImageUrl"
14+
:src="previewUrl || info.profileImageUrl"
1515
alt="프로필 이미지"
1616
class="w-24 h-24 rounded-full object-cover border mt-3" />
1717

@@ -33,7 +33,7 @@
3333
<input
3434
class="input-box h-11 mt-2 text-black"
3535
placeholder="이름을 입력해주세요"
36-
v-model="info.memberName" />
36+
v-model="info.name" />
3737
</div>
3838
<div class="flex flex-col">
3939
<p class="text-body text-xs font-bold">아이디</p>
@@ -55,17 +55,17 @@
5555
<p class="text-body text-xs font-bold">알림 수신 여부</p>
5656
<div class="flex flex-col mt-2 gap-2">
5757
<FormCheckbox
58-
v-model="memberForm.isAgitChecked"
58+
v-model="info.notificationSettingInfo.agit"
5959
:checkButtonName="'아지트'"
60-
:isChecked="memberForm.isAgitChecked" />
60+
:isChecked="info.notificationSettingInfo.agit" />
6161
<FormCheckbox
62-
v-model="memberForm.isKakaoWorkChecked"
62+
v-model="info.notificationSettingInfo.kakaoWork"
6363
:checkButtonName="'카카오워크'"
64-
:isChecked="memberForm.isKakaoWorkChecked" />
64+
:isChecked="info.notificationSettingInfo.kakaoWork" />
6565
<FormCheckbox
66-
v-model="memberForm.isEmailChecked"
66+
v-model="info.notificationSettingInfo.email"
6767
:checkButtonName="'이메일'"
68-
:isChecked="memberForm.isEmailChecked" />
68+
:isChecked="info.notificationSettingInfo.email" />
6969
</div>
7070
</div>
7171
<div>
@@ -94,8 +94,7 @@ import FormCheckbox from './common/FormCheckbox.vue'
9494
const router = useRouter()
9595
import { useMemberStore } from '@/stores/member'
9696
import { storeToRefs } from 'pinia'
97-
import { patchEditInfo } from '@/api/user'
98-
import
97+
import { patchEditInfo } from '@/api/common'
9998
10099
const memberStore = useMemberStore()
101100
const { info } = storeToRefs(memberStore)
@@ -105,20 +104,6 @@ const previewUrl = ref<string | null>(null)
105104
106105
const isModalVisible = ref(false)
107106
108-
const memberForm = ref({
109-
isAgitChecked: false,
110-
isKakaoWorkChecked: false,
111-
isEmailChecked: false
112-
})
113-
114-
const formData = new FormData()
115-
116-
const requestData: any = {
117-
name: info.value.memberName,
118-
agitNotification: memberForm.value.isAgitChecked,
119-
emailNotification: memberForm.value.isEmailChecked,
120-
kakaoWorkNotification: memberForm.value.isKakaoWorkChecked
121-
}
122107
const handleCancel = () => {
123108
router.back()
124109
}
@@ -136,9 +121,30 @@ const handleFileUpload = (event: Event) => {
136121
}
137122
}
138123
139-
const handleSubmit = () => {
140-
isModalVisible.value = true
141-
console.log(requestData)
142-
patchEditInfo(requestData, selectedFile.value)
124+
const handleSubmit = async () => {
125+
const formData = new FormData()
126+
const memberInfo = {
127+
name: info.value.name,
128+
agitNotification: info.value.notificationSettingInfo.agit,
129+
emailNotification: info.value.notificationSettingInfo.email,
130+
kakaoWorkNotification: info.value.notificationSettingInfo.kakaoWork
131+
}
132+
133+
const jsonMemberInfo = JSON.stringify(memberInfo)
134+
const newBlob = new Blob([jsonMemberInfo], { type: 'application/json' })
135+
136+
formData.append('memberInfo', newBlob)
137+
138+
if (selectedFile.value) {
139+
formData.append('profileImage', selectedFile.value)
140+
}
141+
142+
try {
143+
await patchEditInfo(formData)
144+
isModalVisible.value = true
145+
await memberStore.updateMemberInfoWithToken()
146+
} catch (error) {
147+
console.error('요청 실패:', error)
148+
}
143149
}
144150
</script>

src/components/hooks/useTeamBoardParamsChange.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ export const useTeamBoardParamsChange = () => {
77
return array.includes(value) ? array.filter(el => el !== value) : [...array, value]
88
}
99

10-
const onOrderChange = (value: string) => {
11-
params.order = value
10+
const onSortByChange = (value: string) => {
11+
params.sortBy = value
1212
}
13-
const onTitleChange = (value: string) => {
14-
params.title = value
13+
const onTaskTitleChange = (value: string) => {
14+
params.taskTitle = value
1515
}
1616
const onMainChange = (value: number) => {
1717
params.mainCategoryIds = onArrayChange(params.mainCategoryIds, value)
@@ -21,8 +21,8 @@ export const useTeamBoardParamsChange = () => {
2121
}
2222

2323
return {
24-
onOrderChange,
25-
onTitleChange,
24+
onSortByChange,
25+
onTaskTitleChange,
2626
onMainChange,
2727
onSubChange
2828
}

src/components/team-board/CurrentTaskRatio.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
<div class="flex items-center gap-3">
77
<span class="text-xs font-bold text-body">진행 중 {{ teamSummary.inProgress }}건</span>
88
<div class="w-[1px] h-[10px] bg-body" />
9-
<span class="text-xs font-bold text-body"
10-
>완료 대기 {{ teamSummary.pendingCompletion }}건</span
11-
>
9+
<span class="text-xs font-bold text-body">완료 대기 {{ teamSummary.inReviewing }}건</span>
1210
</div>
1311
<span class="text-xs font-bold text-primary1">총 {{ teamSummary.totalTasks }}건</span>
1412
</div>
@@ -28,7 +26,7 @@ import PieChart from '../PieChart.vue'
2826
const { teamSummary, teamData } = defineProps<{
2927
teamSummary: {
3028
inProgress: number
31-
pendingCompletion: number
29+
inReviewing: number
3230
totalTasks: number
3331
}
3432
teamData: { name: string; tasks: number }[]

src/components/team-board/TeamBoard.vue

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,54 @@
55
:team-summary="teamSummary"
66
:team-data="teamData" />
77
<TeamBoardCard
8-
v-for="member in DUMMY_TEAM_MEMBERS_LIST"
9-
:key="member.name"
10-
:name="member.name"
11-
:department="member.department"
12-
:task-status-summary="member.taskStatusSummary"
13-
:tasks="member.tasks" />
8+
v-for="member in data?.members"
9+
:key="member.processorId"
10+
:info="member" />
11+
<NoContent
12+
v-if="data?.members.length === 0"
13+
content="검색된 담당자가 없습니다" />
1414
</div>
1515
</div>
1616
</template>
1717

1818
<script setup lang="ts">
19-
import { DUMMY_TEAM_MEMBERS_LIST } from '@/datas/dummy'
2019
import TeamBoardCard from './TeamBoardCard.vue'
2120
import CurrentTaskRatio from './CurrentTaskRatio.vue'
21+
import { axiosInstance } from '@/utils/axios'
22+
import { useTeamBoardParamsStore } from '@/stores/params'
23+
import { useQuery } from '@tanstack/vue-query'
24+
import { useParseParams } from '../hooks/useParseParams'
25+
import type { TeamBoardResponse } from '@/types/manager'
26+
import { computed } from 'vue'
27+
import NoContent from '../lists/NoContent.vue'
2228
23-
const getSummaryCount = (key: 'inProgress' | 'pendingCompletion' | 'totalTasks') => {
24-
let count = 0
25-
DUMMY_TEAM_MEMBERS_LIST.forEach(el => (count += el.taskStatusSummary[key]))
26-
return count
27-
}
28-
const teamSummary = {
29-
inProgress: getSummaryCount('inProgress'),
30-
pendingCompletion: getSummaryCount('pendingCompletion'),
31-
totalTasks: getSummaryCount('totalTasks')
29+
const { params } = useTeamBoardParamsStore()
30+
31+
const fetchTeamStatus = async () => {
32+
const { parseBoardParams } = useParseParams()
33+
const parsedParams = parseBoardParams(params)
34+
const response = await axiosInstance.get('/api/team-status/filter', { params: parsedParams })
35+
return response.data
3236
}
37+
const { data } = useQuery<TeamBoardResponse>({
38+
queryKey: ['teamStatus', params],
39+
queryFn: fetchTeamStatus
40+
})
41+
42+
const teamSummary = computed(() => {
43+
return {
44+
inProgress: data.value?.totalInProgressTaskCount || 0,
45+
inReviewing: data.value?.totalInReviewingTaskCount || 0,
46+
totalTasks: data.value?.totalTaskCount || 0
47+
}
48+
})
3349
34-
const teamData = DUMMY_TEAM_MEMBERS_LIST.map(el => ({
35-
name: el.name,
36-
tasks: el.taskStatusSummary.totalTasks
37-
}))
50+
const teamData = computed(() => {
51+
return (
52+
data.value?.members.map(el => ({
53+
name: el.nickname,
54+
tasks: el.totalTaskCount
55+
})) || []
56+
)
57+
})
3858
</script>

src/components/team-board/TeamBoardCard.vue

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,22 @@
55
<div class="w-6 h-6 rounded-full overflow-hidden">
66
<img src="https://picsum.photos/24" />
77
</div>
8-
<span class="text-black">{{ name }}</span>
8+
<span class="text-black">{{ info.nickname }}</span>
99
</div>
10-
<span class="text-xs font-bold text-body">{{ department }}</span>
10+
<span class="text-xs font-bold text-body">{{ info.department }}</span>
1111
</div>
1212
<div class="flex justify-between items-center">
1313
<div class="flex items-center gap-3">
14-
<span class="text-xs font-bold text-body"
15-
>진행 중 {{ taskStatusSummary.inProgress }}건</span
16-
>
14+
<span class="text-xs font-bold text-body">진행 중 {{ info.inProgressTaskCount }}건</span>
1715
<div class="w-[1px] h-[10px] bg-body" />
18-
<span class="text-xs font-bold text-body"
19-
>완료 대기 {{ taskStatusSummary.pendingCompletion }}건</span
20-
>
16+
<span class="text-xs font-bold text-body">검토 중 {{ info.inReviewingTaskCount }}건</span>
2117
</div>
22-
<span class="text-xs font-bold text-primary1">총 {{ taskStatusSummary.totalTasks }}건</span>
18+
<span class="text-xs font-bold text-primary1">총 {{ info.totalTaskCount }}건</span>
2319
</div>
2420
<div
2521
class="w-full h-[360px] rounded-lg bg-primary2 shadow-custom overflow-y-scroll flex flex-col items-center p-6 gap-4">
2622
<TaskCard
27-
v-for="task in tasks"
23+
v-for="task in info.tasks"
2824
:key="task.taskId"
2925
:data="task" />
3026
</div>
@@ -35,5 +31,5 @@
3531
import type { TeamBoardCardProps } from '@/types/manager'
3632
import TaskCard from '../TaskCard.vue'
3733
38-
const { name, department, taskStatusSummary, tasks } = defineProps<TeamBoardCardProps>()
34+
const { info } = defineProps<{ info: TeamBoardCardProps }>()
3935
</script>

src/components/team-board/TeamBoardFilterBar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<FilterDropdown
44
title="정렬"
55
:option-list="[
6-
{ value: 'CONTRIBUTION', content: '기여도순' },
7-
{ value: 'NAME', content: '이름순' }
6+
{ value: 'CONTRIBUTE', content: '기여도순' },
7+
{ value: 'DEFAULT', content: '이름순' }
88
]"
9-
:value="params.order"
10-
@update:value="onParamsChange.onOrderChange" />
9+
:value="params.sortBy"
10+
@update:value="onParamsChange.onSortByChange" />
1111
<FilterInput
1212
title="제목"
1313
:value="''"
14-
@update:value="onParamsChange.onTitleChange" />
14+
@update:value="onParamsChange.onTaskTitleChange" />
1515
<FilterCategory
1616
:category-list="data"
1717
:main="params.mainCategoryIds"

src/components/top-bar/NotificationModal.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ const hasNext = ref(true)
8585
const loadMoreNotifications = async ($state: any) => {
8686
try {
8787
const response = await getNotification(page.value, pageSize)
88-
console.log(response)
8988
9089
if (response.isFirst) {
9190
notifications.value = response.content

src/components/top-bar/SideBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
<div class="flex w-full justify-between px-6 py-4 bg-white">
4141
<div class="flex w-full items-center gap-3">
4242
<img
43-
v-if="info?.imageUrl"
43+
v-if="info?.profileImageUrl"
4444
class="rounded-[50%] w-10 h-10"
45-
:src="info.imageUrl"
45+
:src="info.profileImageUrl"
4646
alt="프로필 이미지" />
4747
<div
4848
v-else
@@ -79,8 +79,8 @@ const { info } = storeToRefs(memberStore)
7979
8080
const route = useRoute()
8181
82-
const role = computed(() => info.value.memberRole)
83-
const name = computed(() => info.value.memberName)
82+
const role = computed(() => info.value.role)
83+
const name = computed(() => info.value.name)
8484
const nickname = computed(() => info.value.nickname)
8585
8686
const filteredMenu = computed(() => {

0 commit comments

Comments
 (0)