ERP-node/WebContent/WEB-INF/view/admin/auth/authAddPopUpCenter.jsp

116 lines
3.1 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%@include file= "/init.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<script>
function addMember(){
var leftForm = parent.authAddPopUpLeft.authAddLeftForm;
var authGroupName = leftForm.authGroupName.value;
var authGroupObjid = leftForm.authGroupObjid.value;
var authGroupCode = leftForm.authGroupCode.value;
if("" == authGroupName){
Swal.fire("작성된 권한명이 없습니다.");
return false;
}
var rightForm = parent.authAddPopUpRight.searchUserForm;
if(0 != rightForm.checkUser.length){
var checkedCnt=0;
for(var i=0;i<rightForm.checkUser.length;i++){
if(rightForm.checkUser[i].checked){
checkedCnt++;
}
}
if(0 == checkedCnt){
if(rightForm.checkUser.checked){
checkedCnt++;
}
}
if(0 < checkedCnt){
if(confirm("선택한 인원을 권한에 포함하시겠습니까?")){
rightForm.groupName.value = authGroupName;
rightForm.groupObjid.value = authGroupObjid;
rightForm.groupCode.value = authGroupCode;
var param = parent.authAddPopUpRight.$("#searchUserForm").serialize();
$.ajax({
type : "POST",
url : "/admin/addAuthGroupMember.do",
data : param,
dataType:"json",
complete:function(xhr){
Swal.fire("추가하였습니다.");
parent.authAddPopUpRight.searchUser();
parent.authAddPopUpLeft.getGroupInfo();
top.opener.window.location.reload();
}
});
}
}
}
}
function deleteMember(){
var leftFrame = parent.authAddPopUpLeft;
var leftForm = parent.authAddPopUpLeft.authAddLeftForm;
if(0 != leftForm.addedMember.length){
var checkedCnt = 0;
for(var i=0;i<leftForm.addedMember.length;i++){
if(leftForm.addedMember[i].checked){
checkedCnt++;
}
}
if(0 == checkedCnt){
if(leftForm.addedMember.checked){
checkedCnt++;
}
}
if(0 < checkedCnt){
if(confirm("선택한 인원을 권한에서 삭제하시겠습니까?")){
var param = leftFrame.$("#authAddLeftForm").serialize();
$.ajax({
type : "POST",
url : "/admin/deleteAuthGroupMember.do",
data : param,
dataType:"json",
complete:function(xhr){
Swal.fire("삭제하였습니다.");
parent.authAddPopUpRight.searchUser();
parent.authAddPopUpLeft.getGroupInfo();
top.opener.window.location.reload();
}
});
}
}
}
}
</script>
</head>
<body>
<form name="hiddenForm" method="POST">
<input type="hidden" name="authGroupName" value="">
<input type="hidden" name="targetMemberList" value="">
<input type="hidden" name="testChk" value="">
</form>
<form name="form1" action="" method="post">
<div id="btnW">
<input type="button" value="<<" class="btns" onclick="javascript:addMember();">
<input type="button" value=">>" class="btns" onclick="javascript:deleteMember();">
</div>
</form>
</body>
</html>