From cc96fca561ced4c736c62a1d6b15c3c615f5fb52 Mon Sep 17 00:00:00 2001 From: sanguu516 Date: Thu, 13 Oct 2022 14:30:04 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=B2=B4=EB=93=B1=EB=A1=9D-=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EA=B0=92=20=EB=A1=A4=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/dron/BasisIdntfContainer.js | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js index 139edff3..1332edb5 100644 --- a/src/containers/basis/dron/BasisIdntfContainer.js +++ b/src/containers/basis/dron/BasisIdntfContainer.js @@ -13,7 +13,7 @@ export const BasisIdntfContainer = props => { const dispatch = useDispatch(); const [idntfData, setIdntfData] = useState({ id: '', - idntfNum: 'PALDRONE-', + idntfNum: '', idntfTypeCd: 'DRON', ownerNm: '', hpno: '', @@ -50,13 +50,13 @@ export const BasisIdntfContainer = props => { }, [isRefreshIdntf]); useEffect(() => { - // if (user?.authId === 'SUPER') { - // props.setIsDisabled(false); - // } else if (user?.authId === 'ADMIN' || user?.authId === 'USER') { - // if (detail?.createUserId != user?.userId) { - // props.setIsDisabled(true); - // } - // } + if (detail?.createUserId) { + if (detail?.createUserId != user?.userId) { + props.setIsDisabled(true); + } + } if (user.authId === 'SUPER') { + props.setIsDisabled(false); + } }, [detail]); const handlerSearch = () => { @@ -72,9 +72,9 @@ export const BasisIdntfContainer = props => { saveArr.forEach(idntf => { const check_num = /[0-9]/; const check_kor = - /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|_,.<>\/?\s]*$/; + /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/; - if (idntf.idntfNum === 'PALDRONE-') { + if (!idntf.idntfNum && idntf.idntfNum === '') { setModal({ isOpen: true, title: '필수값 입력 오류', @@ -105,7 +105,7 @@ export const BasisIdntfContainer = props => { setModal({ isOpen: true, title: '필수값 입력 오류', - desc: '식별번호에 특수문자를 작성하실 수 없습니다.' + desc: '식별번호에 지원되지 않는 특수문자입니다.' }); checking = false; return false; @@ -145,7 +145,6 @@ export const BasisIdntfContainer = props => { title: '필수값 입력 오류', desc: '식별장치 정보를 입력해 주세요.' }); - setIdntfData; return false; } }; @@ -168,16 +167,10 @@ export const BasisIdntfContainer = props => { const handlerInput = (event, index) => { const { name, value } = event.target; + let newArr = [...idntDataList]; // copying the old datas array newArr[index] = { ...newArr[index], [name]: value }; - if (newArr[index].idntfNum.length < 9) { - setModal({ - isOpen: true, - title: '필수값 입력 오류', - desc: '식별 장치 기본값입니다.' - }); - newArr[index] = { ...newArr[index], idntfNum: 'PALDRONE-' }; - } + setIdntfDataList(newArr); };