From a3999eb9be262bb7299aff012dd91e3b6a3cb96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Tue, 8 Nov 2022 11:27:56 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=B4=88=EC=A0=95=EB=B3=B4=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EA=B7=B8=EB=A3=B9=EC=84=A0=ED=83=9D=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EB=B6=84=EB=A6=AC=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/dron/BasisDronContainer.js | 12 ++++---- .../group/BasisGroupApprovalContainer.js | 29 ++++++++++++------- .../basis/group/BasisGroupUsersContainer.js | 29 +++++++++++-------- .../basis/group/actions/basisGroupAction.ts | 9 +++++- .../basis/group/models/basisGroupModel.ts | 7 ++++- .../basis/group/reducers/basisGroupReducer.ts | 12 ++++++++ 6 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/containers/basis/dron/BasisDronContainer.js b/src/containers/basis/dron/BasisDronContainer.js index 1d88e925..c7c34cc4 100644 --- a/src/containers/basis/dron/BasisDronContainer.js +++ b/src/containers/basis/dron/BasisDronContainer.js @@ -173,12 +173,12 @@ export const BasisDronContainer = props => { // return; // }; - useEffect(() => { - handlerCancel(); - // if (selectData) { - // handlerDronSearch(); - // } - }, []); + // useEffect(() => { + // handlerCancel(); + // // if (selectData) { + // // handlerDronSearch(); + // // } + // }, []); useEffect(() => { if (user?.cstmrSno) { diff --git a/src/containers/basis/group/BasisGroupApprovalContainer.js b/src/containers/basis/group/BasisGroupApprovalContainer.js index 16c2ac75..ce3962a8 100644 --- a/src/containers/basis/group/BasisGroupApprovalContainer.js +++ b/src/containers/basis/group/BasisGroupApprovalContainer.js @@ -17,7 +17,8 @@ export const BasisGroupApprovalContainer = props => { joinListCount, groupList, groupListCount, - selectData, + // selectData, + aprvSelect, total } = useSelector(state => state.groupState); @@ -71,7 +72,8 @@ export const BasisGroupApprovalContainer = props => { // width: '100px', sortable: true, cell: row => { - return selectData?.groupId === row?.groupId ? ( + // return selectData?.groupId === row?.groupId ? ( + return aprvSelect?.groupId === row?.groupId ? ( { (user.authId === 'USER' && groupAuthCd === 'MASTER') || (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) { setParams({ @@ -138,7 +143,8 @@ export const BasisGroupApprovalContainer = props => { }; const handlerCancel = () => { - dispatch(Actions.SELECT()); + // dispatch(Actions.SELECT()); + dispatch(Actions.GROUP_APRV_SELECT()); setParams({ ...params, @@ -152,7 +158,8 @@ export const BasisGroupApprovalContainer = props => { setParams({ ...params, cstmrSno: user?.cstmrSno, - groupId: selectData?.groupId, + // groupId: selectData?.groupId, + groupId: aprvSelect?.groupId, aprvYn: '' }); if (user.authId === 'SUPER' || user.authId === 'ADMIN') { @@ -161,7 +168,8 @@ export const BasisGroupApprovalContainer = props => { dispatch( Actions.JOIN_LIST.request({ cstmrSno: user?.cstmrSno, - groupId: selectData?.groupId + // groupId: selectData?.groupId + groupId: aprvSelect?.groupId }) ); } @@ -307,9 +315,9 @@ export const BasisGroupApprovalContainer = props => { } }; - useEffect(() => { - handlerCancel(); - }, []); + // useEffect(() => { + // handlerCancel(); + // }, []); const handlerSearch = () => { const param = params; @@ -391,7 +399,8 @@ export const BasisGroupApprovalContainer = props => { )} - {!selectData ? ( + {/* {!selectData ? ( */} + {!aprvSelect ? (
그룹 목록에서 상세보기를 클릭하세요.
diff --git a/src/containers/basis/group/BasisGroupUsersContainer.js b/src/containers/basis/group/BasisGroupUsersContainer.js index 3bf26c19..384a07fa 100644 --- a/src/containers/basis/group/BasisGroupUsersContainer.js +++ b/src/containers/basis/group/BasisGroupUsersContainer.js @@ -16,9 +16,9 @@ export const BasisGroupUsersContainer = props => { joinListCount, groupList, groupListCount, - selectData, + // selectData, + userSelect, userCount, - userList, count, total @@ -90,7 +90,8 @@ export const BasisGroupUsersContainer = props => { name: '', sortable: true, cell: row => { - return selectData?.groupId === row?.groupId ? ( + // return selectData?.groupId === row?.groupId ? ( + return userSelect?.groupId === row?.groupId ? ( { } ]; - useEffect(() => { - // handlerSearch(); - handlerCancel(); - }, []); + // useEffect(() => { + // // handlerSearch(); + // handlerCancel(); + // }, []); const handlerSearch = () => { if (params.cstmrSno && user?.cstmrSno) { @@ -312,7 +313,8 @@ export const BasisGroupUsersContainer = props => { dispatch( Actions.JOIN_LIST.request({ 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) => { //권한 상관없이 조회 가능 - 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; param.groupId = groupId; param.memberNm = ''; @@ -340,7 +343,8 @@ export const BasisGroupUsersContainer = props => { }; const handlerCancel = () => { - dispatch(Actions.SELECT()); + // dispatch(Actions.SELECT()); + dispatch(Actions.GROUP_USER_SELECT()); setParams({ ...params, groupId: '', @@ -473,7 +477,7 @@ export const BasisGroupUsersContainer = props => { {/* */} - {selectData ? ( + {userSelect ? ( <> { {/* */} - {selectData ? ( + {/* {selectData ? ( */} + {userSelect ? ( (); export const SELECT = createAction(SELECT_GROUP)(); +export const GROUP_APRV_SELECT = createAction(APRV_GROUP_SELECT)(); +export const GROUP_USER_SELECT = createAction(USER_GROUP_SELECT)(); const actions = { MY_LIST, @@ -241,7 +245,10 @@ const actions = { USER_DELEGATE, GROUP_MYLIST, GROUP_MAIN_LIST, - SELECT + + SELECT, + GROUP_APRV_SELECT, + GROUP_USER_SELECT }; export type GroupAction = ActionType; diff --git a/src/modules/basis/group/models/basisGroupModel.ts b/src/modules/basis/group/models/basisGroupModel.ts index d4483c30..a7c92854 100644 --- a/src/modules/basis/group/models/basisGroupModel.ts +++ b/src/modules/basis/group/models/basisGroupModel.ts @@ -8,7 +8,6 @@ export interface GroupState { groupList: GroupData[] | undefined; aprvList: AprvGroupData[] | undefined; userList: UserGroupData[] | undefined; - selectData: SelectData | undefined; groupId: string | ''; newGroupId: String | ''; searchParams: string | ''; @@ -23,6 +22,10 @@ export interface GroupState { groupListCount: number | 0; aprvCount: number | 0; userCount: number | 0; + + selectData: SelectData | undefined; + aprvSelect: SelectData | undefined; + userSelect: SelectData | undefined; } export interface GroupSearchData { @@ -123,6 +126,8 @@ export const initGroup = { searchParams: '', error: undefined, selectData: undefined, + aprvSelect: undefined, + userSelect: undefined, page: 1, total: 0, count: 0 diff --git a/src/modules/basis/group/reducers/basisGroupReducer.ts b/src/modules/basis/group/reducers/basisGroupReducer.ts index dff516dc..aaec57e3 100644 --- a/src/modules/basis/group/reducers/basisGroupReducer.ts +++ b/src/modules/basis/group/reducers/basisGroupReducer.ts @@ -106,4 +106,16 @@ export const groupReducer = createReducer( const selectData = action.payload; 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; + }) );