diff --git a/src/containers/basis/dron/BasisDronDetailContainer.js b/src/containers/basis/dron/BasisDronDetailContainer.js
index 0fff3535..a1ca41a4 100644
--- a/src/containers/basis/dron/BasisDronDetailContainer.js
+++ b/src/containers/basis/dron/BasisDronDetailContainer.js
@@ -21,12 +21,27 @@ export const BasisDronDetailContainer = props => {
const titleName = ' 기체 관리';
const [pageType, setPageType] = useState('create');
const validationSchema = yup.object().shape({
- arcrftModelNm: yup.string().trim().required('모델명 을 입력해 주세요.'),
+ arcrftModelNm: yup.string().trim().required('모델명 을 입력해 주세요.')
+ .max(20, '최대 20 자 이하 입력 부탁드립니다.')
+ .matches(
+ /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/,
+ '지원하지 않는 특수문자입니다.'
+ ),
arcrftTypeCd: yup.string().trim().required('종류 를 선택해 주세요.'),
cameraYn: yup.string().trim().required('카메라 탑재여부 를 선택해 주세요.'),
insrncYn: yup.string().trim().required('보험가입 여부를 선택해 주세요.'),
- prdctCmpnNm: yup.string().trim().required('제작사 를 입력해 주세요.'),
- prdctNum: yup.string().trim().required('제작번호 를 입력해 주세요.'),
+ prdctCmpnNm: yup.string().trim().required('제작사 를 입력해 주세요.')
+ .max(20, '최대 20 자 이하 입력 부탁드립니다.')
+ .matches(
+ /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/,
+ '지원하지 않는 특수문자입니다.'
+ ),
+ prdctNum: yup.string().trim().required('제작번호 를 입력해 주세요.')
+ .max(20, '최대 20 자 이하 입력 부탁드립니다.')
+ .matches(
+ /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/,
+ '지원하지 않는 특수문자입니다.'
+ ),
wghtTypeCd: yup.string().trim().required('중량구분 을 선택해 주세요.'),
// ownerNm: yup.string().trim().required('운영자명 을 입력해 주세요.'),
// hpno: yup.string().trim().required('운영자 연락처 를 입력해 주세요.')
@@ -101,21 +116,21 @@ export const BasisDronDetailContainer = props => {
const handlerImageChange = e => {
const reader = new FileReader(),
files = e.target.files;
- if(!(files[0] == undefined)){
- if(!(files[0].size == 0)){
- const fileSize = files[0].size/1048576;
- if(fileSize > 10) {
- setModal({
- isOpen: true,
- title: '이미지 용량 초과',
- desc: '10MB 이하의 파일만 등록 가능합니다',
- color: 'modal-danger'
- })
- return;
- }
- }
+ if (!(files[0] == undefined)) {
+ if (!(files[0].size == 0)) {
+ const fileSize = files[0].size / 1048576;
+ if (fileSize > 10) {
+ setModal({
+ isOpen: true,
+ title: '이미지 용량 초과',
+ desc: '10MB 이하의 파일만 등록 가능합니다',
+ color: 'modal-danger'
+ })
+ return;
}
- saveFileAPI(files[0]);
+ }
+ }
+ saveFileAPI(files[0]);
};
const handlerImageDelete = () => {
@@ -155,7 +170,7 @@ export const BasisDronDetailContainer = props => {
dispatch(Actions.UPDATE.request(saveData));
};
- const handlerDelete = async data => {
+ const handlerDelete = async data => {
dispatch(Actions.DELETE.request(detail.arcrftSno));
};
@@ -195,13 +210,13 @@ export const BasisDronDetailContainer = props => {
>
저장
- {pageType != 'create'?
+ {pageType != 'create' ?
(
삭제
)
- :
+ :
(
<>>
)
diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js
index bb58bf1c..6297ce91 100644
--- a/src/containers/basis/dron/BasisIdntfContainer.js
+++ b/src/containers/basis/dron/BasisIdntfContainer.js
@@ -14,8 +14,8 @@ export const BasisIdntfContainer = props => {
id: '',
idntfNum: '',
idntfTypeCd: 'DRON',
- ownerNm:'',
- hpno:'',
+ ownerNm: '',
+ hpno: '',
isSave: false
});
//모달 관련 설정
@@ -55,12 +55,44 @@ export const BasisIdntfContainer = props => {
const handlerCreate = async () => {
let saveArr = idntDataList.filter(item => item.isSave === false);
-
+
if (saveArr.length > 0) {
let checking = true;
saveArr.forEach(idntf => {
-
+
+ const check_num = /[0-9]/;
+ const check_kor = /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/;
+ if (!check_num.test(idntf.hpno)) {
+ setModal({
+ isOpen: true,
+ title: '필수값 입력 오류',
+ desc: '연락처에 숫자만 입력해주세요.'
+ });
+ checking = false;
+ return false;
+
+ }
+ if (!check_kor.test(idntf.idntfNum)) {
+ setModal({
+ isOpen: true,
+ title: '필수값 입력 오류',
+ desc: '식별번호에 지원되지 않는 특수문자입니다.'
+ });
+ checking = false;
+ return false;
+
+ }
+ if (!check_kor.test(idntf.ownerNm)) {
+ setModal({
+ isOpen: true,
+ title: '필수값 입력 오류',
+ desc: '소유자명에 지원되지 않는 특수문자입니다.'
+ });
+ checking = false;
+ return false;
+
+ }
if (!idntf.idntfNum && idntf.idntfNum === '') {
setModal({
isOpen: true,
@@ -70,7 +102,7 @@ export const BasisIdntfContainer = props => {
checking = false;
return false;
}
- if(!idntf.ownerNm && idntf.ownerNm === '') {
+ if (!idntf.ownerNm && idntf.ownerNm === '') {
setModal({
isOpen: true,
title: '필수값 입력 오류',
@@ -79,7 +111,7 @@ export const BasisIdntfContainer = props => {
checking = false;
return false;
}
- if(!idntf.hpno && idntf.hpno === '') {
+ if (!idntf.hpno && idntf.hpno === '') {
setModal({
isOpen: true,
title: '필수값 입력 오류',
@@ -114,6 +146,7 @@ export const BasisIdntfContainer = props => {
const addData = () => {
+
setIdntfDataList([...idntDataList, { ...idntfData, id: Math.random() }]);
};
@@ -149,17 +182,17 @@ export const BasisIdntfContainer = props => {
) : (
-
-
-
+
+
+
);