From e7271ce92733368e1f49dac5e1b816c6feb0e20b 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: Fri, 30 Sep 2022 16:18:17 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=8A=B9=EC=9D=B8=20-=20=EC=B2=B4=ED=81=AC=EB=B0=95=EC=8A=A4?= =?UTF-8?q?=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/aprv/FlightPlanAprvGrid.js | 9 ++++++--- src/components/crud/grid/GridDatatable.js | 10 ++++++---- .../crud/grid/selectableRowsComponent.js | 17 +++++++++++++++++ .../flight/aprv/FlightPlanAprvContainer.js | 1 + .../flight/plan/FlightPlanDetailContainer.js | 4 ++-- 5 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 src/components/crud/grid/selectableRowsComponent.js diff --git a/src/components/basis/flight/aprv/FlightPlanAprvGrid.js b/src/components/basis/flight/aprv/FlightPlanAprvGrid.js index 4969fc5..f182f94 100644 --- a/src/components/basis/flight/aprv/FlightPlanAprvGrid.js +++ b/src/components/basis/flight/aprv/FlightPlanAprvGrid.js @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { Button, Card, Col, Row, CustomInput } from 'reactstrap'; import { GridDatabase } from '../../../crud/grid/GridDatatable'; import { Link } from 'react-router-dom'; +import { selectableRowsComponent } from '../../../crud/grid/selectableRowsComponent'; const FlightPlanAprvGrid = ({ data, @@ -50,13 +51,13 @@ const FlightPlanAprvGrid = ({ name: '번호', cell: (row, i) => ( <> - {/* handleChangeCheckbox(e, row)} - /> */} + />
{i + 1}
) @@ -141,8 +142,10 @@ const FlightPlanAprvGrid = ({ columns={columns} count={!!data ? data.length : 0} // pagination={props.pagination} - selectableRows + selectableRows //체크박스 할거다 + selectableRowsComponent={selectableRowsComponent} onSelectedRowsChange={handleChangeSelected} + // onSelectedRowsChange={handleChangeCheckbox} /> {/* 검색된 데이터가 없습니다. */} diff --git a/src/components/crud/grid/GridDatatable.js b/src/components/crud/grid/GridDatatable.js index 07aef16..b1af304 100644 --- a/src/components/crud/grid/GridDatatable.js +++ b/src/components/crud/grid/GridDatatable.js @@ -7,6 +7,7 @@ import { File, ChevronDown } from 'react-feather'; +import { selectableRowsComponent } from './selectableRowsComponent'; export const GridDatabase = props => { return props[`${props.handlerPageChange ? 'total' : 'count'}`] <= 0 ? ( @@ -30,14 +31,15 @@ export const GridDatabase = props => { paginationServer={ props.pagination && props.handlerPageChange ? true : false } - onSelectedRowsChange={ - props.onSelectedRowsChange ? props.onSelectedRowsChange : null - } - selectableRows={props.selectableRows} onChangePage={props.pagination ? props.handlerPageChange : null} paginationComponentOptions={{ noRowsPerPage: props.handlerPageChange ? true : false }} + selectableRows={props.selectableRows} + selectableRowsComponent={props.selectableRowsComponent} + onSelectedRowsChange={ + props.onSelectedRowsChange ? props.onSelectedRowsChange : null + } /> ); diff --git a/src/components/crud/grid/selectableRowsComponent.js b/src/components/crud/grid/selectableRowsComponent.js new file mode 100644 index 0000000..3d0ba94 --- /dev/null +++ b/src/components/crud/grid/selectableRowsComponent.js @@ -0,0 +1,17 @@ +import { CustomInput, Input } from 'reactstrap'; +import React from 'react'; + +export const selectableRowsComponent = React.forwardRef( + ({ onClick, ...rest }, ref) => { + console.log(rest); + return ( + + ); + } +); diff --git a/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js index 89203ef..e9febcb 100644 --- a/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js +++ b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js @@ -173,6 +173,7 @@ const FlightPlanAprvContainer = () => { })); }; const handleChangeSelected = ({ selectedRows }) => { + console.log(selectedRows); setSelPlanSnoList(selectedRows.map(item => item.planSno)); }; const handleChangeCheckbox = (e, row) => { diff --git a/src/containers/basis/flight/plan/FlightPlanDetailContainer.js b/src/containers/basis/flight/plan/FlightPlanDetailContainer.js index 9bbdb94..d079d03 100644 --- a/src/containers/basis/flight/plan/FlightPlanDetailContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanDetailContainer.js @@ -45,9 +45,9 @@ const FlightPlanDetailContainer = () => { let cTime = new Date(); let pTime = new Date(date); if (cTime > pTime) { - setIsDone(true); + // setIsDone(true); } else { - setIsDone(false); + // setIsDone(false); } } }, [date]); From 1cb2169c04d5ba6c5fd53cb3b259400cb71e0c70 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: Fri, 30 Sep 2022 16:22:08 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EB=B9=84=ED=96=89=20=EC=8B=9C=EC=9E=91=20?= =?UTF-8?q?=ED=9B=84=20=EC=88=98=EC=A0=95=20=EB=B6=88=EA=B0=80(=EC=9E=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/containers/basis/flight/plan/FlightPlanDetailContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/basis/flight/plan/FlightPlanDetailContainer.js b/src/containers/basis/flight/plan/FlightPlanDetailContainer.js index d079d03..9bbdb94 100644 --- a/src/containers/basis/flight/plan/FlightPlanDetailContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanDetailContainer.js @@ -45,9 +45,9 @@ const FlightPlanDetailContainer = () => { let cTime = new Date(); let pTime = new Date(date); if (cTime > pTime) { - // setIsDone(true); + setIsDone(true); } else { - // setIsDone(false); + setIsDone(false); } } }, [date]); From b6b9c4c2fb82fe4f5ae8f3e3cfda9dd8e30078e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hagjoon=28=EC=9D=B4=ED=95=99=EC=A4=80=29?= Date: Fri, 30 Sep 2022 17:18:42 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20-=20list=20=EB=91=90=EB=B2=88=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/group/BasisGroupUsersContainer.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/containers/basis/group/BasisGroupUsersContainer.js b/src/containers/basis/group/BasisGroupUsersContainer.js index ca002a6..ff151a2 100644 --- a/src/containers/basis/group/BasisGroupUsersContainer.js +++ b/src/containers/basis/group/BasisGroupUsersContainer.js @@ -191,12 +191,14 @@ export const BasisGroupUsersContainer = props => { }, []); const handlerSearch = () => { - dispatch( - Actions.USER_LIST.request({ - searchParams: params, - cstmrSno: user?.cstmrSno - }) - ); + if (params.cstmrSno && user?.cstmrSno) { + dispatch( + Actions.USER_LIST.request({ + searchParams: params, + cstmrSno: user?.cstmrSno + }) + ); + } }; const handlerAdminConfirm = cstmrGroupSno => { From 12a19d049618ccfe5751fc390f986fb8b052347e 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: Tue, 4 Oct 2022 11:01:12 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=8A=B9=EC=9D=B8=20-=20=EC=B2=B4=ED=81=AC=EB=B0=95=EC=8A=A4?= =?UTF-8?q?=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/aprv/FlightPlanAprvGrid.js | 20 +------ src/components/crud/grid/GridDatatable.js | 56 ++++++++++--------- .../crud/grid/selectableRowsComponent.js | 16 +++--- .../flight/aprv/FlightPlanAprvContainer.js | 44 +++++++-------- 4 files changed, 62 insertions(+), 74 deletions(-) diff --git a/src/components/basis/flight/aprv/FlightPlanAprvGrid.js b/src/components/basis/flight/aprv/FlightPlanAprvGrid.js index f182f94..c0582d2 100644 --- a/src/components/basis/flight/aprv/FlightPlanAprvGrid.js +++ b/src/components/basis/flight/aprv/FlightPlanAprvGrid.js @@ -11,8 +11,6 @@ const FlightPlanAprvGrid = ({ handleClickAprv, joinList, selectGroup, - selPlanSnoList, - setSelPlanSnoList, handleChangeCheckbox }) => { const [aprvAuth, setAprvAuth] = useState(''); @@ -49,24 +47,13 @@ const FlightPlanAprvGrid = ({ { id: 'planSno', name: '번호', - cell: (row, i) => ( - <> - handleChangeCheckbox(e, row)} - /> -
{i + 1}
- - ) + cell: (row, i) =>
{i + 1}
}, { id: 'fltPurpose', name: '비행목적', minWidth: '150px', - cell: row =>
{row.fltPurpose}
+ cell: (row, i) =>
{row.fltPurpose}
}, { id: 'fltMethod', @@ -142,10 +129,9 @@ const FlightPlanAprvGrid = ({ columns={columns} count={!!data ? data.length : 0} // pagination={props.pagination} - selectableRows //체크박스 할거다 + selectableRows selectableRowsComponent={selectableRowsComponent} onSelectedRowsChange={handleChangeSelected} - // onSelectedRowsChange={handleChangeCheckbox} /> {/* 검색된 데이터가 없습니다. */} diff --git a/src/components/crud/grid/GridDatatable.js b/src/components/crud/grid/GridDatatable.js index b1af304..e3e364a 100644 --- a/src/components/crud/grid/GridDatatable.js +++ b/src/components/crud/grid/GridDatatable.js @@ -14,33 +14,35 @@ export const GridDatabase = props => {
표시할 데이터가 없습니다.
) : ( <> - } - className='react-dataTable pal-dateTable' - // defaultSortField='invoiceId' - // paginationDefaultPage={currentPage} - // paginationComponent={CustomPagination} - data={props.data} - paginationServer={ - props.pagination && props.handlerPageChange ? true : false - } - onChangePage={props.pagination ? props.handlerPageChange : null} - paginationComponentOptions={{ - noRowsPerPage: props.handlerPageChange ? true : false - }} - selectableRows={props.selectableRows} - selectableRowsComponent={props.selectableRowsComponent} - onSelectedRowsChange={ - props.onSelectedRowsChange ? props.onSelectedRowsChange : null - } - /> +
+ } + className='react-dataTable pal-dateTable' + // defaultSortField='invoiceId' + // paginationDefaultPage={currentPage} + // paginationComponent={CustomPagination} + data={props.data} + paginationServer={ + props.pagination && props.handlerPageChange ? true : false + } + onChangePage={props.pagination ? props.handlerPageChange : null} + paginationComponentOptions={{ + noRowsPerPage: props.handlerPageChange ? true : false + }} + selectableRows={props.selectableRows} + selectableRowsComponent={props.selectableRowsComponent} + onSelectedRowsChange={ + props.onSelectedRowsChange ? props.onSelectedRowsChange : null + } + /> +
); }; diff --git a/src/components/crud/grid/selectableRowsComponent.js b/src/components/crud/grid/selectableRowsComponent.js index 3d0ba94..8a761b9 100644 --- a/src/components/crud/grid/selectableRowsComponent.js +++ b/src/components/crud/grid/selectableRowsComponent.js @@ -3,15 +3,15 @@ import React from 'react'; export const selectableRowsComponent = React.forwardRef( ({ onClick, ...rest }, ref) => { - console.log(rest); return ( - + <> + + ); } ); diff --git a/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js index e9febcb..56f285d 100644 --- a/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js +++ b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js @@ -174,29 +174,29 @@ const FlightPlanAprvContainer = () => { }; const handleChangeSelected = ({ selectedRows }) => { console.log(selectedRows); - setSelPlanSnoList(selectedRows.map(item => item.planSno)); + setSelPlanSnoList(selectedRows?.map(item => item.planSno)); }; - const handleChangeCheckbox = (e, row) => { - const { checked } = e.target; + // const handleChangeCheckbox = (e, row) => { + // const { checked } = e.target; - const dupli = selPlanSnoList?.find(prev => { - if (prev.planSno === row.planSno) { - return true; - } - }); - if (checked) { - if (!dupli) { - setSelPlanSnoList([...selPlanSnoList, row.planSno]); - } - } else { - const list = selPlanSnoList.filter(prev => { - if (prev !== row.planSno) { - return prev; - } - }); - setSelPlanSnoList(list); - } - }; + // const dupli = selPlanSnoList?.find(prev => { + // if (prev.planSno === row.planSno) { + // return true; + // } + // }); + // if (checked) { + // if (!dupli) { + // setSelPlanSnoList([...selPlanSnoList, row.planSno]); + // } + // } else { + // const list = selPlanSnoList.filter(prev => { + // if (prev !== row.planSno) { + // return prev; + // } + // }); + // setSelPlanSnoList(list); + // } + // }; const handleClickAprv = type => e => { // notAprov, aprv @@ -266,7 +266,7 @@ const FlightPlanAprvContainer = () => { handleChangeSelected={handleChangeSelected} selPlanSnoList={selPlanSnoList} setSelPlanSnoList={setSelPlanSnoList} - handleChangeCheckbox={handleChangeCheckbox} + // handleChangeCheckbox={handleChangeCheckbox} /> ) : ( From d8707546af514f25b6759661f0c5239c9753e7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hagjoon=28=EC=9D=B4=ED=95=99=EC=A4=80=29?= Date: Tue, 4 Oct 2022 11:24:57 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EA=B7=B8=EB=A3=B9=EA=B4=80=EB=A6=AC=20-=20?= =?UTF-8?q?=EC=BD=98=EC=86=94=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/containers/basis/group/BasisGroupContainer.js | 2 +- src/modules/basis/group/reducers/basisGroupReducer.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/containers/basis/group/BasisGroupContainer.js b/src/containers/basis/group/BasisGroupContainer.js index 717b9d9..bf84015 100644 --- a/src/containers/basis/group/BasisGroupContainer.js +++ b/src/containers/basis/group/BasisGroupContainer.js @@ -12,7 +12,7 @@ export const BasisGroupContainer = props => { const { myList, myListCount, mainList, mainListCount } = useSelector( state => state.groupState ); - console.log(mainList); + const { user } = useSelector(state => state.authState); const dispatch = useDispatch(); diff --git a/src/modules/basis/group/reducers/basisGroupReducer.ts b/src/modules/basis/group/reducers/basisGroupReducer.ts index 56edbde..8dfdbcb 100644 --- a/src/modules/basis/group/reducers/basisGroupReducer.ts +++ b/src/modules/basis/group/reducers/basisGroupReducer.ts @@ -33,7 +33,6 @@ export const groupReducer = createReducer( .handleAction(Actions.GROUP_MAIN_LIST.success, (state, action) => produce(state, draft => { const { data, count } = action.payload; - console.log(data); // const agreeList = data.filter(res => { // if (res.aprvlYn === 'Y') { // return res;