Skip to content

Commit 8e42e0b

Browse files
committed
✨ [feat] : 2차 카테고리 부가설명 템플릿 추가 API 연결
1 parent 8f032bf commit 8e42e0b

File tree

11 files changed

+50
-31
lines changed

11 files changed

+50
-31
lines changed

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: 17 additions & 0 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"
@@ -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
새 구분 추가

src/components/task-management/LabelManagementLine.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
borderColor: getColor(label.labelColor)?.borderColor,
1212
backgroundColor: getColor(label.labelColor)?.fillColor
1313
}"
14-
class="w-4 h-4 rounded-full border-2 cursor-pointer pr-3"
14+
class="w-4 h-4 rounded-full border-2 cursor-pointer pr-3 relative"
1515
@click="isEdit && clickColor(label.labelId)"></div>
1616
<ColorSelectModal
1717
v-if="isColorModalVisible && editValue.labelId === label.labelId"
@@ -33,7 +33,7 @@
3333
<div class="flex gap-2 text-xs font-bold">
3434
<button
3535
@click="isEdit && editValue.labelId === label.labelId ? finishEdit() : startEdit(label)"
36-
class="text-primary1 w-[21px]">
36+
class="text-primary1 w-[21px] hover:underline">
3737
{{ isEdit && editValue.labelId === label.labelId ? '확인' : '수정' }}
3838
</button>
3939
<button
@@ -44,8 +44,8 @@
4444
"
4545
:class="
4646
isEdit && editValue.labelId === label.labelId
47-
? 'text-disabled w-[21px]'
48-
: 'text-red-1 w-[21px]'
47+
? 'text-disabled w-[21px] hover:underline'
48+
: 'text-red-1 w-[21px] hover:underline'
4949
">
5050
{{ isEdit && editValue.labelId === label.labelId ? '취소' : '삭제' }}
5151
</button>

src/constants/admin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ import type { RoleTypes, RoleTypesEnum, UserRegistrationProps } from '@/types/ad
4242

4343
export const CATEGORY_FORM: CategoryForm = {
4444
name: '',
45-
code: ''
45+
code: '',
46+
descriptionExample: ''
4647
}
4748

4849
export const INITIAL_USER_REGISTRATION: UserRegistrationProps = {

src/types/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export interface CategoryForm {
8484
name: string
8585
code: string
8686
mainCategoryId?: number
87+
descriptionExample?: string
8788
}
8889

8990
export interface CategoryDropdownProps {

0 commit comments

Comments
 (0)