fix: 메뉴목록관리 팝업페이지 수정

main
Kurt92 2 years ago
parent e16ce4dd38
commit c82e8a6712

@ -30,7 +30,7 @@ public interface AuthAuthorMgtMapper {
/**
* <pre> : </pre>
*
* @param vo
* @param paraMap
* @param rowBounds
* @return List<XitAuthRegMngVO>
* @author:
@ -38,7 +38,6 @@ public interface AuthAuthorMgtMapper {
*/
List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap);
/**
* <pre> : </pre>
* @param vo

@ -44,12 +44,12 @@ public interface MenuListMgtMapper {
/**
* <pre> : </pre>
* @param vo
* @param String
* @return MenuListMngVO
* @author:
* @date: 2020. 3. 26.
*/
public MenuListMngVO findMenuView(MenuListMngVO vo) throws SQLException;
public MenuListMngVO findMenuView(String progrmFileNm);
/**
* <pre> : </pre>

@ -40,12 +40,12 @@ public interface MenuListMgtService {
/**
* <pre> : </pre>
* @param vo
* @param String
* @return MenuListMngVO
* @author:
* @date: 2020. 3. 26.
*/
public MenuListMngVO findView(MenuListMngVO vo);
public MenuListMngVO findView(String menuNm);
/**
* <pre> : </pre>

@ -66,13 +66,8 @@ public class MenuListMngServiceImpl implements MenuListMgtService {
}
@Override
public MenuListMngVO findView(MenuListMngVO vo) {
MenuListMngVO result = null;
try {
result = menuListMngMapper.findMenuView(vo);
} catch (SQLException e) {
throw new RuntimeException("메뉴목록관리 상세정보 조회 FAIL::", e);
}
public MenuListMngVO findView(String menuNm) {
MenuListMngVO result = menuListMngMapper.findMenuView(menuNm);
return result;
}

@ -14,6 +14,9 @@ import javax.servlet.http.HttpServletResponse;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.Checks;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,14 +50,12 @@ import org.springframework.web.servlet.ModelAndView;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
//@RequestMapping(value = "/_mng_/menu/list/")
@RequestMapping(value = "/framework/biz/mng/menu/")
@Slf4j
@AllArgsConstructor
@RequestMapping(value = "/framework/biz/mng/menu")
public class MenuListMgtController {
private static final Logger logger = LoggerFactory.getLogger(MenuListMgtController.class);
@Resource
private MenuListMgtService menuListMngService;
private final MenuListMgtService service;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
@ -70,6 +71,27 @@ public class MenuListMgtController {
public void mngMenuMgtForm() {
}
/**
* / popup page
* @param menuNo :
* @return ModelAndView
*/
@RequestMapping(value = "/mngMenuMgtPopup")
public ModelAndView mngMenuMgtPopup(final String menuNo) {
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(menuNo)){
mav.addObject("menuManageVO", new MenuListMngVO());
mav.addObject("pageTitle", "메뉴목록 생성");
} else {
mav.addObject("menuManageVO", service.findView(menuNo));
mav.addObject("pageTitle", "프로그램 정보 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngMenuMgtPopup.popup");
return mav;
}
/**
* :
* Paging : parameter Map
@ -81,47 +103,10 @@ public class MenuListMgtController {
*/
@RequestMapping(value = "findsMenu_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
public ModelAndView findsMenu(@RequestParam Map<String,Object> paraMap) {
return ResultResponse.of(menuListMngService.findList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
return ResultResponse.of(service.findList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/**
* <pre> : .</pre>
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 3. 26.
*/
@RequestMapping(value = "MenuListMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String MenuListMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("menuManageVO") MenuListMngVO vo
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
case "inputs": //일괄등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
MenuListMngVO menuListMngVO = menuListMngService.findView(vo);
model.addAttribute("menuManageVO", menuListMngVO);
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/XitMenuListMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param cmd
@ -141,7 +126,7 @@ public class MenuListMgtController {
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/XitMenuListMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/XitMenuListMng_"+cmd+"_popup"+TILES_TYPE.FIMS_POPUP.getVal();
}
/**
@ -181,7 +166,7 @@ public class MenuListMgtController {
}
//처리
try {
menuListMngService.addProc(vo);
service.addProc(vo);
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
message = e.getMessage();
@ -214,8 +199,8 @@ public class MenuListMgtController {
if (!"".equals(fileVO.getFileName())) {
// 2011.10.07 업로드 파일에 대한 확장자를 체크
if (fileVO.getFileName().toLowerCase().endsWith(".xls") || fileVO.getFileName().toLowerCase().endsWith(".xlsx")) {
if (menuListMngService.menuBndeAllDelete()) {
message = menuListMngService.addsProc(vo, fis);
if (service.menuBndeAllDelete()) {
message = service.addsProc(vo, fis);
} else {
message = xitMessageSource.getMessage("fail.common.msg");
vo.setTmp_Cmd("EgovMenuBndeRegist Error!!");
@ -257,7 +242,7 @@ public class MenuListMgtController {
fis.close();
}
} catch (IOException ee) {
logger.debug("{}", ee);
log.debug("{}", ee);
}
}
}
@ -277,7 +262,7 @@ public class MenuListMgtController {
}
//처리
try {
menuListMngService.modifyProc(vo);
service.modifyProc(vo);
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
@ -291,7 +276,7 @@ public class MenuListMgtController {
case "delete": //삭제
//처리
try {
menuListMngService.removeProc(vo);
service.removeProc(vo);
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
@ -305,7 +290,7 @@ public class MenuListMgtController {
case "deletes": //다건 삭제
//처리
try {
menuListMngService.removesProc(checkedMenuNoForDel);
service.removesProc(checkedMenuNoForDel);
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();

@ -4,8 +4,12 @@ import java.util.Map;
import javax.annotation.Resource;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.mng.menu.model.ProgramMngSearchVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
@ -36,6 +40,7 @@ import lombok.AllArgsConstructor;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@Slf4j
@AllArgsConstructor
@RequestMapping(value = "/framework/biz/mng/menu")
public class ProgramMgtController {
@ -51,6 +56,23 @@ public class ProgramMgtController {
public void mngProgramMgtForm() {
}
@RequestMapping(value = "/XitProgramMng_FileNmSearch_popup")
public ModelAndView XitProgramMng_FileNmSearch_popup(@RequestParam final Map<String,Object> paraMap,@ModelAttribute("searchVO") ProgramMngSearchVO searchVO, ModelMap model) {
log.info("didcall");
ModelAndView mav = new ModelAndView();
mav.addObject("progrmMngVO", service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap)));
mav.addObject("pageTitle", "프로그램 정보 변경");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/XitProgramMng_FileNmSearch_popup.popup");
return mav;
}
/**
* / popup page
* @param progrmFileNm :

@ -39,19 +39,6 @@
<div id="grid"></div>
<script type="text/javaScript">
class Form {
constructor(grid) {
this.grid = grid;
};
search(){
grid.reloadData();
}
}
/**************************************************************************
* Global Variable
**************************************************************************/

@ -225,7 +225,8 @@
};
const gridDatasource = { //DataSource
initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/framework/biz/mng/auth/findAuthRoleGrantList.do"/>'
@ -236,7 +237,7 @@
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (ev) => {
console.table('---------->>>',ev)
console.table(['---------->>>t',ev])
console.log('---------->>>',ev.instance)
console.log('---------->>>',ev.responseData)
});

@ -76,8 +76,8 @@ function choisProgramListSearch(vFileNm) {
</div>
<!-- //검색 필드 박스 끝 -->
<div id="page_info"><div id="page_info_align"></div></div>
<div id="grid"></div>
<%--<div id="page_info"><div id="page_info_align"></div></div>
<!-- table add start -->
<div class="default_tablestyle">
<table width="100%" summary="프로그램파일명 검색목록으로 프로그램파일명 프로그램명으로 구성됨">
@ -94,7 +94,7 @@ function choisProgramListSearch(vFileNm) {
</thead>
<tbody>
<c:forEach var="result" items="${list_progrmmanage}" varStatus="status">
<c:forEach var="mav" items="${list_progrmmanage}" varStatus="status">
<!-- loop 시작 -->
<tr>
<td nowrap="nowrap">
@ -113,10 +113,96 @@ function choisProgramListSearch(vFileNm) {
<ui:pagination paginationInfo = "${paginationInfo}" type="image" jsFunction="linkPage"/>
</ul>
</div>
<!-- //페이지 네비게이션 끝 -->
<!-- //페이지 네비게이션 끝 --> --%>
</form>
<script type="text/javaScript">
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등)
{
header: '메뉴번호',
name: 'menuNo',
width: 100,
sortable: true,
sortingType: 'desc',
align: 'center'
},
{
header: '메뉴명',
name: 'menuNm',
width: 200,
sortable: false,
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : (props) => ({
formatter : props.grid.getRow(props.rowKey).progrmFileNm
, element: "text"
})
, eventFunction: fnBiz.fnClickMenuListBtn //function(){alert("1234")}
, eventType: "click"
}
}
},
{
header: '프로그램파일명',
name: 'progrmFileNm',
width: 200,
sortable: false,
align: 'center'
},
{
header: '메뉴설명',
name: 'menuDc',
minWidth: 200,
sortable: false,
align: 'left'
},
{
header: '상위메뉴번호',
name: 'upperMenuId',
width: 100,
sortable: false,
align: 'center'
}
];
const gridDatasource = { //DataSource
/* -----------------------
* DataSource API Setting
----------------------- */
initialRequest: false, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/framework/biz/mng/menu/findsMenu_list.ajax"/>'
}
}
};
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns,
columnOptions: {
frozenCount: 1 //고정컬럼 갯수
, minWidth: 80 //최소 사이즈
}
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -58,6 +58,101 @@
**************************************************************************/
let GRID = null;
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search : function(){
GRID.reloadData();
},
add : function(){
CmmPopup.open(
'<c:url value="/framework/biz/mng/menu/mngMenuMgtPopup.do"/>'
, null
, {
width: 720
, height: 655
}
, '메뉴목록'
)
},
modify : function(){
},
remove : function(){
if(!confirm("삭제 하시겠습니까?"))
return false;
//Parameter Get
let arrKey = [];
GRID.getCheckedRows().forEach(function(row){
arrKey.push(row.menuNo);
});
//Call
document.frmSearch.checkedMenuNoForDel.value=arrKey.join(',');
document.frmSearch.action = "<c:url value='/framework/biz/mng/menu/MenuListMng_deletes_proc.do'/>";
document.frmSearch.submit();
},
pagePopup: function(props){
const rowData = props.grid.getRow(props.rowKey);
CmmPopup.open(
'<c:url value="/framework/biz/mng/menu/mngProgramMgtPopup.do"/>'
, {
progrmFileNm: rowData.progrmFileNm
}
, {
width: 720
, height: 655
}
, '프로그램 상세'
)},
fnClickMenuListBtn: function(props){
const rowData = props.grid.getRow(props.rowKey);
CmmPopup.open(
'<c:url value="/framework/biz/mng/menu/mngMenuMgtPopup.do"/>'
, {
menuNo: rowData.menuNo
}
, {
width: 720
, height: 655
}
, '프로그램 상세'
)
}
}
/**************************************************************************
* event
**************************************************************************/
$(()=>{
$('#btnSearch').on('click', () => {
fnBiz.search();
});
$("#btnRegist").on('click', () => {
fnBiz.add();
});
$("#btnRemove").on('click', () => {
fnBiz.removeData();
});
$("#allRegist_btn").on('click', () => {
fnBiz.pagePopup();
});
});
/* *******************************
* Grid
******************************* */
@ -80,15 +175,11 @@
renderer: {
type: CustomButtonRenderer,
options: {
formatter: function (props) {
var rowData = props.grid.getRow(props.rowKey);
var obj = {
formatter: rowData.menuNm
formatter : (props) => ({
formatter : props.grid.getRow(props.rowKey).progrmFileNm
, element: "text"
}
return obj;
}
, eventFunction: fnMenuMgt.fnClickMenuListBtn //function(){alert("1234")}
})
, eventFunction: fnBiz.fnClickMenuListBtn //function(){alert("1234")}
, eventType: "click"
}
}
@ -139,104 +230,6 @@
});
}
/* *******************************
* function
******************************* */
const fnMenuMgt = {
search : function(){
GRID.reloadData();
},
add : function(){
},
modify : function(){
},
remove : function(){
if(!confirm("삭제 하시겠습니까?"))
return false;
//Parameter Get
let arrKey = [];
GRID.getCheckedRows().forEach(function(row){
arrKey.push(row.menuNo);
});
//Call
document.frmSearch.checkedMenuNoForDel.value=arrKey.join(',');
document.frmSearch.action = "<c:url value='/framework/biz/mng/menu/MenuListMng_deletes_proc.do'/>";
document.frmSearch.submit();
},
pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
document.frmSearch.searchKeyword.value = "";
document.frmSearch.action = url;
document.frmSearch.submit();
break;
case "popup": //팝업 OPEN
this.pagePopup(flag, url, params);
break;
default:
break;
}
},
pagePopup: function(flag, url, params){
let popTitle;
let popOption;
switch (flag) {
case "detail": //상세
popTitle = "메뉴 목록 상세";
popOption = {height: 655, width:715}
break;
case "input": //등록
popTitle = "메뉴 목록 등록";
popOption = {height: 655, width:715}
break;
case "inputs": //일괄등록
popTitle = "메뉴 목록 일괄등록";
popOption = {height: 285, width:715}
break;
default:
break;
}
CmmPopup.open(url, params, popOption, popTitle);
},
fnClickMenuListBtn: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnMenuMgt.pagePopup(
'detail',
"<c:url value='/framework/biz/mng/menu/MenuListMng_edit.do'/>",
{tilesDef: 'popup', menuNo: rowData.menuNo}
);
}
}
/**************************************************************************
* event
**************************************************************************/
$(()=>{
$('#btnSearch').on('click', () => {
GRID.reloadData();
GRID.refreshLayout();
});
$("#btnRegist").click(function(){
fnMenuMgt.pagePopup('input', "<c:url value='/framework/biz/mng/menu/MenuListMng_input.do'/>");
});
$("#btnRemove").click(function(){
fnMenuMgt.removeData();
});
$("#allRegist_btn").click(function(){
fnMenuMgt.pagePopup('inputs', "<c:url value='/framework/biz/mng/menu/MenuListMng_inputs.do'/>");
});
});
/**************************************************************************
* initialize
**************************************************************************/

@ -122,6 +122,7 @@ form[name="menuManageVO"] textarea{
}
</style>
<script type="text/javaScript">
/**************************************************************************
@ -181,15 +182,7 @@ form[name="menuManageVO"] textarea{
XitMenuListMng_input.removeData();
}
});
$('#searchFile').on({
click: function () {
var params = "";
params += "tmp_SearchElementName=progrmFileNm"
/*XitMenuListMng_input.pagePopup('fileNmSearch', "
<c:url value='/_mng_/menu/program/ProgramMng_FileNmSearch_popup.do'/>", params);*/
XitMenuListMng_input.pagePopup('fileNmSearch', "<c:url value='/framework/biz/mng/menu/mngProgramMgtPopup'/>", params);
}
})
$(".popup").css("position", "absolute");
$(".content_header").css("display", "none");
$("#cur_loc").css("display", "none");
@ -269,24 +262,16 @@ form[name="menuManageVO"] textarea{
});
}
}
, pagePopup: function (flag, url, params) {
var popUrl = url;
if (!(params == undefined || params == null)) {
popUrl += "?";
popUrl += params;
, pagePopup: function(props){
CmmPopup.open(
'<c:url value="/framework/biz/mng/menu/XitProgramMng_FileNmSearch_popup.do"/>'
, {}
, {
width: 720
, height: 655
}
var popTitle = '';
switch (flag) {
case "fileNmSearch": //상세
popTitle = "파일명 목록";
popOption = "scrollbars = yes, top=100px, left=100px, height=520px, width=805px;";
break;
default:
break;
}
window.open(popUrl, popTitle, popOption);
},
, '프로그램 상세'
)}
}
/**************************************************************************
@ -304,6 +289,9 @@ form[name="menuManageVO"] textarea{
$('#btnRemove').on('click', () => {
fnBiz.remove();
});
$('#searchFile').on('click', () => {
XitMenuListMng_input.pagePopup('fileNmSearch', "<c:url value='/framework/biz/mng/menu/findPrograms'/>");
});
});
/**************************************************************************
* initialize

@ -157,8 +157,8 @@ const TuiGrid = {
console.log('totCnt >>>>> ',$('#totCnt span').text())
}
//if(successCallback) successCallback(JSON.parse(ev.xhr.response));
if(successCallback) successCallback(ev);
if(successCallback) successCallback(JSON.parse(ev.xhr.response));
//if(successCallback) successCallback(ev);
});
// 결과가 false인 경우 발생한 경우
this.instance.on('failResponse', function(ev){

Loading…
Cancel
Save