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); };