Skip to content

Commit ae0f361

Browse files
committed
Merge branch 'develop' of https://github.com/TaskFlow-CLAP/TaskFlow-FE into CLAP-225
2 parents a3534fc + e5c72c7 commit ae0f361

24 files changed

+327
-189
lines changed

src/api/admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { LabelDataTypes, NewLabelTypes } from '@/types/admin'
1+
import type { NewLabelTypes } from '@/types/admin'
2+
import type { LabelDataTypes } from '@/types/common'
23
import { axiosInstance } from '@/utils/axios'
34

45
export const deleteLabelAdmin = async (id: number) => {

src/api/user.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1-
import { formDataAxiosInstance } from '@/utils/axios'
1+
import type { RequestApprovePostTypes } from '@/types/manager'
2+
import { axiosInstance, formDataAxiosInstance } from '@/utils/axios'
23

34
export const postTaskRequest = async (formdata: FormData) => {
45
const response = await formDataAxiosInstance.post('/api/tasks', formdata)
56
return response.data
67
}
78

89
export const getTaskDetailUser = async (id: number) => {
9-
const response = await formDataAxiosInstance.get(`/api/tasks/${id}/requests/details`)
10+
const response = await axiosInstance.get(`/api/tasks/${id}/requests/details`)
1011
return response.data
1112
}
1213

1314
export const getTaskDetailManager = async (id: number) => {
14-
const response = await formDataAxiosInstance.get(`/api/tasks/${id}/details`)
15+
const response = await axiosInstance.get(`/api/tasks/${id}/details`)
16+
return response.data
17+
}
18+
19+
export const getLabelsManager = async () => {
20+
const response = await axiosInstance.get('/api/labels?page=0&size=5')
21+
return response.data
22+
}
23+
24+
export const postTaskApprove = async (id: number, data: RequestApprovePostTypes) => {
25+
const response = await axiosInstance.post(`/api/tasks/${id}/approval`, data)
26+
return response.data
27+
}
28+
29+
export const getManager = async () => {
30+
const response = await axiosInstance.get('/api/managers')
1531
return response.data
1632
}
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
<template>
22
<input
33
:type="inputType"
4-
:v-model="modelValue"
4+
:value="modelValue"
55
class="w-full border border-gray-300 rounded px-3 py-2 cursor-pointer focus:outline-none text-center text-black"
6-
@focus="e => (e.target as HTMLInputElement).showPicker()" />
6+
@focus="e => (e.target as HTMLInputElement).showPicker()"
7+
@input="updateValue(($event.target as HTMLInputElement).value)" />
78
</template>
89

910
<script lang="ts" setup>
1011
import type { DueDateInputProps } from '@/types/common'
11-
import { defineProps } from 'vue'
12+
import { defineEmits, defineProps, onMounted } from 'vue'
1213
1314
const { modelValue, inputType } = defineProps<DueDateInputProps>()
15+
const emit = defineEmits(['update:modelValue'])
16+
const updateValue = (value: string) => {
17+
emit('update:modelValue', value)
18+
}
19+
20+
onMounted(() => {
21+
emit('update:modelValue', null)
22+
})
1423
</script>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<template>
2+
<div>
3+
<div class="text-xs mb-2 text-body font-bold">구분</div>
4+
<div class="relative flex">
5+
<div
6+
class="flex w-full h-11 items-center rounded p-4 bg-white border border-border-1 cursor-pointer text-black"
7+
@click="toggleDropdown">
8+
<p :class="{ 'text-disabled': !modelValue }">
9+
{{ modelValue?.labelName || placeholderText }}
10+
</p>
11+
<CommonIcons
12+
:name="dropdownIcon"
13+
:class="['ml-auto', { 'rotate-180': dropdownOpen }]" />
14+
</div>
15+
<div
16+
v-if="dropdownOpen"
17+
class="absolute w-full h-40 overflow-y-auto top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2 text-black">
18+
<div
19+
v-for="option in labelArr"
20+
:key="option.labelId"
21+
class="w-full flex items-center h-11 p-2 rounded hover:bg-background-2 cursor-pointer"
22+
@click="selectOption(option)">
23+
{{ option.labelName }}
24+
</div>
25+
</div>
26+
</div>
27+
</div>
28+
</template>
29+
30+
<script lang="ts" setup>
31+
import { getLabelsManager } from '@/api/user'
32+
import { dropdownIcon } from '@/constants/iconPath'
33+
import type { LabelDataTypes } from '@/types/common'
34+
import type { LabelDropdownProps } from '@/types/user'
35+
import { onMounted, ref } from 'vue'
36+
import CommonIcons from '../common/CommonIcons.vue'
37+
38+
const { modelValue, placeholderText } = defineProps<LabelDropdownProps>()
39+
const emit = defineEmits(['update:modelValue'])
40+
const dropdownOpen = ref(false)
41+
42+
const labelArr = ref<LabelDataTypes[]>([])
43+
44+
onMounted(async () => {
45+
emit('update:modelValue', null)
46+
labelArr.value = await getLabelsManager()
47+
})
48+
const toggleDropdown = () => {
49+
dropdownOpen.value = !dropdownOpen.value
50+
}
51+
52+
const selectOption = (option: LabelDataTypes) => {
53+
emit('update:modelValue', option)
54+
dropdownOpen.value = false
55+
}
56+
</script>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<template>
2+
<div>
3+
<div class="flex text-xs gap-x-1 mb-2">
4+
<p class="text-disabled font-bold">담당자 변경</p>
5+
<p class="text-red-1">*</p>
6+
<p
7+
v-if="isInvalidateState === 'manager'"
8+
class="text-red-1">
9+
담당자를 선택해주세요
10+
</p>
11+
</div>
12+
<div class="relative flex">
13+
<div
14+
class="request-task-dropdown"
15+
@click="toggleDropdown">
16+
<div class="flex gap-2 items-center">
17+
<div
18+
v-if="modelValue"
19+
class="w-6 h-6 rounded-full overflow-hidden">
20+
<img
21+
:src="modelValue?.imageUrl || '/images/mockProfile.jpg'"
22+
alt="userProfile" />
23+
</div>
24+
<p :class="{ 'text-disabled': !modelValue }">
25+
{{ modelValue?.nickname || placeholderText }}
26+
</p>
27+
</div>
28+
<CommonIcons
29+
:name="dropdownIcon"
30+
:class="['ml-auto', { 'rotate-180': dropdownOpen }]" />
31+
</div>
32+
<div
33+
v-if="dropdownOpen"
34+
class="request-task-dropdown-option-list">
35+
<div
36+
v-for="option in managerArr"
37+
:key="option.memberId"
38+
class="request-task-dropdown-option justify-between"
39+
@click="selectOption(option)">
40+
<div class="flex gap-2">
41+
<div class="w-6 h-6 rounded-full overflow-hidden">
42+
<img
43+
:src="option.imageUrl || '/images/mockProfile.jpg'"
44+
alt="userProfile" />
45+
</div>
46+
<p>
47+
{{ option.nickname }}
48+
</p>
49+
</div>
50+
<p class="text-primary1 text-xs">잔여 작업 : {{ option.remainingTasks }}</p>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
</template>
56+
57+
<script lang="ts" setup>
58+
import { getManager } from '@/api/user'
59+
import { dropdownIcon } from '@/constants/iconPath'
60+
import type { ManagerTypes } from '@/types/manager'
61+
import type { ManagerDropdownProps } from '@/types/user'
62+
import { computed, onMounted, ref } from 'vue'
63+
import CommonIcons from '../common/CommonIcons.vue'
64+
65+
const { placeholderText, modelValue, isInvalidate } = defineProps<ManagerDropdownProps>()
66+
const emit = defineEmits(['update:modelValue'])
67+
const dropdownOpen = ref(false)
68+
const managerArr = ref<ManagerTypes[]>([])
69+
const isInvalidateState = computed(() => isInvalidate)
70+
71+
onMounted(async () => {
72+
emit('update:modelValue', null)
73+
managerArr.value = await getManager()
74+
})
75+
76+
const toggleDropdown = () => {
77+
dropdownOpen.value = !dropdownOpen.value
78+
}
79+
80+
const selectOption = (option: ManagerTypes) => {
81+
emit('update:modelValue', option)
82+
dropdownOpen.value = false
83+
}
84+
</script>

src/components/request-approve/ProcessorDropdown.vue

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)