|
| 1 | +<template> |
| 2 | + <div class="flex flex-col w-full min-h-[240px] overflow-y-auto border border-border-1 rounded-lg"> |
| 3 | + <div class="flex w-full"> |
| 4 | + <div class="task-management-title rounded-tl-lg"> |
| 5 | + <p>색상</p> |
| 6 | + <p>구분명</p> |
| 7 | + </div> |
| 8 | + </div> |
| 9 | + <div class="flex w-full"> |
| 10 | + <DivisionManagementLine :divisionData="divisionData" /> |
| 11 | + </div> |
| 12 | + <div |
| 13 | + v-if="!isAdd" |
| 14 | + class="text-xs text-disabled gap-1 category-management-line justify-center cursor-pointer" |
| 15 | + @click="isAdd = true"> |
| 16 | + <CommonIcons :name="plusIcon" /> |
| 17 | + <p>새 구분 추가</p> |
| 18 | + </div> |
| 19 | + <div |
| 20 | + v-else |
| 21 | + class="category-management-line justify-between"> |
| 22 | + <div class="flex w-full gap-7 items-center pl-3 relative"> |
| 23 | + <div |
| 24 | + :style="{ |
| 25 | + borderColor: getColor(newDivision.divisionColor)?.borderColor, |
| 26 | + backgroundColor: getColor(newDivision.divisionColor)?.fillColor |
| 27 | + }" |
| 28 | + class="w-4 h-4 rounded-full border-2 cursor-pointer pr-3" |
| 29 | + @click="clickColor"></div> |
| 30 | + <ColorSelectModal |
| 31 | + v-if="isColorModalVisible" |
| 32 | + :is-open="isColorModalVisible" |
| 33 | + :devisionId="0" |
| 34 | + :selectedDivisionId="0" |
| 35 | + @close="closeColor" /> |
| 36 | + <input |
| 37 | + type="text" |
| 38 | + placeholder="새로운 구분명을 입력" |
| 39 | + class="w-full flex focus:outline-none" /> |
| 40 | + </div> |
| 41 | + <div class="flex gap-2 text-xs font-bold"> |
| 42 | + <button |
| 43 | + @click="addNewDivision" |
| 44 | + class="text-primary1 w-[21px]"> |
| 45 | + 확인 |
| 46 | + </button> |
| 47 | + <button |
| 48 | + @click="cancelAddDivision" |
| 49 | + class="text-disabled w-[21px]"> |
| 50 | + 취소 |
| 51 | + </button> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + <div class="mt-4"> |
| 55 | + <CategoryList /> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | +</template> |
| 59 | + |
| 60 | +<script setup lang="ts"> |
| 61 | +import { plusIcon } from '@/constants/iconPath' |
| 62 | +import { mockDivisionData } from '@/datas/taskmanagement' |
| 63 | +import type { DivisionDataTypes, NewDevisonTypes } from '@/types/admin' |
| 64 | +import { getColor } from '@/utils/color' |
| 65 | +import { ref } from 'vue' |
| 66 | +import CommonIcons from '../common/CommonIcons.vue' |
| 67 | +import ColorSelectModal from './ColorSelectModal.vue' |
| 68 | +import DivisionManagementLine from './DivisionManagementLine.vue' /* PartiallyEnd: #3632/scriptSetup.vue */ |
| 69 | +
|
| 70 | +const divisionData = ref<DivisionDataTypes[]>(mockDivisionData) |
| 71 | +const newDivision = ref<NewDevisonTypes>({ |
| 72 | + divisionName: '새로운 구분', |
| 73 | + divisionColor: 'red' |
| 74 | +}) |
| 75 | +const isColorModalVisible = ref(false) |
| 76 | +const isAdd = ref(false) |
| 77 | +
|
| 78 | +const addNewDivision = () => { |
| 79 | + console.log(newDivision, '추가로직') |
| 80 | + isAdd.value = false |
| 81 | +} |
| 82 | +
|
| 83 | +const cancelAddDivision = () => { |
| 84 | + isAdd.value = false |
| 85 | +} |
| 86 | +
|
| 87 | +const closeColor = () => { |
| 88 | + isColorModalVisible.value = false |
| 89 | +} |
| 90 | +
|
| 91 | +const clickColor = () => { |
| 92 | + isColorModalVisible.value = true |
| 93 | +} |
| 94 | +</script> |
0 commit comments