Skip to content

Commit b0dbac2

Browse files
authored
Merge pull request #52 from TaskFlow-CLAP/CLAP-186
CLAP-186 카테고리 생성 페이지 UI 제작
2 parents 63b9c32 + e75da12 commit b0dbac2

File tree

9 files changed

+144
-24
lines changed

9 files changed

+144
-24
lines changed

src/assets/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ body {
132132
.category-management-line {
133133
@apply flex items-center px-4 w-full h-11 border-b border-b-border-1;
134134
}
135-
136135
.task-detail-dropdown {
137136
@apply flex w-full h-10 items-center text-sm rounded pl-4 pr-3 bg-white border border-border-1 cursor-pointer;
138137
}
@@ -142,3 +141,4 @@ body {
142141
.task-detail-dropdown-option {
143142
@apply w-full flex items-center h-10 p-2 rounded hover:bg-background-2 cursor-pointer;
144143
}
144+
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<template>
2+
<div class="w-[552px] flex flex-col gap-y-6">
3+
<ModalView
4+
:isOpen="isAddModalVisible"
5+
:type="'successType'"
6+
@close="handleAddModal">
7+
<template #header>카테고리가 등록되었습니다</template>
8+
</ModalView>
9+
<ModalView
10+
:isOpen="isCancelModalVisible"
11+
:type="'warningType'"
12+
@close="handleCancelModal"
13+
@click="handleGoBack">
14+
<template #header>생성을 취소 하시겠습니까?</template>
15+
<template #body>작성하신 내용은 사라집니다</template>
16+
</ModalView>
17+
<!-- 카테고리 목록 API 필요, 임시로 역할로 설정 -->
18+
<RequestTaskDropdown
19+
v-model="categoryForm.firstCategory"
20+
:options="RoleKeys"
21+
:label-name="'1차 카테고리'"
22+
:placeholderText="'1차 카테고리를 선택해주세요'"
23+
v-if="props.categoryStep == '2'" />
24+
<RequestTaskInput
25+
v-model="categoryForm.name"
26+
:placeholderText="'카테고리명을 입력해주세요'"
27+
:labelName="'1차 카테고리명'" />
28+
<RequestTaskInput
29+
v-model="categoryForm.code"
30+
:placeholderText="'카테고리의 고유코드를 입력해주세요'"
31+
:labelName="'고유코드 (대문자 영어 2글자까지)'" />
32+
33+
<FormButtonContainer
34+
:handleCancel="handleCancel"
35+
:handleSubmit="handleSubmit"
36+
cancelText="취소"
37+
submitText="생성" />
38+
</div>
39+
</template>
40+
41+
<script lang="ts" setup>
42+
import { CATEGORY_FIRST_ADD, CATEGORY_SECOND_ADD, RoleKeys } from '@/constants/admin'
43+
import { ref } from 'vue'
44+
import { useRouter } from 'vue-router'
45+
import ModalView from '../ModalView.vue'
46+
import RequestTaskDropdown from '../request-task/RequestTaskDropdown.vue'
47+
import RequestTaskInput from '../request-task/RequestTaskInput.vue'
48+
import FormButtonContainer from '../common/FormButtonContainer.vue'
49+
50+
const router = useRouter()
51+
52+
const props = defineProps<{
53+
categoryStep: string
54+
}>()
55+
56+
const isAddModalVisible = ref(false)
57+
const isCancelModalVisible = ref(false)
58+
59+
const categoryForm = ref(props.categoryStep == '1' ? CATEGORY_FIRST_ADD : CATEGORY_SECOND_ADD)
60+
61+
const handleAddModal = () => {
62+
isAddModalVisible.value = false
63+
}
64+
const handleCancelModal = () => {
65+
isCancelModalVisible.value = !isCancelModalVisible.value
66+
}
67+
68+
const handleCancel = () => {
69+
handleCancelModal()
70+
}
71+
72+
const handleGoBack = () => {
73+
router.push('/task-management')
74+
}
75+
76+
const handleSubmit = () => {
77+
console.log(categoryForm.value)
78+
isAddModalVisible.value = true
79+
}
80+
</script>

src/constants/admin.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,26 @@ export const LOGS_LIST_BAR_TAB: ListBarTabProps[] = [
3434
{ content: '결과' }
3535
]
3636

37-
import type { RoleTypes, RoleTypesEnum, UserRegistrationProps } from '@/types/admin'
37+
import type {
38+
RoleTypes,
39+
RoleTypesEnum,
40+
UserRegistrationProps,
41+
mainCategoryTypes,
42+
subCategoryTypes
43+
} from '@/types/admin'
44+
45+
export const CATEGORY_FIRST_ADD: mainCategoryTypes = {
46+
name: '',
47+
code: '',
48+
id: 0
49+
}
50+
51+
export const CATEGORY_SECOND_ADD: subCategoryTypes = {
52+
name: '',
53+
mainCategoryId: 0,
54+
code: '',
55+
id: 0
56+
}
3857

3958
export const INITIAL_USER_REGISTRATION: UserRegistrationProps = {
4059
name: '',

src/router/index.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ const router = createRouter({
5757
name: 'MemberManagement',
5858
component: () => import('../views/MemberManagement.vue')
5959
},
60+
{
61+
path: '/category-first',
62+
name: 'CategoryFirst',
63+
component: () => import('../views/CategoryFirstAdd.vue')
64+
},
65+
{
66+
path: '/category-second',
67+
name: 'CategorySecond',
68+
component: () => import('../views/CategorySecondAdd.vue')
69+
},
6070
{
6171
path: '/login-logs',
6272
name: 'LoginLogs',
@@ -87,21 +97,6 @@ const router = createRouter({
8797
name: 'UserUpdate',
8898
component: () => import('../views/UserUpdateView.vue')
8999
},
90-
{
91-
path: '/edit-information',
92-
name: 'EditInformation',
93-
component: () => import('../views/EditInformationView.vue')
94-
},
95-
{
96-
path: '/statistics',
97-
name: 'Statistics',
98-
component: () => import('../views/StatisticsView.vue')
99-
},
100-
{
101-
path: '/edit-information',
102-
name: 'EditInformation',
103-
component: () => import('../views/EditInformationView.vue')
104-
},
105100
{
106101
path: '/task-management',
107102
name: 'TaskManagement',

src/types/admin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface LogsListData {
2121
status: number
2222
result?: string
2323
}
24+
2425
export interface UserRegistrationProps {
2526
name: string
2627
email: string

src/types/common.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,4 @@ export interface ColorSelectProps {
7070
devisionId: number
7171
selectedDivisionId: number | null
7272
isOpen: boolean
73-
}
74-
75-
export interface LabelDataTypes {
76-
labelId: number
77-
labelName: string
78-
labelColor: string
79-
}
73+
}

src/types/manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,4 @@ export interface TaskDetailTopBarProps {
104104
isApproved: boolean
105105
closeTaskDetail: () => void
106106
}
107+

src/views/CategoryFirstAdd.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div class="form-view-container">
3+
<div class="form-view-title">
4+
<h1 class="text-2xl font-bold">1차 카테고리 생성</h1>
5+
</div>
6+
<CategoryAdd categoryStep="1" />
7+
</div>
8+
<div class="w-full bg-body"></div>
9+
</template>
10+
11+
<script setup lang="ts">
12+
import CategoryAdd from '../components/task-management/CategoryAdd.vue'
13+
</script>
14+
15+
<style scoped></style>

src/views/CategorySecondAdd.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div class="form-view-container">
3+
<div class="form-view-title">
4+
<h1 class="text-2xl font-bold">2차 카테고리 생성</h1>
5+
</div>
6+
<CategoryAdd categoryStep="2" />
7+
</div>
8+
<div class="w-full bg-body"></div>
9+
</template>
10+
11+
<script setup lang="ts">
12+
import CategoryAdd from '../components/task-management/CategoryAdd.vue'
13+
</script>
14+
15+
<style scoped></style>

0 commit comments

Comments
 (0)