From 78358f3b79a0e695af2072f9f56324bc08b1ae36 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: Wed, 12 Oct 2022 14:06:54 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B6=8C=ED=95=9C=EC=A0=95=EB=A6=AC=20-=20?= =?UTF-8?q?=EA=B8=B0=EC=B2=B4=EB=AA=A9=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/basis/dron/BasisDronTab.js | 31 +------- .../basis/dron/BasisDronContainer.js | 74 +++++-------------- .../basis/dron/BasisDronDetailContainer.js | 13 +++- .../basis/dron/BasisIdntfContainer.js | 15 +++- 4 files changed, 42 insertions(+), 91 deletions(-) diff --git a/src/components/basis/dron/BasisDronTab.js b/src/components/basis/dron/BasisDronTab.js index adb21916..1bde8958 100644 --- a/src/components/basis/dron/BasisDronTab.js +++ b/src/components/basis/dron/BasisDronTab.js @@ -8,37 +8,10 @@ import { NavItem, NavLink, TabContent, - CardTitle, - CardText, - Button, - TabPane, - Form, - FormGroup, - Label, - Input, - Media + TabPane } from 'reactstrap'; import classnames from 'classnames'; -import { - User, - Info, - Share, - X, - Lock, - Edit, - Trash2, - Image, - UserCheck, - Clipboard, - Settings, - AlertTriangle -} from 'react-feather'; -import { BasisDronForm } from './BasisDronForm'; -import Repeater from '@components/repeater'; -import Avatar from '@components/avatar'; -import drone_img from '../../../assets/images/drone.jpg'; -import { BasisDronImage } from './BasisDronImage'; -import { BasisIdntfForm } from './BasisIdntform'; +import { Settings, AlertTriangle } from 'react-feather'; import { BasisDronDetailContainer } from '../../../containers/basis/dron/BasisDronDetailContainer'; import { BasisIdntfContainer } from '../../../containers/basis/dron/BasisIdntfContainer'; export const BasisDronTab = props => { diff --git a/src/containers/basis/dron/BasisDronContainer.js b/src/containers/basis/dron/BasisDronContainer.js index a528bc4b..9eeedc5e 100644 --- a/src/containers/basis/dron/BasisDronContainer.js +++ b/src/containers/basis/dron/BasisDronContainer.js @@ -31,12 +31,13 @@ export const BasisDronContainer = props => { const titleName = '기체 관리'; //모달 관련 설정 - const [modal, setModal] = useState({ - isOpen: false, - title: '', - desc: '' - }); + // const [modal, setModal] = useState({ + // isOpen: false, + // title: '', + // desc: '' + // }); + //기체등록버튼 활성/비활성 제어 const [isMyGroup, setIsMyGroup] = useState(); const columns = [ @@ -154,62 +155,24 @@ export const BasisDronContainer = props => { // minWidth: '102px', sortable: true, cell: row => { - // const [isHover, setIsHover] = useState(false); - // const enter = () => { - // setIsHover(true); - // }; - // const leave = () => { - // setIsHover(false); - // }; - - let mine = false; - if (user.authId === 'SUPER') { - mine = true; - } else if (user.authId === 'ADMIN' || user.authId === 'USER') { - if (row.createUserId === user.userId) { - mine = true; - } - } - return ( <> - {mine ? ( - <> - 상세보기 - - ) : ( - <> - {/* - 상세보기 - */} - - - - )} + 상세보기 ); } } ]; - const handlerNotMine = () => { - setModal({ - isOpen: true, - title: '조회 불가', - desc: '사용자가 등록한 기체가 아닙니다.', - color: 'danger' - }); - return; - }; + // const handlerNotMine = () => { + // setModal({ + // isOpen: true, + // title: '조회 불가', + // desc: '사용자가 등록한 기체가 아닙니다.', + // color: 'danger' + // }); + // return; + // }; useEffect(() => { handlerCancel(); @@ -259,6 +222,7 @@ export const BasisDronContainer = props => { Actions.LIST.request({ searchParams: { groupId: groupId, page: 1 } }) ); + //기체등록버튼 활성/비활성 제어 let my = false; if (user.authId === 'SUPER') { my = true; @@ -345,7 +309,7 @@ export const BasisDronContainer = props => { -
+ {/*
setModal({ ...modal, isOpen: !modal.isOpen })} @@ -367,7 +331,7 @@ export const BasisDronContainer = props => { {' '} -
+
*/} ); }; diff --git a/src/containers/basis/dron/BasisDronDetailContainer.js b/src/containers/basis/dron/BasisDronDetailContainer.js index c76e1e1e..e6838b4f 100644 --- a/src/containers/basis/dron/BasisDronDetailContainer.js +++ b/src/containers/basis/dron/BasisDronDetailContainer.js @@ -120,13 +120,20 @@ export const BasisDronDetailContainer = props => { setImageUrl(detail?.imageUrl); } } - if (detail?.createUserId) { + if (user.authId === 'SUPER') { + props.setIsDisabled(false); + } else if (user.authId === 'ADMIN' || user.authId === 'USER') { if (detail?.createUserId != user?.userId) { props.setIsDisabled(true); } - } if (user.authId === 'SUPER') { - props.setIsDisabled(false); } + // if (detail?.createUserId) { + // if (detail?.createUserId != user?.userId) { + // props.setIsDisabled(true); + // } + // } if (user.authId === 'SUPER') { + // props.setIsDisabled(false); + // } }, [selectData, detail]); const handlerImageChange = e => { diff --git a/src/containers/basis/dron/BasisIdntfContainer.js b/src/containers/basis/dron/BasisIdntfContainer.js index 8f668aaa..59ade7f4 100644 --- a/src/containers/basis/dron/BasisIdntfContainer.js +++ b/src/containers/basis/dron/BasisIdntfContainer.js @@ -50,13 +50,20 @@ export const BasisIdntfContainer = props => { }, [isRefreshIdntf]); useEffect(() => { - if (detail?.createUserId) { + if (user.authId === 'SUPER') { + props.setIsDisabled(false); + } else if (user.authId === 'ADMIN' || user.authId === 'USER') { if (detail?.createUserId != user?.userId) { props.setIsDisabled(true); } - } if (user.authId === 'SUPER') { - props.setIsDisabled(false); } + // if (detail?.createUserId) { + // if (detail?.createUserId != user?.userId) { + // props.setIsDisabled(true); + // } + // } if (user.authId === 'SUPER') { + // props.setIsDisabled(false); + // } }, [detail]); const handlerSearch = () => { @@ -145,7 +152,7 @@ export const BasisIdntfContainer = props => { title: '필수값 입력 오류', desc: '식별장치 정보를 입력해 주세요.' }); - setIdntfData + setIdntfData; return false; } };