From 5b01356ddfe3ea84767c74a8167c7f59b331857c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Thu, 13 Oct 2022 17:28:58 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9D=EB=B3=84=EC=9E=A5=EC=B9=98=20disabled?= =?UTF-8?q?=20=EC=A1=B0=EA=B1=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/dron/BasisIdntfContainer.js | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js index ab074f8..16687e6 100644 --- a/src/containers/basis/dron/BasisIdntfContainer.js +++ b/src/containers/basis/dron/BasisIdntfContainer.js @@ -28,9 +28,6 @@ export const BasisIdntfContainer = props => { const [idntDataList, setIdntfDataList] = useState([]); - //내가 등록한 식별장치 목록 - const [myIdntf, setMyIdntf] = useState([]); - useEffect(() => { if (props.id) { handlerSearch(); @@ -44,29 +41,26 @@ export const BasisIdntfContainer = props => { newArr.push({ ...item }); }); - //내가 등록한 식별장치 목록 + //내가 등록한 식별장치이면 disabled = false if (user?.authId === 'SUPER') { - // setIsDisabled(false); + newArr.map(prev => { + prev.disabled = false; + }); } else if (user?.authId === 'ADMIN') { if (props.isMyGroup) { if (newArr.length > 0) { newArr.filter(prev => { if (user?.cstmrSno === prev.cstmrSno) { prev.disabled = false; - setMyIdntf(r => [...r, prev]); } }); } - // else { - // console.log('식별장치 없음'); - // } } } else if (user?.authId === 'USER') { if (newArr.length > 0) { newArr.filter(prev => { if (user?.cstmrSno === prev.cstmrSno) { prev.disabled = false; - setMyIdntf(r => [...r, prev]); } }); } @@ -82,17 +76,6 @@ export const BasisIdntfContainer = props => { } }, [isRefreshIdntf]); - useEffect(() => { - if (detail?.createUserId) { - if (detail?.createUserId != user?.userId) { - props.setIsDisabled(true); - } - } - if (user.authId === 'SUPER') { - props.setIsDisabled(false); - } - }, [detail]); - const handlerSearch = () => { dispatch(Actions.IDNTF_LIST.request(props.id)); }; @@ -231,8 +214,6 @@ export const BasisIdntfContainer = props => { deletaData={deletaData} handlerSave={handlerCreate} handlerDelete={handlerDelete} - // isDisabled={props.isDisabled} - myIdntf={myIdntf} />