|
| 1 | +<template> |
| 2 | + <div class="w-[552px] flex flex-col gap-y-6"> |
| 3 | + <ModalView |
| 4 | + :isOpen="isModalVisible" |
| 5 | + :type="'successType'" |
| 6 | + @close="handleCancel"> |
| 7 | + <template #header> 새로운 회원이 추가되었습니다 </template> |
| 8 | + </ModalView> |
| 9 | + <RequestTaskInput |
| 10 | + v-model="userRegistrationForm.name" |
| 11 | + :placeholderText="'회원의 이름을 입력해주세요'" |
| 12 | + :labelName="'이름'" /> |
| 13 | + <RequestTaskInput |
| 14 | + v-model="userRegistrationForm.nickname" |
| 15 | + :placeholderText="'회원의 아이디를 입력해주세요'" |
| 16 | + :labelName="'아이디'" /> |
| 17 | + <RequestTaskInput |
| 18 | + v-model="userRegistrationForm.email" |
| 19 | + :placeholderText="'회원의 이메일을 입력해주세요'" |
| 20 | + :labelName="'이메일'" /> |
| 21 | + <RequestTaskDropdown |
| 22 | + v-model="userRegistrationForm.role" |
| 23 | + :options="RoleKeys" |
| 24 | + :label-name="'역할'" |
| 25 | + :placeholderText="'회원의 역할을 선택해주세요'" /> |
| 26 | + <FormCheckbox |
| 27 | + v-model="userRegistrationForm.isReviewer" |
| 28 | + :labelName="'요청 승인 권한'" |
| 29 | + :checkButtonName="'허용'" |
| 30 | + :isChecked="userRegistrationForm.isReviewer" /> |
| 31 | + <RequestTaskInput |
| 32 | + v-model="userRegistrationForm.departmentId" |
| 33 | + :placeholderText="'회원의 부서를 입력해주세요'" |
| 34 | + :is-not-required="true" |
| 35 | + :labelName="'부서'" /> |
| 36 | + <RequestTaskInput |
| 37 | + v-model="userRegistrationForm.departmentRole" |
| 38 | + :placeholderText="'회원의 직무를 입력해주세요'" |
| 39 | + :is-not-required="true" |
| 40 | + :labelName="'직무'" /> |
| 41 | + <FormButtonContainer |
| 42 | + :handleCancel="handleCancel" |
| 43 | + :handleSubmit="handleSubmit" |
| 44 | + cancelText="취소" |
| 45 | + submitText="추가" /> |
| 46 | + </div> |
| 47 | +</template> |
| 48 | + |
| 49 | +<script lang="ts" setup> |
| 50 | +import { INITIAL_USER_REGISTRATION, RoleKeys } from '@/constants/admin' |
| 51 | +import { ref } from 'vue' |
| 52 | +import ModalView from '../ModalView.vue' |
| 53 | +import RequestTaskDropdown from '../request-task/RequestTaskDropdown.vue' |
| 54 | +import RequestTaskInput from '../request-task/RequestTaskInput.vue' |
| 55 | +import FormButtonContainer from './FormButtonContainer.vue' |
| 56 | +import FormCheckbox from './FormCheckbox.vue' |
| 57 | +
|
| 58 | +const isModalVisible = ref(false) |
| 59 | +const userRegistrationForm = ref(INITIAL_USER_REGISTRATION) |
| 60 | +
|
| 61 | +const handleCancel = () => { |
| 62 | + userRegistrationForm.value = { ...INITIAL_USER_REGISTRATION } |
| 63 | + isModalVisible.value = false |
| 64 | +} |
| 65 | +
|
| 66 | +const handleSubmit = () => { |
| 67 | + console.log(userRegistrationForm.value) |
| 68 | + isModalVisible.value = true |
| 69 | +} |
| 70 | +</script> |
0 commit comments