Skip to content

Commit d0541d0

Browse files
committed
🔀 [fix] : conflict resolved
2 parents 73facf6 + e5c72c7 commit d0541d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+416
-369
lines changed

src/api/admin.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ import type { NewLabelTypes, UserRegistrationProps } from '@/types/admin'
22
import type { LabelDataTypes } from '@/types/common'
33
import { axiosInstance } from '@/utils/axios'
44

5-
export const getLabelsAdmin = async () => {
6-
const response = await axiosInstance.get('/api/managements/labels')
7-
return response.data
8-
}
9-
105
export const deleteLabelAdmin = async (id: number) => {
116
const response = await axiosInstance.delete(`/api/managements/labels/${id}`)
127
return response.data

src/api/common.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ export const getSubCategory = async () => {
1010
return response.data
1111
}
1212

13-
export const getAllCategory = async () => {
13+
export const getLabels = async () => {
14+
const response = await axiosInstance.get('/api/labels')
15+
return response.data
16+
}
17+
18+
export const getCategory = async () => {
1419
const response = await axiosInstance.get('/api/category')
1520
return response.data
1621
}

src/components/ModalView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ watch(textValue, newValue => {
9292
})
9393
9494
const closeModal = () => {
95+
textValue.value = ''
9596
emit('close')
9697
}
9798

src/components/TaskCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<span class="text-xs font-bold text-black">{{ data.taskCode }}</span>
1717
<div class="flex flex-col gap-1 items-end">
1818
<span class="text-xs font-bold text-body">{{ data.requesterDepartment }}</span>
19-
<div class="flex items-center gap-1">
19+
<div class="flex items-center gap-1.5">
2020
<div class="w-4 h-4 rounded-full bg-background-1 overflow-hidden">
2121
<img :src="data.requesterImageUrl" />
2222
</div>
23-
<span class="text-xs font-bold text-black">{{ data.requesterNickName }}</span>
23+
<span class="text-xs font-bold text-black">{{ data.requesterNickname }}</span>
2424
</div>
2525
</div>
2626
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div class="flex flex-col gap-2 items-center">
3+
<span class="text-4xl font-bold text-black whitespace-pre-wrap text-center leading-tight">{{
4+
title
5+
}}</span>
6+
<span class="font-bold whitespace-pre-wrap text-body text-center">{{ content }}</span>
7+
</div>
8+
</template>
9+
10+
<script setup lang="ts">
11+
defineProps<{ title: string; content?: string }>()
12+
</script>

src/components/filters/FilterCategory.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<div class="filter-container grow">
44
<span class="filter-title">1차 카테고리</span>
55
<div
6+
ref="mainRef"
67
class="filter-dropdown"
78
@click="toggleDropdown('main')">
89
<span class="grow text-center">선택</span>
@@ -31,6 +32,7 @@
3132
<div class="filter-container grow">
3233
<span class="filter-title">2차 카테고리</span>
3334
<div
35+
ref="subRef"
3436
class="filter-dropdown"
3537
:class="isDisabled ? 'bg-background-2 text-disabled' : 'text-black'"
3638
@click="!isDisabled && toggleDropdown('sub')">
@@ -77,6 +79,7 @@ import { dropdownIcon } from '@/constants/iconPath'
7779
import type { Category, FilterCategoryProps } from '@/types/common'
7880
import { computed, ref, watchEffect } from 'vue'
7981
import CommonIcons from '../common/CommonIcons.vue'
82+
import { useOutsideClick } from '../hooks/useOutsideClick'
8083
8184
const { categoryList = [], main, sub } = defineProps<FilterCategoryProps>()
8285
const emit = defineEmits(['update:main', 'update:sub'])
@@ -121,4 +124,7 @@ const onMainClick = (category: Category) => {
121124
const onSubClick = (value: number) => {
122125
emit('update:sub', value)
123126
}
127+
128+
const { htmlRef: mainRef } = useOutsideClick(() => isMainOpened.value && toggleDropdown('main'))
129+
const { htmlRef: subRef } = useOutsideClick(() => isSubOpened.value && toggleDropdown('sub'))
124130
</script>

src/components/filters/FilterDropdown.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:class="width === 'full' && 'grow'">
66
<span class="filter-title">{{ title }}</span>
77
<div
8+
ref="htmlRef"
89
class="filter-dropdown"
910
@click="toggleDropdown">
1011
<span class="grow text-center">{{
@@ -32,6 +33,7 @@ import type { Filter } from '@/types/common'
3233
import { ref } from 'vue'
3334
import { dropdownIcon } from '@/constants/iconPath'
3435
import CommonIcons from '../common/CommonIcons.vue'
36+
import { useOutsideClick } from '../hooks/useOutsideClick'
3537
3638
const { title, value, width = '120', optionList } = defineProps<Filter>()
3739
const emit = defineEmits(['update:value'])
@@ -43,4 +45,6 @@ const onOptionClick = (option: string) => {
4345
emit('update:value', option)
4446
toggleDropdown()
4547
}
48+
49+
const { htmlRef } = useOutsideClick(() => isDropdownOpened.value && toggleDropdown())
4650
</script>

src/components/filters/FilterDropdownMulti.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:class="width === 'full' && 'grow'">
66
<span class="filter-title">{{ title }}</span>
77
<div
8+
ref="htmlRef"
89
class="filter-dropdown"
910
@click="toggleDropdown">
1011
<span class="grow text-center">선택</span>
@@ -35,6 +36,7 @@ import type { Filter } from '@/types/common'
3536
import { ref } from 'vue'
3637
import { dropdownIcon } from '@/constants/iconPath'
3738
import CommonIcons from '../common/CommonIcons.vue'
39+
import { useOutsideClick } from '../hooks/useOutsideClick'
3840
3941
const { title, width = '120', optionList, value } = defineProps<Filter>()
4042
const emit = defineEmits(['update:value'])
@@ -45,4 +47,6 @@ const toggleDropdown = () => (isDropdownOpened.value = !isDropdownOpened.value)
4547
const onOptionClick = (option: string | number) => {
4648
emit('update:value', option)
4749
}
50+
51+
const { htmlRef } = useOutsideClick(() => isDropdownOpened.value && toggleDropdown())
4852
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { onMounted, onUnmounted, ref } from 'vue'
2+
3+
export const useOutsideClick = (onClick: () => void) => {
4+
const htmlRef = ref<HTMLElement | null>(null)
5+
6+
const onOutsideClick = (event: MouseEvent) => {
7+
if (htmlRef.value && !htmlRef.value.contains(event.target as Node)) {
8+
onClick()
9+
}
10+
}
11+
12+
onMounted(() => {
13+
window.addEventListener('click', onOutsideClick)
14+
})
15+
onUnmounted(() => {
16+
window.removeEventListener('click', onOutsideClick)
17+
})
18+
return { htmlRef }
19+
}

src/components/my-request/MyRequestFilterBar.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,21 @@
3535
<script setup lang="ts">
3636
import { PAGE_SIZE_LIST, TASK_STATUS_LIST, TERM_LIST } from '@/constants/common'
3737
import { useRequestParamsStore } from '@/stores/params'
38-
import { axiosInstance } from '@/utils/axios'
3938
import { useQuery } from '@tanstack/vue-query'
4039
import FilterCategory from '../filters/FilterCategory.vue'
4140
import FilterDropdown from '../filters/FilterDropdown.vue'
4241
import FilterDropdownMulti from '../filters/FilterDropdownMulti.vue'
4342
import FilterInput from '../filters/FilterInput.vue'
4443
import { useRequestParamsChange } from '../hooks/useRequestParamsChange'
44+
import { getCategory } from '@/api/common'
4545
4646
const store = useRequestParamsStore()
4747
store.$reset()
4848
4949
const onParamsChange = useRequestParamsChange()
5050
51-
const fetchCategory = async () => {
52-
const response = await axiosInstance.get('/api/category')
53-
return response.data
54-
}
55-
5651
const { data } = useQuery({
5752
queryKey: ['category'],
58-
queryFn: fetchCategory
53+
queryFn: getCategory
5954
})
6055
</script>

0 commit comments

Comments
 (0)