feat: 관리자 - 환경설정 - 위원회 코드관리 삭제 시, 삭제 여부 확인 후 삭제하도록 수정
parent
c0504044ad
commit
0ea10e7313
|
|
@ -8,6 +8,8 @@ import CommitteeCodeRegistrationPopup from './CommitteeCodeMgt/CommitteeCodeRegi
|
|||
import ListCreateUpdateDelete from '../../../components/list/ListCreateUpdateDelete'
|
||||
import ListLabelInputs from '../../../components/list/ListLabelInputs'
|
||||
|
||||
import AlertDialogSlide from "../../../components/alert/AlertDialogSlide";
|
||||
|
||||
import URL from 'constants/url';
|
||||
|
||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||
|
|
@ -25,6 +27,9 @@ function CommitteeCodeMgt(props) {
|
|||
|
||||
const [summaryArray, setSummaryArray] = useState({});
|
||||
const [depthSelectedIndex, setDepthSelectedIndex] = useState([]);
|
||||
|
||||
const [confirm, setConfirm] = React.useState();
|
||||
|
||||
|
||||
// 위원회 코드 등록 팝업을 보이거나 닫는다.
|
||||
const [isCommitteeCodeRegistrationPopupOpen, setIsCommitteeCodeRegistrationPopupOpen] = React.useState(false);
|
||||
|
|
@ -161,51 +166,49 @@ function CommitteeCodeMgt(props) {
|
|||
'Content-type': 'application/json',
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EgovNet.requestFetch(`/admin/config/committee-code-management/${deleteItem.orgId}`,
|
||||
requestOptions,
|
||||
function (resp) {
|
||||
//방금 삭제한 것만 새로 읽어 드린다.
|
||||
let forChangeObject = {...searchCondition, paramCodeGroup, paramCodeLevel};
|
||||
setSearchCondition(forChangeObject);
|
||||
const requestTask = () => {
|
||||
EgovNet.requestFetch(`/admin/config/committee-code-management/${deleteItem.orgId}`,
|
||||
requestOptions,
|
||||
function (resp) {
|
||||
let forChangeObject = {...searchCondition, paramCodeGroup, paramCodeLevel};
|
||||
setSearchCondition(forChangeObject);
|
||||
|
||||
//현재 선택된 아이템을 삭제한 경우 그 하위 목록을 모두 비운다.
|
||||
//현재 선택된 아이템을 삭제한 경우 그 하위 목록을 모두 비운다.
|
||||
if( Number(depthSelectedIndex[depthSelectedArrayIndex]) === Number(deleteItem.orgId) ) {
|
||||
|
||||
for( let i = depthSelectedArrayIndex + 1; i<4; i++ ) {
|
||||
//setSearchCondition({...searchCondition, paramCodeLevel : createCondition.paramCodeLevel});
|
||||
depthSelectedIndex[i] = undefined;
|
||||
}
|
||||
let forChangeObject = [...depthSelectedIndex];
|
||||
setDepthSelectedIndex(forChangeObject);
|
||||
|
||||
// eslint-disable-next-line default-case
|
||||
switch(depthSelectedArrayIndex) {
|
||||
case 0:
|
||||
setDepth02List({});
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 1:
|
||||
setDepth03List({});
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 2:
|
||||
setDepth04List({});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//현재 선택된 아이템을 삭제 했는지 체크한다
|
||||
// 여기에 현재 선택된 아이템을 삭제 했는지 체크하는 로직을 추가해주세요.
|
||||
if( Number(depthSelectedIndex[depthSelectedArrayIndex]) === Number(deleteItem.orgId) ) {
|
||||
// 맞다면
|
||||
//그 하위 목록을 비운다.
|
||||
|
||||
for( let i = depthSelectedArrayIndex + 1; i<4; i++ ) {
|
||||
//setSearchCondition({...searchCondition, paramCodeLevel : createCondition.paramCodeLevel});
|
||||
depthSelectedIndex[i] = undefined;
|
||||
}
|
||||
let forChangeObject = [...depthSelectedIndex];
|
||||
setDepthSelectedIndex(forChangeObject);
|
||||
|
||||
// eslint-disable-next-line default-case
|
||||
switch(depthSelectedArrayIndex) {
|
||||
case 0:
|
||||
setDepth02List({});
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 1:
|
||||
setDepth03List({});
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 2:
|
||||
setDepth04List({});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
alert('삭제 되었습니다.');
|
||||
}
|
||||
|
||||
|
||||
alert('삭제 되었습니다.');
|
||||
}
|
||||
);
|
||||
);
|
||||
};
|
||||
setConfirm({...confirm, open: true, body: "삭제하시겠습니까?", yesCallback: requestTask});
|
||||
}
|
||||
|
||||
const Location = React.memo(function Location() {
|
||||
|
|
@ -344,6 +347,8 @@ function CommitteeCodeMgt(props) {
|
|||
searchCondition={searchCondition}
|
||||
setSearchCondition={setSearchCondition}
|
||||
/>
|
||||
|
||||
<AlertDialogSlide confirm={confirm} setConfirm={setConfirm} />
|
||||
{/* <!--// 본문 --> */}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,11 @@ function CommitteeCodeRegistrationPopup(props) {
|
|||
requestOptions,
|
||||
function (resp) {
|
||||
//방금 추가한 것만 새로 읽어 드린다.
|
||||
props.setSearchCondition({...props.searchCondition, paramCodeLevel : props.createCondition.paramCodeLevel});
|
||||
let paramCodeGroup = props.createCondition.paramOrgId;
|
||||
if( paramCodeGroup === "00" ) {
|
||||
paramCodeGroup = null;
|
||||
}
|
||||
props.setSearchCondition({...props.searchCondition, paramCodeGroup, paramCodeLevel : props.createCondition.paramCodeLevel});
|
||||
|
||||
props.setOpen(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ public class AdminCommitteeCodeManagementServiceImpl extends EgovAbstractService
|
|||
returnMap.put("orgNm", item.getCmtNm());
|
||||
returnMap.put("orgDesc", item.getCmtDesc());
|
||||
returnMap.put("omtOrder", item.getCmtOrder());
|
||||
returnMap.put("upCmtSeq", item.getUpCmtSeq());
|
||||
return returnMap;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
Loading…
Reference in New Issue