Browse Source

LAANC시스템 버튼 기능 추가

pull/2/head
sanguu516(박상현) 1 year ago
parent
commit
41adf94545
  1. 4
      src/modules/control/map/reducers/controlMapReducer.ts
  2. 164
      src/views/control/main/ControlMain.js

4
src/modules/control/map/reducers/controlMapReducer.ts

@ -11,11 +11,9 @@ const initialState = {
area0005: true, // 이착륙장(RC비행장) area0005: true, // 이착륙장(RC비행장)
area0006: true, // 초경량비행장치 area0006: true, // 초경량비행장치
sensor: 'dust', sensor: 'dust',
isLaanc: false,
drawType: null, drawType: null,
ctrlDrawType: null, ctrlDrawType: null,
drawCheck: '' drawCheck: ''
}; };

164
src/views/control/main/ControlMain.js

@ -43,7 +43,11 @@ import { NavLink } from 'reactstrap';
const ControlMain = () => { const ControlMain = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { isClickObject } = useSelector(state => state.controlMapReducer); const { isClickObject, isLaanc } = useSelector(
state => state.controlMapReducer
);
const mapControl = useSelector(state => state.controlMapReducer);
const { controlGpList, controlGroupAuthInfo } = useSelector( const { controlGpList, controlGroupAuthInfo } = useSelector(
state => state.controlGpState state => state.controlGpState
); );
@ -53,6 +57,7 @@ const ControlMain = () => {
const { controlGpCountDrone, controlGpCountFlight } = useSelector( const { controlGpCountDrone, controlGpCountFlight } = useSelector(
state => state.controlGpCountState state => state.controlGpCountState
); );
console.log('>>>>', isClickObject);
// pav박람회 -> uam, 드론 구별을 위한 임시 코드 // pav박람회 -> uam, 드론 구별을 위한 임시 코드
// (이 작업으로 고도화 하려면 추후에 서버에서 uam타입을 새로 더 받아 작업해야 함) // (이 작업으로 고도화 하려면 추후에 서버에서 uam타입을 새로 더 받아 작업해야 함)
@ -171,49 +176,106 @@ const ControlMain = () => {
} }
}; };
const hadlerLaanc = () => {
if (isLaanc) mapControl.isLaanc = false;
else if (!isLaanc) mapControl.isLaanc = true;
};
return ( return (
<> <>
<ControlAlarmNotice /> {isLaanc ? (
<>
{' '}
<ControlAlarmNotice />
<div className='left-menu'>
<h1 className='logo'>
<img src={logo} width='80' />
<span>PAL</span>
</h1>
<div className='left-menu'> <ul className='left-menu-nav'>
<h1 className='logo'> <li>
<img src={logo} width='80' /> <button onClick={() => openMenu('reportList')}>
<span>PAL</span> <DroneMenuIcon width='30' height='30' />
</h1> </button>
</li>
{/* <li>
<button>
<Bell width='20' height='20' />
</button>
</li> */}
{/* <li>
<button onClick={() => openMenu('weatherList')}>
<Sun size={25} />
</button>
</li> */}
<li>
<button onClick={() => openMenu('alarmList')}>
{alarm ? (
<IoAlertOutline size={25} />
) : (
<Bell width='20' height='20' />
)}
</button>
</li>
<li>
<NavLink className='nav-link-style'>
<ThemeToggler />
</NavLink>
</li>
</ul>
<ul className='left-menu-footer'>
{/* <li>
<img src={future_logo} width='50' />
</li>
<li>
<img src={nam_logo} width='50' />
</li>
<li>
<img src={finevt_logo} width='50' />
</li> */}
<li>
<img src={kac_logo} width='50' />
</li>
<li>
<img src={tp_logo} width='50' />
</li>
<li>
<AiOutlinePoweroff
size={25}
className='logout-btn'
onClick={handlerLogout}
/>
</li>
<li style={{ marginLeft: '8px' }}>
<WebsocketClient />
</li>
{/* socket_off = 클래스명 변경시 빨간색! 접속이 원할하지않을때 */}
</ul>
</div>
</>
) : (
<>
<ControlAlarmNotice />
<div className='left-menu'>
<h1 className='logo'>
<img src={logo} width='80' />
<span>PAL</span>
</h1>
<ul className='left-menu-nav'> <ul className='left-menu-nav'>
<li> {/* <li>
<button onClick={() => openMenu('reportList')}>
<DroneMenuIcon width='30' height='30' />
</button>
</li>
{/* <li>
<button> <button>
<Bell width='20' height='20' /> <Bell width='20' height='20' />
</button> </button>
</li> */} </li> */}
{/* <li> {/* <li>
<button onClick={() => openMenu('weatherList')}> <button onClick={() => openMenu('weatherList')}>
<Sun size={25} /> <Sun size={25} />
</button> </button>
</li> */} </li> */}
<li> </ul>
<button onClick={() => openMenu('alarmList')}> <ul className='left-menu-footer'>
{alarm ? ( {/* <li>
<IoAlertOutline size={25} />
) : (
<Bell width='20' height='20' />
)}
</button>
</li>
<li>
<NavLink className='nav-link-style'>
<ThemeToggler />
</NavLink>
</li>
</ul>
<ul className='left-menu-footer'>
{/* <li>
<img src={future_logo} width='50' /> <img src={future_logo} width='50' />
</li> </li>
<li> <li>
@ -222,25 +284,23 @@ const ControlMain = () => {
<li> <li>
<img src={finevt_logo} width='50' /> <img src={finevt_logo} width='50' />
</li> */} </li> */}
<li>
<img src={kac_logo} width='50' /> <li>
</li> <AiOutlinePoweroff
<li> size={25}
<img src={tp_logo} width='50' /> className='logout-btn'
</li> onClick={handlerLogout}
<li> />
<AiOutlinePoweroff </li>
size={25} <li style={{ marginLeft: '8px' }}>
className='logout-btn' <WebsocketClient />
onClick={handlerLogout} </li>
/> {/* socket_off = 클래스명 변경시 빨간색! 접속이 원할하지않을때 */}
</li> </ul>
<li style={{ marginLeft: '8px' }}> </div>
<WebsocketClient /> </>
</li> )}
{/* socket_off = 클래스명 변경시 빨간색! 접속이 원할하지않을때 */}
</ul>
</div>
<div <div
className={ className={
!oepnReportList && !openAlarmList && !isClickObject !oepnReportList && !openAlarmList && !isClickObject
@ -351,7 +411,7 @@ const ControlMain = () => {
</div> </div>
<div className='data-list-box'> <div className='data-list-box'>
<div className='data-list' style={{ cursor: 'pointer' }}> <div className='data-list' style={{ cursor: 'pointer' }}>
<span onClick={() => {}}>승인요청 바로가기</span> <span onClick={hadlerLaanc}>승인요청 바로가기</span>
</div> </div>
{/* <div className='data-list' style={{ cursor: 'pointer' }}> {/* <div className='data-list' style={{ cursor: 'pointer' }}>
<span onClick={() => handlerDrawType('RESET')}>초기화</span> <span onClick={() => handlerDrawType('RESET')}>초기화</span>

Loading…
Cancel
Save