김지은 10 months ago
parent
commit
92d50022ba
  1. 5
      src/components/crud/grid/GridDatatable.js
  2. 88
      src/components/dashboard/DroneFlightSchedule.js
  3. 4
      src/components/laanc/list/LaancGrid.js
  4. 8
      src/modules/laanc/actions/laancActions.ts
  5. 6
      src/modules/laanc/reducers/laancReducers.ts

5
src/components/crud/grid/GridDatatable.js

@ -10,6 +10,7 @@ import {
import { selectableRowsComponent } from './selectableRowsComponent'; import { selectableRowsComponent } from './selectableRowsComponent';
export const GridDatabase = props => { export const GridDatabase = props => {
console.log(props.rowsPerPageText);
return props[`${props.handlerPageChange ? 'total' : 'count'}`] <= 0 ? ( return props[`${props.handlerPageChange ? 'total' : 'count'}`] <= 0 ? (
<div className='d-flex justify-content-center align-items-center h-100'> <div className='d-flex justify-content-center align-items-center h-100'>
<p>표시할 데이터가 없습니다.</p> <p>표시할 데이터가 없습니다.</p>
@ -39,7 +40,9 @@ export const GridDatabase = props => {
} }
onChangePage={props.pagination ? props.handlerPageChange : null} onChangePage={props.pagination ? props.handlerPageChange : null}
paginationComponentOptions={{ paginationComponentOptions={{
noRowsPerPage: props.handlerPageChange ? true : false noRowsPerPage: props.handlerPageChange ? true : false,
rowsPerPageText:
props.rowsPerPageText === 'noText' ? '' : 'Rows per page:'
}} }}
selectableRows={props.selectableRows} selectableRows={props.selectableRows}
selectableRowsComponent={props.selectableRowsComponent} selectableRowsComponent={props.selectableRowsComponent}

88
src/components/dashboard/DroneFlightSchedule.js

@ -120,47 +120,57 @@ export default function DroneFlightSchedule({
const { dronOperationList } = useSelector(state => state.mainDashState); const { dronOperationList } = useSelector(state => state.mainDashState);
return ( return (
<Card> <div className='invoice-list-wrapper'>
<CardHeader className=''> <Card>
<div className='w-100 d-flex justify-content-between'> <div className='invoice-list-dataTable'>
<CardTitle tag='h4'>드론 비행운항 목록</CardTitle> <CardHeader className=''>
<div className='d-flex align-items-center'> <div className='w-100 d-flex justify-content-between'>
{user?.cptAuthCode === 'KAC' || <CardTitle tag='h4'>드론 비행운항 목록</CardTitle>
(user?.authId === 'SUPER' && ( <div className='d-flex align-items-center'>
<Input {user?.cptAuthCode === 'KAC' ||
id='groupSelect' (user?.authId === 'SUPER' && (
type='select' <Input
size='sm' id='groupSelect'
style={{ minWidth: '120px' }} type='select'
s size='sm'
onChange={e => { style={{ minWidth: '120px' }}
const { value } = e.target; s
handlerDronOperationChange(value); onChange={e => {
}} const { value } = e.target;
> handlerDronOperationChange(value);
<option value='all'>그룹선택</option> }}
{competentAgency?.map(i => ( >
<option value={i.value}>{i.text}</option> <option value='all'>그룹선택</option>
{competentAgency?.map(i => (
<option value={i.value}>{i.text}</option>
))}
</Input>
))} ))}
</Input>
))}
<button <button
onClick={() => handlerMovePage('/basis/flight/schedule/index')} onClick={() =>
style={{ marginLeft: '8px' }} handlerMovePage('/basis/flight/schedule/index')
> }
<Plus /> style={{ marginLeft: '8px' }}
</button> >
</div> <Plus />
</button>
</div>
</div>
</CardHeader>
<CardBody>
<GridDatabase
data={dronOperationList || []}
paginationPerPage={8}
paginationRowsPerPageOptions={[]}
rowsPerPageText={'noText'}
total={dronOperationList?.length || 0}
columns={columns}
pagination
/>
</CardBody>
</div> </div>
</CardHeader> </Card>
<CardBody> </div>
<GridDatabase
data={dronOperationList || []}
count={dronOperationList?.length || 0}
columns={columns}
/>
</CardBody>
</Card>
); );
} }

4
src/components/laanc/list/LaancGrid.js

@ -26,6 +26,10 @@ export default function LaancGrid() {
); );
const { loading } = useSelector(state => state.loadingReducer); const { loading } = useSelector(state => state.loadingReducer);
useEffect(() => {
return () => dispatch(LaancAction.LAANC_APPROVAL_DETAIL_INIT());
}, []);
useEffect(() => { useEffect(() => {
if (laancDetail) { if (laancDetail) {
dispatch(FLIGHT_PLAN_AREA_BUFFER_LIST.request(laancDetail?.areaList)); dispatch(FLIGHT_PLAN_AREA_BUFFER_LIST.request(laancDetail?.areaList));

8
src/modules/laanc/actions/laancActions.ts

@ -60,6 +60,8 @@ const LAANC_VALID_TS_FAILURE = 'laanc/valid/ts/FAILURE';
// laanc 초기화 // laanc 초기화
const INIT_LAANC = 'laanc/init'; const INIT_LAANC = 'laanc/init';
// laanc approval detail 초기화
const INIT_APPROVAL_DETAIL = 'laanc/init/approval/detail';
// 허뎓 고도 초기화 // 허뎓 고도 초기화
// const INIT_ALTITUDE = 'laanc/init/altitude'; // const INIT_ALTITUDE = 'laanc/init/altitude';
@ -79,6 +81,9 @@ export const LAANC_FLIGHT_Approval = createAsyncAction(
// laanc 초기화 // laanc 초기화
export const LAANC_APPROVAL_INIT = createAction(INIT_LAANC)(); export const LAANC_APPROVAL_INIT = createAction(INIT_LAANC)();
// laanc approval detail 초기화
export const LAANC_APPROVAL_DETAIL_INIT = createAction(INIT_APPROVAL_DETAIL)();
// 허용고도 초기화 // 허용고도 초기화
// export const LAANC_ALTITUDE_INIT = createAction(INIT_ALTITUDE)(); // export const LAANC_ALTITUDE_INIT = createAction(INIT_ALTITUDE)();
@ -146,6 +151,7 @@ const actions = {
LAANC_DETAIL, LAANC_DETAIL,
LAANC_ALTITUDE, LAANC_ALTITUDE,
LAANC_VALID_AREA, LAANC_VALID_AREA,
LAANC_VALID_TS LAANC_VALID_TS,
LAANC_APPROVAL_DETAIL_INIT
}; };
export type LaancAction = ActionType<typeof actions>; export type LaancAction = ActionType<typeof actions>;

6
src/modules/laanc/reducers/laancReducers.ts

@ -36,6 +36,11 @@ export const laancReducer = createReducer<laancState, Actions.LaancAction>(
draft.laancPdf = undefined; draft.laancPdf = undefined;
}) })
) )
.handleAction(Actions.LAANC_APPROVAL_DETAIL_INIT, (state, action) =>
produce(state, draft => {
draft.laancDetail = undefined;
})
)
.handleAction(Actions.LAANC_SUN_DATA.success, (state, action) => .handleAction(Actions.LAANC_SUN_DATA.success, (state, action) =>
produce(state, draft => { produce(state, draft => {
const data = action.payload; const data = action.payload;
@ -62,7 +67,6 @@ export const laancReducer = createReducer<laancState, Actions.LaancAction>(
} }
draft.laancElev.push(...data); draft.laancElev.push(...data);
if (draft.laancElev.length > 0) { if (draft.laancElev.length > 0) {
console.log('data>>', [Math.min(...draft.laancElev)]);
draft.laancElev = data; draft.laancElev = data;
// draft.laancElev = [Math.min(...draft.laancElev)]; // draft.laancElev = [Math.min(...draft.laancElev)];
} }

Loading…
Cancel
Save