Browse Source

기초정보관리 그룹선택 데이터 분리작업

ctrlDraw
이준희 2 years ago
parent
commit
a3999eb9be
  1. 12
      src/containers/basis/dron/BasisDronContainer.js
  2. 29
      src/containers/basis/group/BasisGroupApprovalContainer.js
  3. 29
      src/containers/basis/group/BasisGroupUsersContainer.js
  4. 9
      src/modules/basis/group/actions/basisGroupAction.ts
  5. 7
      src/modules/basis/group/models/basisGroupModel.ts
  6. 12
      src/modules/basis/group/reducers/basisGroupReducer.ts

12
src/containers/basis/dron/BasisDronContainer.js

@ -173,12 +173,12 @@ export const BasisDronContainer = props => {
// return; // return;
// }; // };
useEffect(() => { // useEffect(() => {
handlerCancel(); // handlerCancel();
// if (selectData) { // // if (selectData) {
// handlerDronSearch(); // // handlerDronSearch();
// } // // }
}, []); // }, []);
useEffect(() => { useEffect(() => {
if (user?.cstmrSno) { if (user?.cstmrSno) {

29
src/containers/basis/group/BasisGroupApprovalContainer.js

@ -17,7 +17,8 @@ export const BasisGroupApprovalContainer = props => {
joinListCount, joinListCount,
groupList, groupList,
groupListCount, groupListCount,
selectData, // selectData,
aprvSelect,
total total
} = useSelector(state => state.groupState); } = useSelector(state => state.groupState);
@ -71,7 +72,8 @@ export const BasisGroupApprovalContainer = props => {
// width: '100px', // width: '100px',
sortable: true, sortable: true,
cell: row => { cell: row => {
return selectData?.groupId === row?.groupId ? ( // return selectData?.groupId === row?.groupId ? (
return aprvSelect?.groupId === row?.groupId ? (
<Button.Ripple <Button.Ripple
color='danger' color='danger'
className='badge badge-danger' className='badge badge-danger'
@ -107,7 +109,10 @@ export const BasisGroupApprovalContainer = props => {
(user.authId === 'USER' && groupAuthCd === 'MASTER') || (user.authId === 'USER' && groupAuthCd === 'MASTER') ||
(user.authId === 'USER' && aprvlYn === 'Y' && groupAuthCd === 'LEADER') (user.authId === 'USER' && aprvlYn === 'Y' && groupAuthCd === 'LEADER')
) { ) {
dispatch(Actions.SELECT({ groupId: groupId, groupNm: groupNm })); // dispatch(Actions.SELECT({ groupId: groupId, groupNm: groupNm }));
dispatch(
Actions.GROUP_APRV_SELECT({ groupId: groupId, groupNm: groupNm })
);
if (user?.cstmrSno) { if (user?.cstmrSno) {
setParams({ setParams({
@ -138,7 +143,8 @@ export const BasisGroupApprovalContainer = props => {
}; };
const handlerCancel = () => { const handlerCancel = () => {
dispatch(Actions.SELECT()); // dispatch(Actions.SELECT());
dispatch(Actions.GROUP_APRV_SELECT());
setParams({ setParams({
...params, ...params,
@ -152,7 +158,8 @@ export const BasisGroupApprovalContainer = props => {
setParams({ setParams({
...params, ...params,
cstmrSno: user?.cstmrSno, cstmrSno: user?.cstmrSno,
groupId: selectData?.groupId, // groupId: selectData?.groupId,
groupId: aprvSelect?.groupId,
aprvYn: '' aprvYn: ''
}); });
if (user.authId === 'SUPER' || user.authId === 'ADMIN') { if (user.authId === 'SUPER' || user.authId === 'ADMIN') {
@ -161,7 +168,8 @@ export const BasisGroupApprovalContainer = props => {
dispatch( dispatch(
Actions.JOIN_LIST.request({ Actions.JOIN_LIST.request({
cstmrSno: user?.cstmrSno, cstmrSno: user?.cstmrSno,
groupId: selectData?.groupId // groupId: selectData?.groupId
groupId: aprvSelect?.groupId
}) })
); );
} }
@ -307,9 +315,9 @@ export const BasisGroupApprovalContainer = props => {
} }
}; };
useEffect(() => { // useEffect(() => {
handlerCancel(); // handlerCancel();
}, []); // }, []);
const handlerSearch = () => { const handlerSearch = () => {
const param = params; const param = params;
@ -391,7 +399,8 @@ export const BasisGroupApprovalContainer = props => {
)} )}
</Col> </Col>
<Col sm='12' lg='12'> <Col sm='12' lg='12'>
{!selectData ? ( {/* {!selectData ? ( */}
{!aprvSelect ? (
<div className='mt-2 no-dataTable'> <div className='mt-2 no-dataTable'>
그룹 목록에서 상세보기를 클릭하세요. 그룹 목록에서 상세보기를 클릭하세요.
</div> </div>

29
src/containers/basis/group/BasisGroupUsersContainer.js

@ -16,9 +16,9 @@ export const BasisGroupUsersContainer = props => {
joinListCount, joinListCount,
groupList, groupList,
groupListCount, groupListCount,
selectData, // selectData,
userSelect,
userCount, userCount,
userList, userList,
count, count,
total total
@ -90,7 +90,8 @@ export const BasisGroupUsersContainer = props => {
name: '', name: '',
sortable: true, sortable: true,
cell: row => { cell: row => {
return selectData?.groupId === row?.groupId ? ( // return selectData?.groupId === row?.groupId ? (
return userSelect?.groupId === row?.groupId ? (
<Button.Ripple <Button.Ripple
color='danger' color='danger'
className='badge badge-danger' className='badge badge-danger'
@ -284,10 +285,10 @@ export const BasisGroupUsersContainer = props => {
} }
]; ];
useEffect(() => { // useEffect(() => {
// handlerSearch(); // // handlerSearch();
handlerCancel(); // handlerCancel();
}, []); // }, []);
const handlerSearch = () => { const handlerSearch = () => {
if (params.cstmrSno && user?.cstmrSno) { if (params.cstmrSno && user?.cstmrSno) {
@ -312,7 +313,8 @@ export const BasisGroupUsersContainer = props => {
dispatch( dispatch(
Actions.JOIN_LIST.request({ Actions.JOIN_LIST.request({
cstmrSno: user.cstmrSno, cstmrSno: user.cstmrSno,
groupId: selectData?.groupId // groupId: selectData?.groupId
groupId: userSelect?.groupId
}) })
); );
} }
@ -326,7 +328,8 @@ export const BasisGroupUsersContainer = props => {
const handlerDetail = (groupId, groupNm, groupAuthCd, aprvlYn) => { const handlerDetail = (groupId, groupNm, groupAuthCd, aprvlYn) => {
//권한 상관없이 조회 가능 //권한 상관없이 조회 가능
dispatch(Actions.SELECT({ groupId: groupId, groupNm, groupNm })); // dispatch(Actions.SELECT({ groupId: groupId, groupNm, groupNm }));
dispatch(Actions.GROUP_USER_SELECT({ groupId: groupId, groupNm, groupNm }));
const param = params; const param = params;
param.groupId = groupId; param.groupId = groupId;
param.memberNm = ''; param.memberNm = '';
@ -340,7 +343,8 @@ export const BasisGroupUsersContainer = props => {
}; };
const handlerCancel = () => { const handlerCancel = () => {
dispatch(Actions.SELECT()); // dispatch(Actions.SELECT());
dispatch(Actions.GROUP_USER_SELECT());
setParams({ setParams({
...params, ...params,
groupId: '', groupId: '',
@ -473,7 +477,7 @@ export const BasisGroupUsersContainer = props => {
</Col> </Col>
{/* <Col sm='12'> */} {/* <Col sm='12'> */}
<Col sm='12' lg='12'> <Col sm='12' lg='12'>
{selectData ? ( {userSelect ? (
<> <>
<BasisGroupUsersSearch <BasisGroupUsersSearch
handlerInput={handlerInput} handlerInput={handlerInput}
@ -498,7 +502,8 @@ export const BasisGroupUsersContainer = props => {
</Col> </Col>
{/* <Col sm='12'> */} {/* <Col sm='12'> */}
<Col sm='12' lg='12'> <Col sm='12' lg='12'>
{selectData ? ( {/* {selectData ? ( */}
{userSelect ? (
<BasisGroupUsersGrid <BasisGroupUsersGrid
data={userList} data={userList}
title={'사용자'} title={'사용자'}

9
src/modules/basis/group/actions/basisGroupAction.ts

@ -104,6 +104,8 @@ const GROUP_MAIN_LIST_FAILURE = 'basis/group/GROUP_MAIN_LIST_FAILURE';
//그룹 선택 //그룹 선택
const SELECT_GROUP = 'basis/group/SELECT_GROUP'; const SELECT_GROUP = 'basis/group/SELECT_GROUP';
const APRV_GROUP_SELECT = 'basis/group/APRV_GROUP_SELECT';
const USER_GROUP_SELECT = 'basis/group/USER_GROUP_SELECT';
export const MY_LIST = createAsyncAction( export const MY_LIST = createAsyncAction(
MY_LIST_REQUEST, MY_LIST_REQUEST,
@ -221,6 +223,8 @@ export const USER_DELEGATE = createAsyncAction(
)<UserGroupState, string, AxiosError>(); )<UserGroupState, string, AxiosError>();
export const SELECT = createAction(SELECT_GROUP)<SelectData>(); export const SELECT = createAction(SELECT_GROUP)<SelectData>();
export const GROUP_APRV_SELECT = createAction(APRV_GROUP_SELECT)<SelectData>();
export const GROUP_USER_SELECT = createAction(USER_GROUP_SELECT)<SelectData>();
const actions = { const actions = {
MY_LIST, MY_LIST,
@ -241,7 +245,10 @@ const actions = {
USER_DELEGATE, USER_DELEGATE,
GROUP_MYLIST, GROUP_MYLIST,
GROUP_MAIN_LIST, GROUP_MAIN_LIST,
SELECT
SELECT,
GROUP_APRV_SELECT,
GROUP_USER_SELECT
}; };
export type GroupAction = ActionType<typeof actions>; export type GroupAction = ActionType<typeof actions>;

7
src/modules/basis/group/models/basisGroupModel.ts

@ -8,7 +8,6 @@ export interface GroupState {
groupList: GroupData[] | undefined; groupList: GroupData[] | undefined;
aprvList: AprvGroupData[] | undefined; aprvList: AprvGroupData[] | undefined;
userList: UserGroupData[] | undefined; userList: UserGroupData[] | undefined;
selectData: SelectData | undefined;
groupId: string | ''; groupId: string | '';
newGroupId: String | ''; newGroupId: String | '';
searchParams: string | ''; searchParams: string | '';
@ -23,6 +22,10 @@ export interface GroupState {
groupListCount: number | 0; groupListCount: number | 0;
aprvCount: number | 0; aprvCount: number | 0;
userCount: number | 0; userCount: number | 0;
selectData: SelectData | undefined;
aprvSelect: SelectData | undefined;
userSelect: SelectData | undefined;
} }
export interface GroupSearchData { export interface GroupSearchData {
@ -123,6 +126,8 @@ export const initGroup = {
searchParams: '', searchParams: '',
error: undefined, error: undefined,
selectData: undefined, selectData: undefined,
aprvSelect: undefined,
userSelect: undefined,
page: 1, page: 1,
total: 0, total: 0,
count: 0 count: 0

12
src/modules/basis/group/reducers/basisGroupReducer.ts

@ -106,4 +106,16 @@ export const groupReducer = createReducer<GroupState, Actions.GroupAction>(
const selectData = action.payload; const selectData = action.payload;
draft.selectData = selectData; draft.selectData = selectData;
}) })
)
.handleAction(Actions.GROUP_APRV_SELECT, (state, action) =>
produce(state, draft => {
const selectData = action.payload;
draft.aprvSelect = selectData;
})
)
.handleAction(Actions.GROUP_USER_SELECT, (state, action) =>
produce(state, draft => {
const selectData = action.payload;
draft.userSelect = selectData;
})
); );

Loading…
Cancel
Save