Browse Source

대시보드 super 관리자 권한 분기 처리

pull/2/head
김장현 10 months ago
parent
commit
d84b9a1ba5
  1. 1
      src/components/crud/grid/GridDatatable.js
  2. 39
      src/components/dashboard/DroneFlightSchedule.js
  3. 4
      src/containers/main/dash/MainDashContainer.js

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

@ -10,7 +10,6 @@ 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
src/components/dashboard/DroneFlightSchedule.js

@ -127,25 +127,24 @@ export default function DroneFlightSchedule({
<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>
<div className='d-flex align-items-center'> <div className='d-flex align-items-center'>
{user?.cptAuthCode === 'KAC' || {(user?.cptAuthCode === 'KAC' || user?.authId === 'SUPER') && (
(user?.authId === 'SUPER' && ( <Input
<Input id='groupSelect'
id='groupSelect' type='select'
type='select' size='sm'
size='sm' style={{ minWidth: '120px' }}
style={{ minWidth: '120px' }} s
s onChange={e => {
onChange={e => { const { value } = e.target;
const { value } = e.target; handlerDronOperationChange(value);
handlerDronOperationChange(value); }}
}} >
> <option value='all'>그룹선택</option>
<option value='all'>그룹선택</option> {competentAgency?.map(i => (
{competentAgency?.map(i => ( <option value={i.value}>{i.text}</option>
<option value={i.value}>{i.text}</option> ))}
))} </Input>
</Input> )}
))}
<button <button
onClick={() => onClick={() =>
@ -164,7 +163,7 @@ export default function DroneFlightSchedule({
paginationPerPage={8} paginationPerPage={8}
paginationRowsPerPageOptions={[]} paginationRowsPerPageOptions={[]}
rowsPerPageText={'noText'} rowsPerPageText={'noText'}
total={dronOperationList?.length || 0} count={dronOperationList?.length || 0}
columns={columns} columns={columns}
pagination pagination
/> />

4
src/containers/main/dash/MainDashContainer.js

@ -42,7 +42,9 @@ export const MainDashContainer = () => {
}, []); }, []);
useEffect(() => { useEffect(() => {
handlerDronOperationList(user.cptAuthCode); handlerDronOperationList(
user?.authId === 'SUPER' ? 'all' : user.cptAuthCode
);
}, [user]); }, [user]);
// 일 별 비행횟수 통계 날짜 리스트 dispatch // 일 별 비행횟수 통계 날짜 리스트 dispatch

Loading…
Cancel
Save