diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index dfeda6fe..0b197e0e 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -87,9 +87,9 @@ export const AnalysisHistoryContainer = props => { }); }, [searchData.groupId]); - useEffect(() => { - handlerGroupCancel(); - }, []); + // useEffect(() => { + // handlerGroupCancel(); + // }, []); const onKeyPress = e => { if (e.key == 'Enter') { 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/flight/aprv/FlightPlanAprvContainer.js b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js index 398450cc..368f4068 100644 --- a/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js +++ b/src/containers/basis/flight/aprv/FlightPlanAprvContainer.js @@ -33,7 +33,8 @@ const FlightPlanAprvContainer = () => { const { list: aprvList, aprvProc, - selectGroup, + // selectGroup, + aprvSelect, total } = useSelector(state => state.flightState); const { joinList, joinListCount, groupList, groupListCount } = useSelector( @@ -91,7 +92,8 @@ const FlightPlanAprvContainer = () => { name: '', sortable: true, cell: row => { - return selectGroup?.groupId === row?.groupId ? ( + // return selectGroup?.groupId === row?.groupId ? ( + return aprvSelect?.groupId === row?.groupId ? ( { param.groupId = groupId; dispatch( - FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + // FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + // cstmrSno: user.cstmrSno, + // groupId: groupId, + // groupNm: groupNm + // }) + FlightAction.FLIGHT_PLAN_APRV_GROUP_SELECT({ cstmrSno: user.cstmrSno, groupId: groupId, groupNm: groupNm @@ -168,7 +175,8 @@ const FlightPlanAprvContainer = () => { const handlerGroupCancel = () => { dispatch( - FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + // FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + FlightAction.FLIGHT_PLAN_APRV_GROUP_SELECT({ cstmrSno: 0, groupId: '', groupNm: '' @@ -177,10 +185,17 @@ const FlightPlanAprvContainer = () => { }; // 최초 비행계획서 목록 조회 + // useEffect(() => { + // handlerGroupCancel(); + // // handleSearch(searchData); + // }, []); + useEffect(() => { - handlerGroupCancel(); - // handleSearch(searchData); - }, []); + if (searchData?.groupId) { + handleSearch(searchData); + } + }, [searchData]); + useEffect(() => { if (user?.cstmrSno) { if (user.authId === 'SUPER' || user.authId === 'ADMIN') { @@ -194,6 +209,7 @@ const FlightPlanAprvContainer = () => { } } }, [user]); + useEffect(() => { if (aprvProc && aprvProc.result > 0) { handleSearch(searchData); @@ -284,7 +300,8 @@ const FlightPlanAprvContainer = () => { {/* */} - {selectGroup.cstmrSno !== 0 ? ( + {/* {selectGroup.cstmrSno !== 0 ? ( */} + {aprvSelect.cstmrSno !== 0 ? ( <> { {...(user?.authId === 'SUPER' || user?.authId === 'ADMIN' ? { joinList: groupList } : { joinList: joinList })} - selectGroup={selectGroup} + // selectGroup={selectGroup} + selectGroup={aprvSelect} handleChangeSelected={handleChangeSelected} selPlanSnoList={selPlanSnoList} setSelPlanSnoList={setSelPlanSnoList} diff --git a/src/containers/basis/flight/plan/FlightPlanContainer.js b/src/containers/basis/flight/plan/FlightPlanContainer.js index 266b4732..c1c6a5bb 100644 --- a/src/containers/basis/flight/plan/FlightPlanContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanContainer.js @@ -32,7 +32,8 @@ const FlightPlanContainer = () => { const { list: planListData, detail: planDetailData, - selectGroup, + listSelect, + // selectGroup, areaCoordList, total } = useSelector(state => state.flightState); @@ -79,7 +80,8 @@ const FlightPlanContainer = () => { param.groupId = groupId; dispatch( - FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + // FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + FlightAction.FLIGHT_PLAN_LIST_GROUP_SELECT({ cstmrSno: user.cstmrSno, groupId: groupId, groupNm: groupNm @@ -118,7 +120,8 @@ const FlightPlanContainer = () => { const handlerGroupCancel = () => { dispatch( - FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + // FlightAction.FLIGHT_PLAN_GROUP_SELECT({ + FlightAction.FLIGHT_PLAN_LIST_GROUP_SELECT({ cstmrSno: 0, groupId: '', groupNm: '' @@ -126,6 +129,16 @@ const FlightPlanContainer = () => { ); }; + // useEffect(() => { + // handlerGroupCancel(); + // }, []); + + useEffect(() => { + if (searchData?.groupId) { + handleSearch(searchData); + } + }, [searchData]); + useEffect(() => { if (user?.cstmrSno) { if (user.authId === 'SUPER' || user.authId === 'ADMIN') { @@ -140,9 +153,6 @@ const FlightPlanContainer = () => { } }, [user]); - useEffect(() => { - handlerGroupCancel(); - }, []); const onChangePage = page => { dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...searchData, page })); }; @@ -160,7 +170,8 @@ const FlightPlanContainer = () => { {...(user?.authId === 'SUPER' || user?.authId === 'ADMIN' ? { count: groupListCount } : { count: joinListCount })} - selectGroup={selectGroup} + // selectGroup={selectGroup} + selectGroup={listSelect} handleGroupSelect={handleGroupSelect} handlerGroupCancel={handlerGroupCancel} pagination={true} @@ -172,7 +183,8 @@ const FlightPlanContainer = () => { )} - {selectGroup.cstmrSno !== 0 ? ( + {/* {selectGroup.cstmrSno !== 0 ? ( */} + {listSelect.cstmrSno !== 0 ? ( <> { 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 FLIGHT_PLAN_LIST_GROUP_SELECT = + createAction(LIST_GROUP_SELECT)(); + +// 비행 계획서 그룹 선택(승인) +export const FLIGHT_PLAN_APRV_GROUP_SELECT = + createAction(APRV_GROUP_SELECT)(); + // 비행 구역 상세 값 초기화 export const AREA_DETAIL_INIT = createAction(AREA_DETAIL_INITIAL)(); @@ -285,6 +297,8 @@ const actions = { AREA_COORDINATE_LIST_SAVE, AREA_DETAIL_LIST_SAVE, FLIGHT_PLAN_GROUP_SELECT, + FLIGHT_PLAN_APRV_GROUP_SELECT, + FLIGHT_PLAN_LIST_GROUP_SELECT, FLIGHT_PLAN_AREA_BUFFER_LIST, AREA_DETAIL_INIT, FLIGHT_APRV_LIST, diff --git a/src/modules/basis/flight/models/basisFlightModel.ts b/src/modules/basis/flight/models/basisFlightModel.ts index 6542442f..400555ee 100644 --- a/src/modules/basis/flight/models/basisFlightModel.ts +++ b/src/modules/basis/flight/models/basisFlightModel.ts @@ -11,7 +11,6 @@ export interface FlightState { arcrftSelect: FlightPlanArcrftData | undefined; areaCoordList: FlightPlanAreaData[] | undefined; areaList: FlightPlanAreaData[] | undefined; - selectGroup: SelectGroupData | undefined; aprvList: [FlightPlanData] | undefined; aprvProc: any | undefined; scheduleList: BasFlightScheduleList[] | []; @@ -19,6 +18,9 @@ export interface FlightState { total: number | 0; conut: number | 0; weather: resweatherData | undefined; + selectGroup: SelectGroupData | undefined; + listSelect: SelectGroupData | undefined; + aprvSelect: SelectGroupData | undefined; } export interface weatherData { serviceKey: string; @@ -242,6 +244,16 @@ export const initFlight = { groupId: '', groupNm: '' }, + listSelect: { + cstmrSno: 0, + groupId: '', + groupNm: '' + }, + aprvSelect: { + cstmrSno: 0, + groupId: '', + groupNm: '' + }, publicAreaList: undefined, flightPlanArea: undefined, list: undefined, diff --git a/src/modules/basis/flight/reducers/basisFlightReducer.ts b/src/modules/basis/flight/reducers/basisFlightReducer.ts index 43493ebc..3f5a3a02 100644 --- a/src/modules/basis/flight/reducers/basisFlightReducer.ts +++ b/src/modules/basis/flight/reducers/basisFlightReducer.ts @@ -105,6 +105,21 @@ export const flightReducer = createReducer( draft.selectGroup = data; }) ) + // 비행 계획서 그룹 선택(목록) + .handleAction(Actions.FLIGHT_PLAN_LIST_GROUP_SELECT, (state, action) => + produce(state, draft => { + const data = action.payload; + draft.listSelect = data; + }) + ) + // 비행 계획서 그룹 선택(목록) + .handleAction(Actions.FLIGHT_PLAN_APRV_GROUP_SELECT, (state, action) => + produce(state, draft => { + const data = action.payload; + draft.aprvSelect = data; + }) + ) + // 비행 계획서 버퍼 영역 조회 .handleAction(Actions.FLIGHT_PLAN_AREA_BUFFER_LIST.success, (state, action) => produce(state, draft => { diff --git a/src/modules/basis/group/actions/basisGroupAction.ts b/src/modules/basis/group/actions/basisGroupAction.ts index 29d8165e..a896a9d9 100644 --- a/src/modules/basis/group/actions/basisGroupAction.ts +++ b/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 APRV_GROUP_SELECT = 'basis/group/APRV_GROUP_SELECT'; +const USER_GROUP_SELECT = 'basis/group/USER_GROUP_SELECT'; export const MY_LIST = createAsyncAction( MY_LIST_REQUEST, @@ -221,6 +223,8 @@ export const USER_DELEGATE = createAsyncAction( )(); 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; + }) );