Skip to content

Commit fd8f6e7

Browse files
authored
Merge pull request #118 from TaskFlow-CLAP/CLAP-311
CLAP-311 2차 카테고리 부가설명 템플릿 추가 기능 구현
2 parents 8f032bf + b9a7491 commit fd8f6e7

File tree

14 files changed

+70
-50
lines changed

14 files changed

+70
-50
lines changed

public/favicon.ico

-3.14 KB
Binary file not shown.

public/images/mockProfile.jpg

-24.7 KB
Binary file not shown.

src/assets/styles.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,29 @@ body {
3838
@apply flex w-full py-3 font-bold border rounded items-center justify-center min-w-[138px];
3939
}
4040
.button-large-default {
41-
@apply button-large bg-white text-zinc-400 border-zinc-400;
41+
@apply button-large bg-white text-disabled border-border-1 hover:bg-background-2;
4242
}
4343
.button-large-red {
44-
@apply button-large bg-red-1 text-white border-red-1;
44+
@apply button-large bg-red-1 text-white border-red-1 hover:bg-[#D61E1E];
4545
}
4646
.button-large-primary {
47-
@apply button-large bg-primary1 text-white border-primary1;
47+
@apply button-large bg-primary1 text-white border-primary1 hover:bg-[#6D6EF0];
4848
}
4949

5050
.button-medium {
5151
@apply flex items-center justify-center rounded px-4 py-2 font-bold gap-1 text-xs cursor-pointer shrink-0;
5252
}
5353
.button-medium-primary {
54-
@apply button-medium bg-primary1 text-white;
54+
@apply button-medium bg-primary1 text-white hover:bg-[#6869DE];
5555
}
5656
.button-medium-secondary {
57-
@apply button-medium bg-white border border-primary1 text-primary1;
57+
@apply button-medium bg-white border border-primary1 text-primary1 hover:bg-background-2;
5858
}
5959
.button-medium-default {
60-
@apply button-medium bg-white border border-border-1 text-disabled;
60+
@apply button-medium bg-white border border-border-1 text-disabled hover:bg-background-2;
6161
}
6262
.button-medium-red {
63-
@apply button-medium bg-white border border-red-1 text-red-1;
63+
@apply button-medium bg-white border border-red-1 text-red-1 hover:bg-background-2;
6464
}
6565

6666
.button-small {

src/components/request-task/RequestTaskTextArea.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<div>
2+
<div class="flex flex-col gap-2">
33
<p class="text-body text-xs font-bold">부가설명</p>
44
<textarea
5-
class="w-full h-24 mt-2 border border-border-1 px-4 py-2 resize-none focus:outline-none rounded"
5+
class="w-full h-32 border border-border-1 px-4 py-2 resize-none focus:outline-none rounded"
66
:value="modelValue"
77
:placeholder="placeholderText"
88
@input="updateValue(($event.target as HTMLInputElement).value)">

src/components/task-management/CategoryAdd.vue

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@
3838
label-name="고유코드 (대문자 영어 2글자까지)"
3939
:is-invalidate="isCodeInvalidate" />
4040

41+
<div
42+
v-if="categoryStep === '2'"
43+
class="flex flex-col gap-2">
44+
<p class="text-body text-xs font-bold">부가설명 템플릿</p>
45+
<textarea
46+
class="w-full h-32 border border-border-1 px-4 py-2 resize-none focus:outline-none rounded"
47+
:value="categoryForm.descriptionExample"
48+
:placeholder="'부가설명 템플릿을 작성해주세요'"
49+
@input="onValueChange">
50+
</textarea>
51+
</div>
52+
4153
<FormButtonContainer
4254
:handle-cancel="handleCancel"
4355
:handle-submit="handleSubmit"
@@ -55,8 +67,8 @@ import ModalView from '../ModalView.vue'
5567
import RequestTaskDropdown from '../request-task/RequestTaskDropdown.vue'
5668
import RequestTaskInput from '../request-task/RequestTaskInput.vue'
5769
import { axiosInstance } from '@/utils/axios'
58-
import { getMainCategory, getSubCategory } from '@/api/common'
59-
import type { Category, CategoryForm, SubCategory } from '@/types/common'
70+
import { getMainCategory } from '@/api/common'
71+
import type { Category, CategoryForm } from '@/types/common'
6072
6173
const router = useRouter()
6274
const route = useRoute()
@@ -134,24 +146,24 @@ onMounted(async () => {
134146
if (categoryStep === '1') {
135147
if (id) {
136148
const mainCategories: Category[] = await getMainCategory()
137-
const initailValue = mainCategories.find(el => el.id === id)
138-
if (initailValue) {
139-
categoryForm.value = { name: initailValue.name, code: initailValue.code }
149+
const initialValue = mainCategories.find(el => el.id === id)
150+
if (initialValue) {
151+
categoryForm.value = { name: initialValue.name, code: initialValue.code }
140152
}
141153
}
142154
} else if (categoryStep === '2') {
143155
categoryOptions.value = await getMainCategory()
144156
if (id) {
145-
const subCategory: SubCategory[] = await getSubCategory()
146-
const initailValue = subCategory.find(el => el.id === id)
147-
if (initailValue) {
157+
const { data: initialValue } = await axiosInstance.get(`/api/sub-categories/${id}`)
158+
if (initialValue) {
148159
categoryForm.value = {
149-
name: initailValue.name,
150-
code: initailValue.code,
151-
mainCategoryId: initailValue.mainCategoryId
160+
name: initialValue.name,
161+
code: initialValue.code,
162+
mainCategoryId: initialValue.mainCategoryId,
163+
descriptionExample: initialValue.descriptionExample
152164
}
153165
mainCategory.value =
154-
categoryOptions.value.find(el => el.id === initailValue.mainCategoryId)?.name || ''
166+
categoryOptions.value.find(el => el.id === initialValue.mainCategoryId)?.name || ''
155167
}
156168
}
157169
}
@@ -161,4 +173,9 @@ watch(mainCategory, () => {
161173
el => el.name === mainCategory.value
162174
)?.id
163175
})
176+
177+
const onValueChange = (event: Event) => {
178+
const target = event.target as HTMLInputElement
179+
categoryForm.value.descriptionExample = target.value
180+
}
164181
</script>

src/components/task-management/CategoryLine.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<div class="flex gap-2 text-xs font-bold">
1919
<button
2020
@click="router.push(`/category-first/${main.id}`)"
21-
class="text-primary1">
21+
class="text-primary1 hover:underline">
2222
수정
2323
</button>
2424
<button
2525
@click="openModal(main.id)"
26-
class="text-red-1">
26+
class="text-red-1 hover:underline">
2727
삭제
2828
</button>
2929
</div>

src/components/task-management/CategoryLineSub.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<div class="flex gap-2 text-xs font-bold">
1717
<button
1818
@click="router.push(`/category-second/${sub.id}`)"
19-
class="text-primary1">
19+
class="text-primary1 hover:underline">
2020
수정
2121
</button>
2222
<button
2323
@click="openModal(sub.id)"
24-
class="text-red-1">
24+
class="text-red-1 hover:underline">
2525
삭제
2626
</button>
2727
</div>
@@ -36,7 +36,7 @@
3636
</ModalView>
3737
</div>
3838
<div
39-
class="category-management-line gap-1 justify-center cursor-pointer bg-white"
39+
class="category-management-line gap-1 justify-center cursor-pointer bg-white hover:bg-background-2"
4040
@click="MovetoAddSubCategory">
4141
<CommonIcons :name="plusIcon" />
4242
<p class="text-xs text-disabled font-bold">새 2차 카테고리 추가</p>

src/components/task-management/CategoryManagement.vue

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="flex flex-col w-full min-h-[480px] max-h-[480px] border border-border-1 rounded-lg bg-background-1 overflow-y-auto scrollbar-hide">
3+
class="flex flex-col w-full h-[480px] border border-border-1 rounded-lg bg-background-1 overflow-hidden">
44
<div class="flex w-full">
55
<div class="task-management-title rounded-tl-lg">
66
<p>고유코드</p>
@@ -12,19 +12,18 @@
1212
<p>2차 카테고리</p>
1313
</div>
1414
</div>
15-
<div class="flex w-full">
16-
<CategoryLine :categories="data" />
17-
<div class="bg-border-1 w-0.5"></div>
18-
<CategoryLineSub :categories="data" />
19-
</div>
20-
<div
21-
class="text-xs text-disabled font-bold gap-1 shrink-0 category-management-line justify-center cursor-pointer bg-white"
22-
@click="MovetoAddCategory">
23-
<CommonIcons :name="plusIcon" />
24-
<p>새 1차 카테고리 추가</p>
25-
</div>
26-
<div class="mt-4">
27-
<CategoryList />
15+
<div class="flex flex-col w-full grow overflow-y-auto">
16+
<div class="flex">
17+
<CategoryLine :categories="data || []" />
18+
<div class="bg-border-1 w-0.5"></div>
19+
<CategoryLineSub :categories="data || []" />
20+
</div>
21+
<div
22+
class="text-xs text-disabled font-bold gap-1 shrink-0 category-management-line justify-center cursor-pointer bg-white !border-b-0 hover:bg-background-2"
23+
@click="MovetoAddCategory">
24+
<CommonIcons :name="plusIcon" />
25+
<p>새 1차 카테고리 추가</p>
26+
</div>
2827
</div>
2928
</div>
3029
</template>

src/components/task-management/ColorSelectModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
v-if="isOpen"
44
class="absolute top-7 left-3 w-[176px] h-[120px] p-4 flex flex-col !z-50 shadow-custom rounded-lg bg-white gap-4 import"
55
@click.self="closeModal">
6-
<div class="flex w-full justify-between">
6+
<div class="flex w-full justify-between items-center">
77
<p class="text-xs font-bold text-body">색상 선택</p>
88
<CommonIcons
9-
:class="'cursor-pointer'"
9+
:class="'cursor-pointer rounded hover:bg-background-2'"
1010
:name="closeIcon"
1111
@click="closeModal" />
1212
</div>

src/components/task-management/LabelManagement.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<template>
22
<div
3-
class="flex flex-col w-full min-h-[240px] overflow-y-auto border border-border-1 rounded-lg bg-background-1">
3+
class="flex flex-col w-full h-[240px] overflow-hidden border border-border-1 rounded-lg bg-background-1">
44
<div class="flex w-full">
55
<div class="task-management-title rounded-tl-lg">
66
<p>색상</p>
77
<p>구분명</p>
88
</div>
99
</div>
10-
<div class="flex flex-col w-full shrink-0 overflow-y-auto pb-8">
10+
<div class="flex flex-col w-full grow overflow-y-auto pb-32">
1111
<LabelManagementLine
1212
:label-data="labelData"
1313
@updateLabels="fetchLabels" />
1414
<div
1515
v-if="!isAdd"
16-
class="w-full h-11 text-xs shrink-0 text-disabled gap-1 category-management-line justify-center cursor-pointer bg-white"
16+
class="w-full h-11 text-xs shrink-0 text-disabled gap-1 category-management-line justify-center cursor-pointer bg-white !border-b-0 hover:bg-background-2"
1717
@click="isAdd = true">
1818
<CommonIcons :name="plusIcon" />
1919
새 구분 추가

0 commit comments

Comments
 (0)