Skip to content

Commit 858bdd9

Browse files
authored
Merge pull request #21 from TaskFlow-CLAP/CLAP-124
CLAP-124 승인 대기 중인 요청 페이지 UI 제작
2 parents 71a40f0 + 7a192eb commit 858bdd9

26 files changed

+563
-103
lines changed

src/assets/styles.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,35 @@ body {
3030
@apply view-container w-full max-w-[400px] mx-auto;
3131
}
3232

33+
.button-medium {
34+
@apply flex items-center justify-center rounded px-4 py-2 font-bold gap-1 text-xs cursor-pointer shrink-0;
35+
}
36+
.button-medium-primary {
37+
@apply button-medium bg-primary1 text-white;
38+
}
39+
.button-medium-secondary {
40+
@apply button-medium bg-white border border-primary1 text-primary1;
41+
}
42+
.button-medium-default {
43+
@apply button-medium bg-white border border-border-1 text-disabled;
44+
}
45+
.button-medium-red {
46+
@apply button-medium bg-white border border-red-1 text-red-1;
47+
}
48+
49+
.button-small {
50+
@apply flex items-center gap-1 text-xs font-bold;
51+
}
52+
.button-small-primary {
53+
@apply text-primary1;
54+
}
55+
.button-small-default {
56+
@apply text-disabled;
57+
}
58+
.button-small-red {
59+
@apply text-red-1;
60+
}
61+
3362
.list-bar {
3463
@apply w-full h-8 px-4 bg-background-2 flex items-center gap-4 shrink-0;
3564
}

src/components/TitleBar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
<script setup lang="ts">
1717
import { plusIcon } from '@/constants/iconPath'
18-
import type { TitleBar } from '@/types/common'
18+
import type { TitleBarProps } from '@/types/common'
1919
import CommonIcons from './common/CommonIcons.vue'
2020
21-
const props = defineProps<TitleBar>()
21+
const props = defineProps<TitleBarProps>()
2222
defineEmits(['buttonClick'])
2323
</script>

src/components/filters/FilterCategory.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@
7474

7575
<script setup lang="ts">
7676
import { dropdownIcon } from '@/constants/iconPath'
77-
import type { Category, FilterCategory } from '@/types/common'
77+
import type { Category, FilterCategoryProps } from '@/types/common'
7878
import { computed, ref, watchEffect } from 'vue'
7979
import CommonIcons from '../common/CommonIcons.vue'
8080
81-
const { categoryList, main, sub } = defineProps<FilterCategory>()
81+
const { categoryList, main, sub } = defineProps<FilterCategoryProps>()
8282
const emit = defineEmits(['update:main', 'update:sub'])
8383
8484
const isMainOpened = ref(false)

src/components/lists/ListBarTab.vue

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@
22
<div
33
class="text-xs font-bold text-body gap-[2px] flex items-center"
44
:style="{ width: width ? `${width}px` : '' }"
5-
:class="!width && 'grow'">
5+
:class="`${!width && 'grow'} ${justifyCenter && 'justify-center'}`">
66
{{ content }}
77
<button
8-
v-if="orderTarget"
9-
@click="$emit('toggleOrder', orderTarget)">
8+
v-if="sortBy"
9+
@click="$emit('toggleSortBy', sortBy)">
1010
<OrderIcon
11-
:is-active="params.order.target === orderTarget"
12-
:class="params.order.type === 'ASC' && 'rotate-180'" />
11+
:is-active="isActive"
12+
:class="isASC && 'rotate-180'" />
1313
</button>
1414
</div>
1515
</template>
1616

1717
<script setup lang="ts">
18-
import { useMyRequestParamsStore } from '@/stores/params'
18+
import { computed } from 'vue'
1919
import OrderIcon from '../OrderIcon.vue'
20+
import type { ListBarTabProps } from '@/types/common'
2021
21-
const { content, width, orderTarget } = defineProps<{
22-
content: string
23-
width?: number
24-
orderTarget?: string
25-
}>()
26-
defineEmits(['toggleOrder'])
22+
const { content, width, sortBy, currentOrderRequest } = defineProps<ListBarTabProps>()
23+
defineEmits(['toggleSortBy'])
2724
28-
const { params } = useMyRequestParamsStore()
25+
const isActive = computed(() => {
26+
return sortBy === currentOrderRequest.sortBy
27+
})
28+
const isASC = computed(() => {
29+
return currentOrderRequest.sortDirection === 'ASC'
30+
})
2931
</script>

src/components/lists/ListCardTab.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
</template>
2222

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

3030
<style scoped></style>

src/components/my-request/MyRequestFilterBar.vue

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
:width="120"
66
:option-list="TERM_LIST"
77
:value="String(params.term)"
8-
@update:value="value => (params.term = Number(value))" />
8+
@update:value="onTermChange" />
99
<FilterCategory
1010
:category-list="DUMMY_CATEGORY_LIST"
11-
:main="params.mainCategory"
12-
:sub="params.category"
11+
:main="params.mainCategoryId"
12+
:sub="params.categoryId"
1313
@update:main="onMainChange"
1414
@update:sub="onSubChange" />
1515
<FilterInput
@@ -38,28 +38,34 @@
3838
</template>
3939

4040
<script setup lang="ts">
41-
import { PAGE_SIZE_LIST, TASK_STATUS_LIST, TERM_LIST } from '@/constants/user'
4241
import FilterDropdown from '../filters/FilterDropdown.vue'
4342
import FilterCategory from '../filters/FilterCategory.vue'
4443
import FilterInput from '../filters/FilterInput.vue'
4544
import FilterDropdownMulti from '../filters/FilterDropdownMulti.vue'
4645
import { useMyRequestParamsStore } from '@/stores/params'
4746
import { DUMMY_CATEGORY_LIST } from '@/datas/dummy'
47+
import { PAGE_SIZE_LIST, TASK_STATUS_LIST, TERM_LIST } from '@/constants/common'
4848
4949
const { params } = useMyRequestParamsStore()
5050
51+
const onTermChange = (value: string) => {
52+
if (value === '') {
53+
params.term = ''
54+
}
55+
params.term = Number(value)
56+
}
5157
const onMainChange = (value: number) => {
52-
if (params.mainCategory.includes(value)) {
53-
params.mainCategory = [...params.mainCategory].filter(el => el !== value)
58+
if (params.mainCategoryId.includes(value)) {
59+
params.mainCategoryId = [...params.mainCategoryId].filter(el => el !== value)
5460
} else {
55-
params.mainCategory.push(value)
61+
params.mainCategoryId.push(value)
5662
}
5763
}
5864
const onSubChange = (value: number) => {
59-
if (params.category.includes(value)) {
60-
params.category = [...params.category].filter(el => el !== value)
65+
if (params.categoryId.includes(value)) {
66+
params.categoryId = [...params.categoryId].filter(el => el !== value)
6167
} else {
62-
params.category.push(value)
68+
params.categoryId.push(value)
6369
}
6470
}
6571
const onTaskStatusClick = (value: string) => {

src/components/my-request/MyRequestList.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<template #listCards>
88
<MyRequestListCard
9-
v-for="info in DUMMY_MY_REQUEST_LIST_INFO"
9+
v-for="info in DUMMY_MY_REQUEST_LIST_DATA"
1010
:key="info.taskId"
1111
:info="info" />
1212
</template>
1313

1414
<template #pagination>
1515
<ListPagination
16-
:page-number="params.pageNumber"
16+
:page-number="params.page"
1717
:total-page="DUMMY_TOTAL_PAGE"
1818
@update:page-number="onPageChange" />
1919
</template>
@@ -26,12 +26,12 @@ import MyRequestListCard from './MyRequestListCard.vue'
2626
import { useMyRequestParamsStore } from '@/stores/params'
2727
import ListPagination from '../lists/ListPagination.vue'
2828
import ListContainer from '../lists/ListContainer.vue'
29-
import { DUMMY_MY_REQUEST_LIST_INFO } from '@/datas/dummy'
29+
import { DUMMY_MY_REQUEST_LIST_DATA } from '@/datas/dummy'
3030
3131
const { params } = useMyRequestParamsStore()
3232
const DUMMY_TOTAL_PAGE = 18
3333
const onPageChange = (value: number) => {
34-
params.pageNumber = value
34+
params.page = value
3535
}
3636
3737
// Data Handling

src/components/my-request/MyRequestListBar.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
:key="tab.content"
66
:content="tab.content"
77
:width="tab.width"
8-
:order-target="tab.target"
9-
@toggle-order="toggleOrder" />
8+
:sortBy="tab.sortBy"
9+
:current-order-request="params.orderRequest"
10+
@toggle-sort-by="toggleSortBy" />
1011
</div>
1112
</template>
1213

@@ -17,11 +18,12 @@ import ListBarTab from '../lists/ListBarTab.vue'
1718
1819
const { params } = useMyRequestParamsStore()
1920
20-
const toggleOrder = (orderTarget: string) => {
21-
if (orderTarget === params.order.target) {
22-
params.order.type = params.order.type === 'DESC' ? 'ASC' : 'DESC'
21+
const toggleSortBy = (sortBy: 'REQUESTED' | 'FINISHED') => {
22+
if (sortBy === params.orderRequest.sortBy) {
23+
params.orderRequest.sortDirection =
24+
params.orderRequest.sortDirection === 'DESC' ? 'ASC' : 'DESC'
2325
} else {
24-
params.order = { target: orderTarget, type: 'DESC' }
26+
params.orderRequest = { sortBy, sortDirection: 'DESC' }
2527
}
2628
}
2729
</script>

src/components/my-request/MyRequestListCard.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<template>
22
<div class="list-card">
33
<ListCardTab
4-
v-for="info in myRequestInfoList"
5-
:key="info.content"
6-
:content="info.content"
7-
:width="info.width"
8-
:is-text-xs="info.isTextXs"
9-
:profile-img="info.profileImg"
10-
:is-status="info.isStatus" />
4+
v-for="tab in myRequestTabList"
5+
:key="tab.content"
6+
:content="tab.content"
7+
:width="tab.width"
8+
:is-text-xs="tab.isTextXs"
9+
:profile-img="tab.profileImg"
10+
:is-status="tab.isStatus" />
1111
</div>
1212
</template>
1313

1414
<script setup lang="ts">
15-
import type { MyRequestListInfo } from '@/types/user'
16-
import type { ListCardInfo } from '@/types/common'
15+
import type { ListCardProps } from '@/types/common'
1716
import ListCardTab from '../lists/ListCardTab.vue'
17+
import type { MyRequestListData } from '@/types/user'
1818
19-
const { info } = defineProps<{ info: MyRequestListInfo }>()
20-
const myRequestInfoList: ListCardInfo[] = [
19+
const { info } = defineProps<{ info: MyRequestListData }>()
20+
const myRequestTabList: ListCardProps[] = [
2121
{ content: info.taskCode, width: 120, isTextXs: true },
2222
{ content: info.requestedAt, width: 80 },
2323
{ content: info.mainCategoryName, width: 80 },

src/components/request-task/RequestTaskFileInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<div class="text-sm text-disabled font-bold">첨부할 파일을 끌어 놓으세요</div>
1818
<label
1919
for="file"
20-
class="flex items-center justify-center h-8 rounded px-4 py-2 bg-primary1 text-white font-bold gap-1 text-xs cursor-pointer">
20+
class="button-medium-primary">
2121
<CommonIcons :name="uploadIcon" />
22-
<p>파일선택</p>
22+
<p>파일 선택</p>
2323
</label>
2424
</div>
2525
</div>

0 commit comments

Comments
 (0)