Browse Source

권한정리 - 비행계획목록

pull/2/head
junh_eee(이준희) 2 years ago
parent
commit
576cc97878
  1. 29
      src/components/basis/flight/plan/FlightPlanGrid.js
  2. 4
      src/components/basis/flight/plan/FlightPlanGroupGrid.js
  3. 15
      src/containers/basis/flight/plan/FlightPlanContainer.js

29
src/components/basis/flight/plan/FlightPlanGrid.js

@ -46,26 +46,20 @@ const FlightPlanGrid = ({
id: 'moveDetail', id: 'moveDetail',
name: '상세보기', name: '상세보기',
cell: row => { cell: row => {
let mine = false; // let mine = false;
if (user.authId === 'SUPER') { // if (user.authId === 'SUPER') {
mine = true; // mine = true;
} else if (user.authId === 'ADMIN' || user.authId === 'USER') { // } else if (user.authId === 'ADMIN' || user.authId === 'USER') {
if (row.createUserId === user.userId) { // if (row.createUserId === user.userId) {
mine = true; // mine = true;
} // }
} // }
return ( return (
<> <>
{mine ? ( <Link to={`/basis/flight/plan/detail/${row.planSno}`} size='sm'>
<> 상세보기
<Link to={`/basis/flight/plan/detail/${row.planSno}`} size='sm'> </Link>
상세보기
</Link>
</>
) : (
<>-</>
)}
</> </>
); );
} }
@ -116,7 +110,6 @@ const FlightPlanGrid = ({
paginationRowsPerPageOptions={paginationRowsPerPageOptions} paginationRowsPerPageOptions={paginationRowsPerPageOptions}
handlerPageChange={handlerPageChange} handlerPageChange={handlerPageChange}
total={total} total={total}
// pagination={props.pagination}
/> />
{/* 검색된 데이터가 없습니다. */} {/* 검색된 데이터가 없습니다. */}
</div> </div>

4
src/components/basis/flight/plan/FlightPlanGroupGrid.js

@ -47,6 +47,7 @@ const FlightPlanGroupGrid = ({
{ {
sortable: true, sortable: true,
cell: row => { cell: row => {
// console.log(row);
return selectGroup?.groupId === row?.groupId ? ( return selectGroup?.groupId === row?.groupId ? (
<Button.Ripple <Button.Ripple
color='danger' color='danger'
@ -63,7 +64,8 @@ const FlightPlanGroupGrid = ({
handleGroupSelect({ handleGroupSelect({
groupId: row?.groupId, groupId: row?.groupId,
groupNm: row?.groupNm, groupNm: row?.groupNm,
groupAuthCd: row?.groupAuthCd groupAuthCd: row?.groupAuthCd,
myGroupAuthCd: row?.myGroupAuthCd
}); });
}} }}
> >

15
src/containers/basis/flight/plan/FlightPlanContainer.js

@ -42,6 +42,7 @@ const FlightPlanContainer = () => {
const { user } = useSelector(state => state.authState, shallowEqual); const { user } = useSelector(state => state.authState, shallowEqual);
const [params, setParams] = useState({}); const [params, setParams] = useState({});
//비행계획서 신청 버튼 활성/비활성 제어
const [isMyGroup, setIsMyGroup] = useState(); const [isMyGroup, setIsMyGroup] = useState();
const moveFlightPlanDetailPage = () => { const moveFlightPlanDetailPage = () => {
@ -65,7 +66,12 @@ const FlightPlanContainer = () => {
})); }));
}; };
const handleGroupSelect = ({ groupId, groupNm, groupAuthCd }) => { const handleGroupSelect = ({
groupId,
groupNm,
groupAuthCd,
myGroupAuthCd
}) => {
// 권한 상관 없이 모두 조회 가능 // 권한 상관 없이 모두 조회 가능
const param = searchData; const param = searchData;
@ -94,10 +100,15 @@ const FlightPlanContainer = () => {
dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...param, page: 1 })); dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...param, page: 1 }));
//비행계획서 신청 버튼 활성/비활성 제어
let my = false; let my = false;
if (user.authId === 'SUPER') { if (user.authId === 'SUPER') {
my = true; my = true;
} else if (user.authId === 'ADMIN' || user.authId === 'USER') { } else if (user.authId === 'ADMIN') {
if (myGroupAuthCd) {
my = true;
}
} else if (user.authId === 'USER') {
if (groupAuthCd) { if (groupAuthCd) {
my = true; my = true;
} }

Loading…
Cancel
Save