diff --git a/src/components/basis/dron/BasisDronTab.js b/src/components/basis/dron/BasisDronTab.js index adb2191..1bde895 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 a528bc4..9eeedc5 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 c76e1e1..e6838b4 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 8f668aa..59ade7f 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; } };