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

285 lines
9.0 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>
<!-- //JSTL 변수선언 -->
<c:set var="totalCount" value="${empty TOTAL_COUNT?0:TOTAL_COUNT}" />
<c:set var="maxPage" value="${empty MAX_PAGE_SIZE?1:MAX_PAGE_SIZE}" />
<c:set var="nPage" value="${empty param.page?1:param.page}" />
<c:set var="pageIndex" value="${(nPage-1)/10}" />
<c:set var="nextPage" value="${empty NEXT_PAGE?1:NEXT_PAGE}" />
<c:set var="prevPage" value="${empty PREV_PAGE?1:PREV_PAGE}" />
<script>
$(function(){
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
//체크박스 전체선택/전체해제
$("#allCheck").click(function(){
if($("#allCheck").prop("checked")) {
$("input[type=checkbox]").prop("checked",true);
} else {
$("input[type=checkbox]").prop("checked",false);
}
});
// 부분체크해제
$("input[name=authGroup]").click(function(){
if($("#allCheck").is(":checked")){
$("#allCheck").prop("checked",false);
}
});
fnc_datepick();
});
</script>
<script>
function fn_search(){
if(fnc_dateFormChk($("#search_fromDate").val(),$("#search_toDate").val())){
var authGroupForm = document.form1;
form1.action="/admin/authMngList.do";
form1.submit();
}
}
//권한그룹 PopUp
function openAuthGroupPopUp(objId){
var form = document.hiddenForm;
var url = "/admin/authGroupFormPopUp.do";
if(objId != ""){
url = "/admin/authGroupDetailPopUp.do";
}
window.open("","openAuthGroupPopUp","width=500,height=254");
form.authGroupObjid.value = objId;
form.action = url;
form.target = "openAuthGroupPopUp";
form.submit();
}
function openAuthGroupMemberPopUp(objId){
var form = document.hiddenForm;
var target = "";
if(objId == ""){
target = "openAuthGroupPopUp";
}else{
target = objId;
}
window.open("",target,"width=1000,height=330");
form.groupObjid.value = objId;
form.action = "/admin/authAddPopUpFS.do";
form.target = target;
form.submit();
}
//체크된 권한 목록의 상태 활성화 및 비활성화 변경
function changeAuthGroupStatus(status){
var choice = [];
$("input[name='authGroup']:checked").each(function(i){
choice.push($(this).val());
});
if(choice == ''){
Swal.fire("권한명을 선택하세요.");
}
else if(confirm("상태를 변경하시겠습니까?")){
var form1 = document.form1;
form1.authGroupStatus.value = status;
form1.action="/admin/changeAuthGroupStatus.do";
form1.submit();
}
}
//프로젝트에 해당하는 WBS Task 목록 PopUp을 호출한다.
function fn_openAuthHistory(objId){
if(null != objId){
window.open("/admin/authHistoryList.do?objId="+objId, "", "width=950, height=500");
}else{
Swal.fire("잘못된 접근입니다.");
}
}
//프로젝트에 해당하는 WBS Task 목록 PopUp을 호출한다.
function fn_deleteAuthGroup(objId){
if("" != objId){
if(confirm("삭제하시겠습니까?")){
$.ajax({
url:"/admin/deleteAuthGroup.do",
type:"POST",
data:{"OBJID":objId},
dataType:"json",
async:false,
success:function(data){
Swal.fire(data.msg);
if(data.result){
fn_search();
}
},
error: function(jqxhr, status, error){
}
});
}
}
}
</script>
</head>
<body>
<form name="hiddenForm" method="POST">
<input type="hidden" name="groupObjid" value="">
<input type="hidden" name="authGroupObjid" value="">
</form>
<form name="form1" id="form1" method="POST">
<input type="hidden" name="authGroupStatus">
<section id="commonSection" class="admin1">
<div class="admin_title">
<h2>권한관리</h2>
</div>
<div id="adminFormWrap">
<table id="adminForm">
<tbody>
<tr>
<td class="label"><label for="">권한명</label></td>
<td>
<input type="text" id="search_auth" name="search_auth" value="${param.search_auth}" maxlength="8">
</td>
<td class="label"><label>등록자</label></td>
<td>
<input type="text" id="search_writer" name="search_writer" value="${param.search_writer}" maxlength="8">
</td>
<td class="label"><label for="">등록일</label></td>
<td colspan="3">
<input type="text" id="search_fromDate" name="search_fromDate" class="date_margin" value="${param.search_fromDate}" readonly>
~ <input type="text" id="search_toDate" name="search_toDate" value="${param.search_toDate}" readonly>
<input type="button" class="date_delete" value="x" onclick="javascript:fnc_date_empty()"></td>
<td class="label"><label>상태</label></td>
<td>
<select id="search_status" name="search_status">
<option value="">선택</option>
<option value="active" ${param.search_status eq 'active'?'selected':''}>활성화</option>
<option value="inActive" ${param.search_status eq 'inActive'?'selected':''}>비활성화</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div id="adminBtnWrap">
<input type="button" value="조회" class="btns" onclick="fn_search()" >
<input type="button" value="권한그룹등록" class="btns" onclick="openAuthGroupPopUp('');">
<input type="button" value="활성화" class="btns" onclick="javascript:changeAuthGroupStatus('active');">
<input type="button" value="비활성화" class="btns" onclick="javascript:changeAuthGroupStatus('inActive');">
</div>
<div id="adminTableWrap">
<div id="tableWrap">
<table id="adminTable">
<colgroup>
<col width="19px" />
<col width="36px" />
<col width="*" />
<col width="*" />
<col width="80px" />
<col width="190px" />
<col width="100px" />
<col width="90px" />
<col width="39px" />
<col width="39px" />
</colgroup>
<tr id="thead">
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
<td>No</td>
<td>권한명</td>
<td>권한CODE</td>
<td>소속인원</td>
<td>등록자</td>
<td>등록일</td>
<td>상태</td>
<td colspan="2">기능</td>
</tr>
<c:choose>
<c:when test="${empty authMngList}">
<tr style="text-align: center;">
<td align="center" colspan="10">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="auth" items="${authMngList}" varStatus="status">
<tr>
<td><input type="checkbox" name="authGroup" value="${auth.OBJID}"></td>
<td>${status.index+1}</td>
<td><a href="#" onclick="openAuthGroupPopUp('${auth.OBJID}');">${auth.AUTH_NAME}</a></td>
<td>${auth.AUTH_CODE}</td>
<td title="총 ${auth.USER_CNT}명"><a href="#" onclick="openAuthGroupMemberPopUp('${auth.OBJID}');">총 ${auth.USER_CNT}명</a></td>
<td>${auth.WRITER_TITLE}</td>
<td>${auth.REGDATE}</td>
<td>${auth.STATUS_TITLE}</td>
<td><input type="button" class="blue_btn" value="삭제" onclick="fn_deleteAuthGroup('${auth.OBJID}');" style="float:none;"></td>
<td><input type="button" class="blue_btn" value="이력" onclick="fn_openAuthHistory('${auth.OBJID}');" style="float:none;"></td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
</div>
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}">
<c:if test="${!empty authMngList}">
<div class="page_pro">
<table>
<tr>
<c:choose>
<c:when test="${nPage > 1}">
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">prev</td>
</c:otherwise>
</c:choose>
<c:forEach var="v" begin="${nPage>5?nPage-5:1}" end="${nPage>5?nPage+4:10}" step="1" varStatus="status">
<c:if test="${status.index -1 < maxPage}">
<c:choose>
<c:when test="${status.index eq nPage}">
<td><a href="#" class="now_page">${nPage}</a></td>
</c:when>
<c:otherwise>
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<c:choose>
<c:when test="${nPage < maxPage}">
<td><a href="javascript:fnc_goNext('${nextPage}');">next</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">next</td>
</c:otherwise>
</c:choose>
</tr>
</table>
<c:if test="${!empty authMngList}">
<p id="adminPageCount">총 ${totalCount}건</p>
</c:if>
</div>
</c:if>
</div>
</section>
</form>
</body>
</html>