메뉴관리 개발중

This commit is contained in:
leejunho 2024-08-21 15:36:05 +09:00
parent 700ae42078
commit 907807b339
2 changed files with 23 additions and 4 deletions

View File

@ -545,6 +545,15 @@ public class EgovMenuCreateManageController {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
int cnt = 0;
//하위노드가 있는 메뉴의 경우 타입을 변경 하지 못하도록 수정
if(
menuCreatVO.getExistChildNode().equals("Y")
&& "M".equals(menuManageVO.getMenuType())) {
modelAndView.addObject("status", "menuInNode");
return modelAndView;
}
try{
try{
if(!menuManageVO.getTmp_Id().equals(menuManageVO.getMenuNo()+"")){ //매뉴번호 변경시
@ -718,11 +727,12 @@ public class EgovMenuCreateManageController {
try {
//선택한 menuNo 모든 권한을 삭제
menuCreateManageService.deleteMenu(menuManageVO);
for(String author : menuManageVO.getAuthorChkList()) {
menuManageVO.setAuthorCode(author);
menuCreateManageService.insertMenu(menuManageVO);
if(menuManageVO.getAuthorChkList() != null && menuManageVO.getAuthorChkList().size() > 0) {
for(String author : menuManageVO.getAuthorChkList()) {
menuManageVO.setAuthorCode(author);
menuCreateManageService.insertMenu(menuManageVO);
}
}
} catch (Exception e) {
modelAndView.addObject("status", "authorFail");
return modelAndView;

View File

@ -206,6 +206,13 @@ function jstreeInit() {
})
.on('create_node.jstree', function(e, data) {
if($("#menuType option:selected").val() != "M"){
alert("타입이 메뉴가 아니면 하위 메뉴를 등로 할 수 없습니다.")
location.reload(true);
return;
}
if (confirm("메뉴를 추가하시겠습니까?")){
var instance = data.instance;
var menuNm = data.text;
@ -549,6 +556,8 @@ function initShowUrl(init){
if($('#itn_organization').jstree('get_selected')[0] != null){
if(instance.get_node($('#itn_organization').jstree('get_selected')[0]).children.length != 0){
alert("하위 메뉴가 있을경우는 다른타입으로 변경할수 없습니다.");
$("#menuType option").attr("selected", false);
$("#menuType option[value='M']").attr("seleted", "selected");
return;
}
}