Browse Source

대시보드(드론 별 비행운항 목록) 페이징 처리

pull/2/head
김장현 10 months ago
parent
commit
fe08d04daf
  1. 5
      src/components/crud/grid/GridDatatable.js
  2. 14
      src/components/dashboard/DroneFlightSchedule.js

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}

14
src/components/dashboard/DroneFlightSchedule.js

@ -120,7 +120,9 @@ export default function DroneFlightSchedule({
const { dronOperationList } = useSelector(state => state.mainDashState); const { dronOperationList } = useSelector(state => state.mainDashState);
return ( return (
<div className='invoice-list-wrapper'>
<Card> <Card>
<div className='invoice-list-dataTable'>
<CardHeader className=''> <CardHeader className=''>
<div className='w-100 d-flex justify-content-between'> <div className='w-100 d-flex justify-content-between'>
<CardTitle tag='h4'>드론 비행운항 목록</CardTitle> <CardTitle tag='h4'>드론 비행운항 목록</CardTitle>
@ -146,7 +148,9 @@ export default function DroneFlightSchedule({
))} ))}
<button <button
onClick={() => handlerMovePage('/basis/flight/schedule/index')} onClick={() =>
handlerMovePage('/basis/flight/schedule/index')
}
style={{ marginLeft: '8px' }} style={{ marginLeft: '8px' }}
> >
<Plus /> <Plus />
@ -157,10 +161,16 @@ export default function DroneFlightSchedule({
<CardBody> <CardBody>
<GridDatabase <GridDatabase
data={dronOperationList || []} data={dronOperationList || []}
count={dronOperationList?.length || 0} paginationPerPage={8}
paginationRowsPerPageOptions={[]}
rowsPerPageText={'noText'}
total={dronOperationList?.length || 0}
columns={columns} columns={columns}
pagination
/> />
</CardBody> </CardBody>
</div>
</Card> </Card>
</div>
); );
} }

Loading…
Cancel
Save