refactor: 업무팝업(등록/변경/삭제) 타이틀 및 버튼 공통 JSP include 적용
parent
ac2c104738
commit
a7c0c3d638
@ -0,0 +1,21 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%-- TODO: 완료후 comment 삭제
|
||||
아래와 같이 isUpdate 정의 필요
|
||||
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
|
||||
--%>
|
||||
<!-- popup button -->
|
||||
<div class="popup_btn">
|
||||
<span class="flr">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<a href="#" class="btn blue" id="btnModify">변경</a>
|
||||
<a href="#" class="btn red" id="btnRemove">삭제</a>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<a href="#" class="btn blue" id="btnRegist">등록</a>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
|
||||
</span>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<%-- TODO: 완료후 comment 삭제
|
||||
아래와 같이 isUpdate 정의 필요
|
||||
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
|
||||
<c:set var="bizName" value="권한그룹"/>
|
||||
--%>
|
||||
<!-- popup title -->
|
||||
<p class="pop_title">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<c:out value="${bizName}"/> 변경
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:out value="${bizName}"/> 등록
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</p>
|
||||
|
@ -1,180 +1,136 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
<c:set var="isUpdate" value="${!empty authGrpVO.groupId}"/>
|
||||
<c:set var="bizName" value="권한그룹"/>
|
||||
|
||||
<c:set var="registerFlag" value="${empty groupManageVO.groupId ? 'INSERT' : 'UPDATE'}"/>
|
||||
<c:set var="registerFlagName" value="${empty groupManageVO.groupId ? '그룹 등록' : '그룹 수정'}"/>
|
||||
<!-- 검색 필드 박스 시작 -->
|
||||
|
||||
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
|
||||
<validator:javascript formName="groupManage" staticJavascript="false" xhtml="true" cdata="false"/>
|
||||
<form:form commandName="groupManage" method="post" >
|
||||
<form>
|
||||
|
||||
<div class="popup" style="min-width: 400px;">
|
||||
<div class="popup_inner" style="max-width: 400px;">
|
||||
<p class="pop_title">권한 등록</p>
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
|
||||
<table class="tbl03">
|
||||
<caption>권한 등록</caption>
|
||||
<tr>
|
||||
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 ID</th>
|
||||
<td nowrap="nowrap"><input name="groupId" id="groupId" type="text" readonly="readonly" value="<c:out value='${groupManage.groupId}'/>" size="40" title="그룹 ID" /></td>
|
||||
<caption>
|
||||
<c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/>
|
||||
</caption>
|
||||
<colgroup>
|
||||
<col style="width: 25%;"/>
|
||||
<col/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한그룹 ID</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="groupId" id="groupId" type="text" readonly="readonly" value="<c:out value='${authGrpVO.groupId}'/>" readonly="${isUpdate}" size="40" title="그룹 ID" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 명
|
||||
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한그룹 명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap"><input name="groupNm" id="groupNm" type="text" value="<c:out value='${groupManage.groupNm}'/>" maxLength="50" size="40" title="그룹명" /> <form:errors path="groupNm" /></td>
|
||||
<td nowrap="nowrap">
|
||||
<input name="groupNm" id="groupNm" type="text" value="<c:out value='${authGrpVO.groupNm}'/>" maxLength="50" size="40" title="그룹명" /> <form:errors path="groupNm" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th>
|
||||
<td nowrap="nowrap"><input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" /></td>
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<code:select type="AUTH_GRP" id="authorCode" name="autorCode" defaultSelect="${authGrpVO.authorCode}" title="권한" cls="selectBox" alt="selectBox tag"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">권한</th>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>설명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<select id="authorCode" name="authorCode">
|
||||
<option value="">== 선택하세요 ==</option>
|
||||
<c:forEach var="row" items="${listAuthorInfoVO }">
|
||||
<option value="<c:out value="${row.author_code }"/>" <c:if test="${row.author_code eq groupManage.authorCode}">selected="selected"</c:if> ><c:out value="${row.author_nm }"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input name="groupDc" id="groupDc" type="text" value="<c:out value='${authGrpVO.groupDc}'/>" maxLength="50" size="50" title="설명" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</th>
|
||||
<td nowrap="nowrap"><input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${groupManage.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/></td>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>등록일자</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${authGrpVO.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="popup_btn">
|
||||
<span class="flr" colspan="4">
|
||||
<c:if test="${registerFlag == 'INSERT'}">
|
||||
<a href="#LINK" class="btn blue" id="btnSave">저장</a>
|
||||
</c:if>
|
||||
<c:if test="${registerFlag == 'UPDATE'}">
|
||||
<a href="#LINK" class="btn blue" id="update_btn">변경</a>
|
||||
<a href="#LINK" class="btn red" id="delete_btn">삭제</a>
|
||||
</c:if>
|
||||
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- //등록버튼 -->
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
<!-- 검색조건 유지 -->
|
||||
<c:if test="${registerFlag == 'UPDATE'}">
|
||||
<input type="hidden" name="searchCondition" value="<c:out value='${groupManageSearchVO.searchCondition}'/>"/>
|
||||
<input type="hidden" name="searchKeyword" value="<c:out value='${groupManageSearchVO.searchKeyword}'/>"/>
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${groupManageSearchVO.pageIndex}'/>"/>
|
||||
</c:if>
|
||||
</form:form>
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javaScript">
|
||||
|
||||
$(document).ready(function(){
|
||||
XitAuthGrpMng_edit.init();
|
||||
});
|
||||
/* *******************************
|
||||
* 사용자그룹관리 수정 Functions
|
||||
******************************* */
|
||||
var XitAuthGrpMng_edit = {
|
||||
init : function(){
|
||||
//닫기 버튼 Event
|
||||
$("#btnClose").click(function() {
|
||||
window.close();
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
add: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('add', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/addAuthAuthor.do"/>'
|
||||
,data: $("form").serialize()
|
||||
//,contentType: 'x-www-form-url-encoded'
|
||||
})
|
||||
}
|
||||
|
||||
,modify: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('modify', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/modifyAuthAuthor.do"/>'
|
||||
,data: $("form").serialize()
|
||||
});
|
||||
//저장 버튼 Event 설정
|
||||
$('#btnSave').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.addData();
|
||||
}
|
||||
});
|
||||
$('#update_btn').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.modifyData();
|
||||
}
|
||||
});
|
||||
$('#delete_btn').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.removeData();
|
||||
}
|
||||
});
|
||||
$(".popup").css("position","absolute");
|
||||
$(".content_header").css("display","none");
|
||||
$("#cur_loc").css("display","none");
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 등록
|
||||
======================== */
|
||||
addData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("저장 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_insert_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 수정
|
||||
======================== */
|
||||
,modifyData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("수정 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_update_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
, remove: () => {
|
||||
cmmBizAjax('remove', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/removeAuthAuthor.do"/>'
|
||||
,data: {authorCode: $('#authorCode').val()}
|
||||
});
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 삭제
|
||||
======================== */
|
||||
,removeData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("삭제 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_delete_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
,validate: () => {
|
||||
if($('#authorCode').val() === ''){
|
||||
alert('[권한코드]는 필수 입니다.');
|
||||
$('#authorCode').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#authorNm').val() === ''){
|
||||
alert('[권한명]은 필수 입니다.');
|
||||
$('#authorNm').focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnRegist').on('click', () => fnBiz.add());
|
||||
|
||||
$('#btnModify').on('click', () => fnBiz.modify());
|
||||
|
||||
$('#btnRemove').on('click', () => fnBiz.remove());
|
||||
});
|
||||
|
||||
}
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function(){
|
||||
$('#authorCreatDe').val(setDateTimeFmt('<c:out value="${authGrpVO.groupCreatDe}"/>'));
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue