Skip to content

Commit b4b0252

Browse files
authored
Merge pull request #29 from TaskFlow-CLAP/CLAP-127
CLAP-127 작업 보드 페이지 초기 UI 제작
2 parents 0427897 + ef5eff7 commit b4b0252

File tree

14 files changed

+291
-24
lines changed

14 files changed

+291
-24
lines changed

package-lock.json

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
"js-cookie": "^3.0.5",
1818
"pinia": "^2.3.0",
1919
"vue": "^3.5.13",
20-
"vue-router": "^4.5.0"
20+
"vue-router": "^4.5.0",
21+
"vuedraggable": "^4.1.0"
2122
},
2223
"devDependencies": {
2324
"@tsconfig/node22": "^22.0.0",
2425
"@types/js-cookie": "^3.0.6",
2526
"@types/node": "^22.10.2",
27+
"@types/sortablejs": "^1.15.8",
2628
"@typescript-eslint/eslint-plugin": "^8.20.0",
2729
"@typescript-eslint/parser": "^8.20.0",
2830
"@vitejs/plugin-vue": "^5.2.1",

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { RouterView } from 'vue-router'
32
import TopMenu from './components/TopMenu.vue'
43
import TheView from './layout/TheView.vue'
54
</script>

src/components/TaskCard.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div
3+
class="w-full max-w-80 border-l-8 bg-white py-4 pl-6 pr-4 flex flex-col gap-6 rounded-lg shadow-custom hover:bg-background-2"
4+
:class="borderLeft"
5+
@click="onTaskClick">
6+
<div class="flex flex-col gap-1">
7+
<div class="flex justify-between items-center gap-4">
8+
<span class="text-black">{{ data.title }}</span>
9+
<CommonIcons :name="bentoIcon" />
10+
</div>
11+
<span class="text-xs text-body">{{ data.mainCategoryName }} - {{ data.categoryName }}</span>
12+
</div>
13+
<div class="flex justify-between items-end">
14+
<span class="text-xs font-bold text-black">{{ data.taskCode }}</span>
15+
<div class="flex flex-col gap-1 items-end">
16+
<span class="text-xs font-bold text-body">{{ data.requesterDepartment }}</span>
17+
<div class="flex items-center gap-1">
18+
<div class="w-4 h-4 rounded-full bg-background-1 overflow-hidden">
19+
<img :src="data.requesterImageUrl" />
20+
</div>
21+
<span class="text-xs font-bold text-black">{{ data.requesterNickName }}</span>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
</template>
27+
28+
<script setup lang="ts">
29+
import { bentoIcon } from '@/constants/iconPath'
30+
import type { Status } from '@/types/common'
31+
import { computed } from 'vue'
32+
import type { TaskCardProps } from '@/types/manager'
33+
import CommonIcons from './common/CommonIcons.vue'
34+
import { statusAsColor } from '@/utils/statusAsColor'
35+
36+
const { data } = defineProps<{ data: TaskCardProps }>()
37+
38+
const borderLeft = computed(() => {
39+
return `border-${statusAsColor(data.taskStatus as Status)}-1`
40+
})
41+
42+
const onTaskClick = () => {
43+
console.log('clicked')
44+
}
45+
</script>

src/components/TaskStatus.vue

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,27 @@
44
:class="bgColor">
55
<span
66
class="text-xs font-bold"
7-
:class="textColor"
8-
>{{ status }}</span
9-
>
7+
:class="textColor">
8+
{{ status }}
9+
</span>
1010
</div>
1111
</template>
1212

1313
<script setup lang="ts">
14+
import type { Status } from '@/types/common'
15+
import { statusAsColor } from '@/utils/statusAsColor'
1416
import { computed } from 'vue'
1517
1618
const { status, isActive } = defineProps<{
17-
status?: string
19+
status: Status
1820
isActive?: boolean
1921
}>()
2022
21-
const defaultColor = {
22-
요청: 'gray',
23-
'진행 중': 'blue',
24-
'검토 중': 'orange',
25-
완료: 'green',
26-
종료: 'red'
27-
}
28-
29-
const key = status as keyof typeof defaultColor
30-
3123
const textColor = computed(() => {
32-
return isActive ? 'text-white' : `text-${defaultColor[key]}-1`
24+
return isActive ? 'text-white' : `text-${statusAsColor(status)}-1`
3325
})
3426
const bgColor = computed(() => {
35-
return isActive ? `bg-${defaultColor[key]}-1` : `bg-${defaultColor[key]}-2`
27+
return isActive ? `bg-${statusAsColor(status)}-1` : `bg-${statusAsColor(status)}-2`
3628
})
3729
</script>
3830

src/components/lists/ListCardTab.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111
<TaskStatus
1212
v-if="isStatus"
13-
:status="content" />
13+
:status="content as Status" />
1414
<span
1515
v-else
1616
class="text-black"
@@ -21,7 +21,7 @@
2121
</template>
2222

2323
<script setup lang="ts">
24-
import type { ListCardProps } from '@/types/common'
24+
import type { ListCardProps, Status } from '@/types/common'
2525
import TaskStatus from '../TaskStatus.vue'
2626
2727
const { content, width, isTextXs, profileImg, isStatus } = defineProps<ListCardProps>()

src/datas/dummy.ts

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Category } from '@/types/common'
2-
import type { RequestedListData, RequestHistoryListData } from '@/types/manager'
2+
import type { RequestedListData, RequestHistoryListData, TaskCardList } from '@/types/manager'
33
import type { MyRequestListData } from '@/types/user'
44

55
export const DUMMY_CATEGORY_LIST: Category[] = [
@@ -745,3 +745,54 @@ export const DUMMY_REQUEST_HISTORY_LIST_DATA: RequestHistoryListData[] = [
745745
finishedAt: '2025.01.11'
746746
}
747747
]
748+
749+
export const DUMMY_TASK_CARD_LIST: TaskCardList = {
750+
tasksInProgress: [
751+
{
752+
taskId: 0,
753+
taskCode: 'string',
754+
mainCategoryName: 'string',
755+
categoryName: 'string',
756+
title: 'string',
757+
requesterNickName: 'string',
758+
requesterImageUrl: 'string',
759+
requesterDepartment: 'string',
760+
processorOrder: 0,
761+
taskStatus: '진행 중',
762+
createdAt: '2025-01-28T09:34:00.128Z'
763+
}
764+
],
765+
tasksPendingComplete: [
766+
{
767+
taskId: 0,
768+
taskCode: 'string',
769+
mainCategoryName: 'string',
770+
categoryName: 'string',
771+
title: 'string',
772+
requesterNickName: 'string',
773+
requesterImageUrl: 'string',
774+
requesterDepartment: 'string',
775+
processorOrder: 0,
776+
taskStatus: '검토 중',
777+
createdAt: '2025-01-28T09:34:00.128Z'
778+
}
779+
],
780+
tasksCompleted: [
781+
{
782+
taskId: 0,
783+
taskCode: 'string',
784+
mainCategoryName: 'string',
785+
categoryName: 'string',
786+
title: 'string',
787+
requesterNickName: 'string',
788+
requesterImageUrl: 'string',
789+
requesterDepartment: 'string',
790+
processorOrder: 0,
791+
taskStatus: '완료',
792+
createdAt: '2025-01-28T09:34:00.128Z'
793+
}
794+
],
795+
hasNext: true,
796+
isFirst: true,
797+
isLast: true
798+
}

src/router/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ const router = createRouter({
4646
path: '/request-history',
4747
name: 'RequestHistory',
4848
component: () => import('../views/RequestHistory.vue')
49+
},
50+
{
51+
path: '/task-board',
52+
name: 'TaskBoard',
53+
component: () => import('../views/TaskBoardView.vue')
4954
}
5055
]
5156
})

src/types/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ export interface ListBarTabProps {
4444
currentOrderRequest?: { sortBy: string; sortDirection: 'DESC' | 'ASC' }
4545
justifyCenter?: boolean
4646
}
47+
48+
export type Status = '요청' | '진행 중' | '검토 중' | '완료' | '종료'

src/types/manager.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,26 @@ export interface RequestHistoryListData {
2222
taskStatus: string
2323
finishedAt?: string
2424
}
25+
26+
export interface TaskCardProps {
27+
taskId: number
28+
taskCode: string
29+
mainCategoryName: string
30+
categoryName: string
31+
title: string
32+
requesterNickName: string
33+
requesterImageUrl: string
34+
requesterDepartment: string
35+
processorOrder: number
36+
taskStatus: string
37+
createdAt: string
38+
}
39+
40+
export interface TaskCardList {
41+
tasksInProgress: TaskCardProps[]
42+
tasksPendingComplete: TaskCardProps[]
43+
tasksCompleted: TaskCardProps[]
44+
hasNext: boolean
45+
isFirst: boolean
46+
isLast: boolean
47+
}

0 commit comments

Comments
 (0)