Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
File renamed without changes.
File renamed without changes.
10 changes: 1 addition & 9 deletions src/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,7 @@ body {
.category-management-line {
@apply flex items-center px-4 w-full h-11 border-b border-b-border-1;
}
.task-detail-dropdown {
@apply flex w-full h-10 items-center text-sm rounded pl-4 pr-3 bg-white border border-border-1 cursor-pointer;
}
.task-detail-dropdown-option-list {
@apply absolute w-full h-40 overflow-y-auto scrollbar-hide top-11 flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2;
}
.task-detail-dropdown-option {
@apply w-full flex items-center h-10 p-2 rounded hover:bg-background-2 cursor-pointer;
}

.task-detail-manager-dropdown {
@apply flex w-full h-10 items-center rounded p-4 bg-white border border-border-1 cursor-pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ImageContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import defaultProfile from '@/assets/deafultProfile.png'
import defaultProfile from '/deafultProfile.png'

const { url, size } = defineProps<{ url?: string; size: number }>()
</script>
2 changes: 1 addition & 1 deletion src/components/common/ModalView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import { failIcon, successIcon, warningIcon } from '@/constants/iconPath'
import { useIsOverlayOpenStore } from '@/stores/isOverlayOpen'
import { onUnmounted, ref, watch } from 'vue'
import CommonIcons from './CommonIcons.vue'
import LoadingIcon from './LoadingIcon.vue'
import LoadingIcon from '@/assets/icons/LoadingIcon.vue'

const { isOpen, type, modelValue, isEmpty } = defineProps<{
isOpen: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/components/lists/ListBarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
</template>

<script setup lang="ts">
import OrderIcon from '@/assets/icons/OrderIcon.vue'
import type { ListBarTabProps } from '@/types/common'
import { computed } from 'vue'
import OrderIcon from '../common/OrderIcon.vue'

const { content, width, sortBy, currentOrderRequest } = defineProps<ListBarTabProps>()
defineEmits(['toggleSortBy'])
Expand Down
2 changes: 1 addition & 1 deletion src/components/request-approve/LabelDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<div
v-if="dropdownOpen"
class="absolute w-full h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2">
class="absolute w-full h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow-custom">
<div
v-for="option in labelArr"
:key="option.labelId || option.labelName"
Expand Down
2 changes: 1 addition & 1 deletion src/components/request-task/CategoryDropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
<div
v-if="dropdownOpen"
class="absolute w-full max-h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2">
class="absolute w-full max-h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow-custom">
<div
v-for="option in options"
:key="'subCategoryId' in option ? option.subCategoryId : option.mainCategoryId"
Expand Down
19 changes: 13 additions & 6 deletions src/components/request-task/ReRequestTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
v-model="description"
:is-invalidate="isInvalidate === 'description' ? isInvalidate : ''"
:placeholderText="'부가 설명을 입력해주세요'"
:limit-length="200" />
:limit-length="1000" />
<RequestTaskFileInput
v-model="file"
:initFileArr="initFileArr"
Expand All @@ -37,7 +37,7 @@
<ModalView
:isOpen="isModalVisible === 'success'"
:type="'successType'"
@close="handleCancel">
@close="finishEdit">
<template #header>작업이 {{ statusText }}되었습니다</template>
</ModalView>
<ModalView
Expand Down Expand Up @@ -67,6 +67,7 @@ import {
import type { Category, SubCategory } from '@/types/common'
import type { AttachmentResponse } from '@/types/user'
import getPossibleCategory from '@/utils/possibleCategory'
import DOMPurify from 'dompurify'
import { computed, onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import FormButtonContainer from '../common/FormButtonContainer.vue'
Expand All @@ -75,7 +76,6 @@ import CategoryDropDown from './CategoryDropDown.vue'
import RequestTaskFileInput from './RequestTaskFileInput.vue'
import RequestTaskInput from './RequestTaskInput.vue'
import RequestTaskTextArea from './RequestTaskTextArea.vue'
import DOMPurify from 'dompurify'

const category1 = ref<Category | null>(null)
const category2 = ref<SubCategory | null>(null)
Expand All @@ -95,6 +95,7 @@ const subCategoryArr = ref<SubCategory[]>([])
const afterSubCategoryArr = ref<SubCategory[]>([])
const initFileArr = ref<AttachmentResponse[]>([])
const isFirst = ref(true)
const isdescriptionFirst = ref(true)

const { id, reqType } = defineProps<{ id: string; reqType: string }>()
const router = useRouter()
Expand All @@ -103,6 +104,11 @@ const handleCancel = () => {
router.back()
}

const finishEdit = () => {
isModalVisible.value = ''
router.push('my-request')
}

onMounted(async () => {
const mainCategory = await getMainCategory()
const mainIds = await getPossibleCategory()
Expand Down Expand Up @@ -140,15 +146,16 @@ watch(category1, async newValue => {
})

watch(category2, async newVal => {
if (newVal) {
if (newVal && !isdescriptionFirst.value) {
const res = await getSubCategoryDetail(newVal.subCategoryId)
description.value = res.descriptionExample
} else if (newVal) {
isdescriptionFirst.value = false
}
})

const handleSubmit = async () => {
if (isSubmitting.value || isModalVisible.value) return

if (!category1.value) {
isInvalidate.value = 'category1'
return
Expand All @@ -161,7 +168,7 @@ const handleSubmit = async () => {
} else if (title.value.length > 30) {
isInvalidate.value = 'title'
return
} else if (description.value.length > 200) {
} else if (description.value.length > 1000) {
isInvalidate.value = 'description'
return
}
Expand Down
25 changes: 17 additions & 8 deletions src/components/request-task/RequestTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
v-model="description"
:is-invalidate="isInvalidate === 'description' ? isInvalidate : ''"
:placeholderText="'부가 설명을 입력해주세요'"
:limit-length="200" />
:limit-length="1000" />
<RequestTaskFileInput
v-model="file"
:isUploading="isUploading" />
<FormButtonContainer
:handleCancel="handleCancel"
:handleSubmit="handleSubmit"
:handleCancel
:handleSubmit
cancelText="취소"
submitText="요청" />
<ModalView
:isOpen="isModalVisible === 'success'"
:type="'successType'"
@close="handleCancel">
@close="finishRequest">
<template #header>작업이 요청되었습니다</template>
</ModalView>
<ModalView
Expand All @@ -53,6 +53,7 @@ import { getMainCategory, getSubCategory } from '@/api/common'
import { getSubCategoryDetail, postTaskRequest } from '@/api/user'
import type { Category, SubCategory } from '@/types/common'
import getPossibleCategory from '@/utils/possibleCategory'
import DOMPurify from 'dompurify'
import { onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import FormButtonContainer from '../common/FormButtonContainer.vue'
Expand All @@ -61,7 +62,6 @@ import CategoryDropDown from './CategoryDropDown.vue'
import RequestTaskFileInput from './RequestTaskFileInput.vue'
import RequestTaskInput from './RequestTaskInput.vue'
import RequestTaskTextArea from './RequestTaskTextArea.vue'
import DOMPurify from 'dompurify'

const category1 = ref<Category | null>(null)
const category2 = ref<SubCategory | null>(null)
Expand Down Expand Up @@ -106,16 +106,25 @@ watch(category2, async newVal => {

const router = useRouter()

const handleCancel = () => {
const resetForm = () => {
category1.value = null
category2.value = null
title.value = ''
description.value = ''
file.value = []
isModalVisible.value = ''
}

const handleCancel = () => {
resetForm()
router.back()
}

const finishRequest = () => {
resetForm()
isModalVisible.value = ''
router.push('my-request')
}

const handleSubmit = async () => {
if (isSubmitting.value || isModalVisible.value) return

Expand All @@ -131,7 +140,7 @@ const handleSubmit = async () => {
} else if (title.value.length > 30) {
isInvalidate.value = 'title'
return
} else if (description.value.length > 200) {
} else if (description.value.length > 1000) {
isInvalidate.value = 'description'
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/request-task/RequestTaskDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<div
v-if="dropdownOpen"
class="absolute w-full max-h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2">
class="absolute w-full max-h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow-custom">
<div
v-for="option in options"
:key="option"
Expand Down
4 changes: 2 additions & 2 deletions src/components/request-task/RequestTaskTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div class="flex flex-col gap-1.5 relative">
<div class="text-xs flex gap-x-1 text-red-1">
<p class="text-body text-xs font-semibold">부가설명</p>
<p v-if="isInvalidateState === 'description'">부가설명은 200자 이내로 적어주세요</p>
<p v-if="isInvalidateState === 'description'">부가설명은 1000자 이내로 적어주세요</p>
</div>
<textarea
class="w-full h-32 border border-border-1 px-4 py-2 resize-none focus:outline-none rounded"
:value="modelValue"
:placeholder="placeholderText"
:maxlength="200"
:maxlength="1000"
@input="updateValue(($event.target as HTMLInputElement).value)">
</textarea>
<p
Expand Down
6 changes: 3 additions & 3 deletions src/components/task-detail/TaskDetailHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"
class="flex w-full gap-1 justify-center text-body text-sm">
<p>
{{ HistoryMessageBefore[item.taskHistoryType] }}
{{ HISTORY_MSG_BEFORE[item.taskHistoryType] }}
</p>
<p
v-if="item.taskHistoryType !== 'TASK_TERMINATED'"
class="text-primary1">
{{ item.details.taskDetails?.value }}
</p>
<p>{{ HistoryMessageAfter[item.taskHistoryType] }}</p>
<p>{{ HISTORY_MSG_AFTER[item.taskHistoryType] }}</p>
</div>
<span
class="text-xs text-disabled text-center"
Expand All @@ -63,7 +63,7 @@
</template>

<script setup lang="ts">
import { HistoryMessageAfter, HistoryMessageBefore } from '@/constants/user'
import { HISTORY_MSG_AFTER, HISTORY_MSG_BEFORE } from '@/constants/user'
import type { TaskDetailHistoryProps } from '@/types/common'
import { formatDateWithDay, formatTimeShort } from '@/utils/date'
import { watch } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion src/components/task-detail/TaskDetailLeft.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div v-if="data.description">
<p class="task-detail">부가 설명</p>
<p
class="px-6 py-4 bg-primary2 rounded-lg font-normal min-h-[120px] whitespace-pre-wrap break-all">
class="px-6 py-4 bg-primary2 rounded-lg font-normal min-h-[120px] max-h-[360px] whitespace-pre-wrap break-all">
{{ data.description }}
</p>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/task-management/CategoryAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
<p
class="text-red-1"
v-if="errorMessage.description === 'tooLong'">
템플릿은 100자 이내로 적어주세요
템플릿은 500자 이내로 적어주세요
</p>
</div>
<textarea
class="w-full h-32 border border-border-1 px-4 py-2 resize-none focus:outline-none rounded"
:value="categoryForm.descriptionExample"
:maxlength="100"
:maxlength="500"
:placeholder="'부가설명 템플릿을 작성해주세요'"
@input="onValueChange">
</textarea>
<p class="absolute text-xs top-[calc(100%+4px)] w-full flex justify-end text-body">
{{ categoryForm.descriptionExample?.length || 0 }}/{{ 100 }}
{{ categoryForm.descriptionExample?.length || 0 }}/{{ 500 }}
</p>
</div>

Expand Down Expand Up @@ -120,7 +120,7 @@ const handleSubmit = async () => {
} else if (categoryForm.value.code.length === 0) {
errorMessage.value.categoryCode = 'noCode'
return
} else if ((categoryForm.value.descriptionExample ?? '').length > 100) {
} else if ((categoryForm.value.descriptionExample ?? '').length > 500) {
errorMessage.value.description = 'tooLong'
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/top-bar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ import { hamburgerIcon } from '../../constants/iconPath'
import CommonIcons from '../common/CommonIcons.vue'
import ImageContainer from '../common/ImageContainer.vue'
import MainLogo from '../common/MainLogo.vue'
import NotificationIcon from '../icons/NotificationIcon.vue'
import NotificationModal from './NotificationModal.vue'
import ProfileModal from './ProfileModal.vue'
import SideBar from './SideBar.vue'
import NotificationIcon from '@/assets/icons/NotificationIcon.vue'

const memberStore = useMemberStore()
const { isLogined, info } = storeToRefs(memberStore)
Expand Down
2 changes: 1 addition & 1 deletion src/components/user-manage/DepartmentDropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<div
v-if="dropdownOpen"
class="absolute w-full h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow border-t border-t-border-2">
class="absolute w-full h-40 overflow-y-auto scrollbar-hide top-[52px] flex flex-col gap-2 p-2 bg-white rounded z-10 shadow-custom">
<div
v-for="department in departments"
:key="department.departmentId"
Expand Down
4 changes: 2 additions & 2 deletions src/components/user-manage/UserRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<script lang="ts" setup>
import { addMemberAdmin } from '@/api/admin'
import { INITIAL_USER_REGISTRATION, RoleKeys, RoleTypeMapping } from '@/constants/admin'
import { INITIAL_USER_REGISTRATION, ROLE_TYPE_MAPPING, RoleKeys } from '@/constants/admin'
import DOMPurify from 'dompurify'
import { computed, onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
Expand Down Expand Up @@ -154,7 +154,7 @@ const handleSubmit = async () => {
...restForm,
departmentId: department?.departmentId,
isReviewer: isManager.value ? userRegistrationForm.value.isReviewer : false,
role: RoleTypeMapping[userRegistrationForm.value.role],
role: ROLE_TYPE_MAPPING[userRegistrationForm.value.role],
email: userRegistrationForm.value.nickname + userRegistrationForm.value.email
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/user-manage/UserUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import {
INITIAL_USER_REGISTRATION,
RoleKeys,
RoleMapping,
RoleTypeMapping
ROLE_TYPE_MAPPING
} from '@/constants/admin'
import type { UserRegistrationProps } from '@/types/admin'
import DOMPurify from 'dompurify'
Expand Down Expand Up @@ -159,7 +159,7 @@ const handleSubmit = async () => {

if (typeof userId.value === 'string') {
const formData = {
role: RoleTypeMapping[userRegistrationForm.value.role],
role: ROLE_TYPE_MAPPING[userRegistrationForm.value.role],
name: userRegistrationForm.value.name,
isReviewer: isManager.value ? userRegistrationForm.value.isReviewer : false,
departmentId: userRegistrationForm.value.department.departmentId,
Expand Down
Loading