Browse Source

권한정리 - 비행계획목록

pull/2/head
junh_eee(이준희) 2 years ago
parent
commit
576cc97878
  1. 23
      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

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

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

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

@ -47,6 +47,7 @@ const FlightPlanGroupGrid = ({
{
sortable: true,
cell: row => {
// console.log(row);
return selectGroup?.groupId === row?.groupId ? (
<Button.Ripple
color='danger'
@ -63,7 +64,8 @@ const FlightPlanGroupGrid = ({
handleGroupSelect({
groupId: row?.groupId,
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 [params, setParams] = useState({});
//비행계획서 신청 버튼 활성/비활성 제어
const [isMyGroup, setIsMyGroup] = useState();
const moveFlightPlanDetailPage = () => {
@ -65,7 +66,12 @@ const FlightPlanContainer = () => {
}));
};
const handleGroupSelect = ({ groupId, groupNm, groupAuthCd }) => {
const handleGroupSelect = ({
groupId,
groupNm,
groupAuthCd,
myGroupAuthCd
}) => {
// 권한 상관 없이 모두 조회 가능
const param = searchData;
@ -94,10 +100,15 @@ const FlightPlanContainer = () => {
dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...param, page: 1 }));
//비행계획서 신청 버튼 활성/비활성 제어
let my = false;
if (user.authId === 'SUPER') {
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) {
my = true;
}

Loading…
Cancel
Save