공통 jsp 화면 소스이동
parent
3ecd7a5c01
commit
a803c3711b
@ -0,0 +1,73 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="actioninfoPrefix-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="id"
|
||||
>아이디</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="id" type="text" required data-map="GRP_ID" maxlength="50" class="form-control" placeholder="prefixName 아이디" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="name"
|
||||
>이름</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="name" type="text" required data-map="GRP_NM" maxlength="60" class="form-control" placeholder="prefixName 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>설명</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="description" type="text" data-map="DSCRP" maxlength="200" class="form-control dob-picker" placeholder="prefixName 설명"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button onclick="saveinfoPrefix();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var actioninfoPrefixFields = new FormFields("#actioninfoPrefix-form");
|
||||
|
||||
actioninfoPrefixControl.groups.setInfo = obj => {
|
||||
actioninfoPrefixFields.set(actioninfoPrefixControl, obj);
|
||||
let create = isEmpty(obj.data.GRP_ID);
|
||||
$("input[name='id']").prop("readonly", !create);
|
||||
$("#actioninfoPrefix-form input").onEnterPress(saveinfoPrefix);
|
||||
|
||||
document.querySelector("input[name='" + (create ? "id" : "name") + "']").focus();
|
||||
}
|
||||
|
||||
actioninfoPrefixControl.groups.onModify = (changed) => {
|
||||
if (["GRP_NM"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderactioninfoPrefixList();
|
||||
actioninfoPrefixControl.groups.dataset.setState();
|
||||
}
|
||||
|
||||
function saveinfoPrefix() {
|
||||
if (!$("#actioninfoPrefix-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 prefixName 정보를 저장하시겠습니까?",
|
||||
onOK:() => {
|
||||
actioninfoPrefixControl.groups.save(actioninfoPrefixFields.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceURL=actionGroup-info.jsp
|
||||
</script>
|
@ -0,0 +1,229 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<style id="actionGroupMainCss">
|
||||
#actionGroupMainCss+div tr[data-key='userAction'] > td:nth-child(n+2):nth-child(-n+3),
|
||||
#actionGroupMainCss+div tr[data-key='anonymousAction'] > td:nth-child(n+2):nth-child(-n+3) {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<c:set var="prefixName" scope="request">기능 그룹</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">기능 그룹</h5>
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<div>
|
||||
<div class="input-group" id="${infoPrefix}-query">
|
||||
<select id="${infoPrefix}by" onchange="document.getElementById('${infoPrefix}term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="${infoPrefix}Name">이름</option>
|
||||
<option value="${infoPrefix}ID">아이디</option>
|
||||
</select>
|
||||
<input id="${infoPrefix}term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="searchaction${infoPrefix}s();" class="btn btn-primary">찾기</button>
|
||||
<button onclick="action${infoPrefix}Control.groups.newInfo();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveaction${infoPrefix}s" onclick="removeaction${infoPrefix}s();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="action${infoPrefix}Thead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="action${infoPrefix}Control.groups.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Full name: activate to sort column descending" style="">아이디</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" style="">이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="action${infoPrefix}List">
|
||||
</tbody>
|
||||
<template id="action${infoPrefix}Row">
|
||||
<tr data-key="{GRP_ID}">
|
||||
<td style="text-align:center;"><input value="{GRP_ID}" onchange="action${infoPrefix}Control.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="action${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="action${infoPrefix}Control.groups.getInfo({})">{GRP_ID}</td>
|
||||
<td onclick="action${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="action${infoPrefix}Control.groups.getInfo({})">{GRP_NM}</td>
|
||||
<td onclick="action${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="action${infoPrefix}Control.groups.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="action${infoPrefix}NotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="action${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="action${infoPrefix}Paging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">기능 URL</h5>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnAddActions" onclick="action${infoPrefix}Control.addActions();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveActions" onclick="removeActions();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="actionThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input id="actionToggler" onchange="action${infoPrefix}Control.actions.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" style="">기능 URL</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="actionList">
|
||||
</tbody>
|
||||
<template id="actionRow">
|
||||
<tr data-key="{GRP_ID}-{ACTION}">
|
||||
<td style="text-align:center;"><input value="{GRP_ID}-{ACTION}" onchange="action${infoPrefix}Control.actions.select('{GRP_ID}-{ACTION}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="action${infoPrefix}Control.actions.setCurrent('{GRP_ID}-{ACTION}')">{ACTION}</td>
|
||||
<td onclick="action${infoPrefix}Control.actions.setCurrent('{GRP_ID}-{ACTION}">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="actionNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="3" class="dataTables_empty text-center">기능 URL 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="actionPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="actionPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var action${infoPrefix}Control = new ActionGroupControl();
|
||||
|
||||
function searchaction${infoPrefix}s() {
|
||||
action${infoPrefix}Control.groups.query = {
|
||||
by:$("#${infoPrefix}-query [name='by']").val(),
|
||||
term:$("#${infoPrefix}-query [name='term']").val()
|
||||
};
|
||||
action${infoPrefix}Control.groups.query.fetchAll = true;
|
||||
action${infoPrefix}Control.groups.load(1);
|
||||
}
|
||||
|
||||
function removeaction${infoPrefix}s() {
|
||||
dialog.alert({
|
||||
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
||||
onOK:() => {
|
||||
action${infoPrefix}Control.groups.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeActions() {
|
||||
dialog.alert({
|
||||
content:"선택한 기능 URL을 삭제하시겠습니까?",
|
||||
onOK:() => {
|
||||
action${infoPrefix}Control.removeActions();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderaction${infoPrefix}List() {
|
||||
let ${infoPrefix}List = action${infoPrefix}Control.groups.dataset;
|
||||
let empty = action${infoPrefix}List.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("action${infoPrefix}NotFound").innerHTML] : <%-- from template#action${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("action${infoPrefix}Row").innerHTML); <%-- from template#action${infoPrefix}Row --%>
|
||||
$("#action${infoPrefix}List").html(trs.join());
|
||||
$("#action${infoPrefix}Thead").find("th input[type='checkbox']").prop("checked", false);
|
||||
$("#actionThead").find("th input[type='checkbox']").prop("checked", false);
|
||||
}
|
||||
|
||||
action${infoPrefix}Control.onGroupListChange = obj => {
|
||||
renderaction${infoPrefix}List();
|
||||
|
||||
$("#action${infoPrefix}Paging").setPaging({
|
||||
list:action${infoPrefix}Control.groups.dataset,
|
||||
prefix:action${infoPrefix}Control.groups.prefix,
|
||||
start:obj.${infoPrefix}Start,
|
||||
totalSize:obj.${infoPrefix}Total,
|
||||
fetchSize:obj.${infoPrefix}Fetch,
|
||||
func:"action${infoPrefix}Control.groups.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
action${infoPrefix}Control.onCurrentGroupChange = item => {
|
||||
$("#btnAddActions").prop("disabled", !item);
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.GRP_ID;
|
||||
$("#action${infoPrefix}List").setCurrentRow(key);
|
||||
};
|
||||
|
||||
action${infoPrefix}Control.onGroupSelect = selected => {
|
||||
let ${infoPrefix}List = action${infoPrefix}Control.groups.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#action${infoPrefix}List input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveaction${infoPrefix}s").prop("disabled", keys.length < 1);
|
||||
};
|
||||
|
||||
|
||||
action${infoPrefix}Control.onActionListChange = obj => {
|
||||
let ${infoPrefix}List = action${infoPrefix}Control.actions.dataset;
|
||||
let empty = ${infoPrefix}List.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("actionNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("actionRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
|
||||
$("#actionList").html(trs.join());
|
||||
$("#actionToggler").prop("checked", false);
|
||||
|
||||
$("#actionPaging").setPaging({
|
||||
list:action${infoPrefix}Control.actions.dataset,
|
||||
prefix:action${infoPrefix}Control.actions.prefix,
|
||||
start:obj.actionStart,
|
||||
totalSize:obj.actionTotal,
|
||||
fetchSize:obj.actionFetch,
|
||||
func:"action${infoPrefix}Control.actions.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
action${infoPrefix}Control.onCurrentActionChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let data = item.data;
|
||||
let key = data.GRP_ID + "-" + data.ACTION;
|
||||
$("#actionList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
action${infoPrefix}Control.onActionSelect = selected => {
|
||||
let ${infoPrefix}List = action${infoPrefix}Control.actions.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#actionList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveActions").prop("disabled", keys.length < 1);
|
||||
};
|
||||
|
||||
$("#${infoPrefix}term").onEnterPress(searchaction${infoPrefix}s);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
action${infoPrefix}Control.groups.setData({
|
||||
${infoPrefix}List:${groupList},
|
||||
${infoPrefix}Start:${groupStart},
|
||||
${infoPrefix}Fetch:${groupFetch},
|
||||
${infoPrefix}Total:${groupTotal}
|
||||
});
|
||||
});
|
||||
//# sourceURL=actionGroup-main.jsp
|
||||
</script>
|
@ -0,0 +1,127 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<style id="selectActionGroupCss">
|
||||
#selectActionGroupCss+div tr[data-key='userAction'] > td:nth-child(n+2):nth-child(-n+3),
|
||||
#selectActionGroupCss+div tr[data-key='anonymousAction'] > td:nth-child(n+2):nth-child(-n+3) {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<c:set var="prefixName" scope="request">기능 그룹</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="card">
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<div>
|
||||
<div class="input-group" id="DataTables_Table_0_length">
|
||||
<select id="_actionGroupBy" onchange="document.getElementById('_actionGroupTerm').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="${infoPrefix}Name">이름</option>
|
||||
<option value="${infoPrefix}ID">아이디</option>
|
||||
</select>
|
||||
<input id="_actionGroupTerm" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="_search${infoPrefix}s();" class="btn btn-primary">찾기</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="_action${infoPrefix}Thead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="${infoPrefix}Control.groups.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Full name: activate to sort column descending" style="">아이디</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" style="">이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="_action${infoPrefix}List">
|
||||
</tbody>
|
||||
<template id="_action${infoPrefix}Row">
|
||||
<tr data-key="{GRP_ID}">
|
||||
<td style="text-align:center;"><input value="{GRP_ID}" onchange="${infoPrefix}Control.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="${infoPrefix}Control.groups.getInfo({})">{GRP_ID}</td>
|
||||
<td onclick="${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="${infoPrefix}Control.groups.getInfo({})">{GRP_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.groups.setCurrent('{GRP_ID}')" ondblclick="${infoPrefix}Control.groups.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="_action${infoPrefix}NotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="_action${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="_action${infoPrefix}Paging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var ${infoPrefix}Control = new ActionGroupControl(false);
|
||||
|
||||
function getSelectedActionGroup() {
|
||||
let selected = ${infoPrefix}Control.groups.dataset.getKeys("selected");
|
||||
if (selected.length < 1)
|
||||
return dialog.alert("기능그룹을 선택하십시오.");
|
||||
else
|
||||
return selected;
|
||||
}
|
||||
|
||||
function _search${infoPrefix}s() {
|
||||
${infoPrefix}Control.groups.query = {
|
||||
by:$("#_actionGroupBy").val(),
|
||||
term:$("#_actionGroupTerm").val()
|
||||
};
|
||||
${infoPrefix}Control.groups.load(1);
|
||||
}
|
||||
|
||||
${infoPrefix}Control.onGroupListChange = obj => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.groups.dataset;
|
||||
let empty = ${infoPrefix}List.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("_action${infoPrefix}NotFound").innerHTML] : <%-- from template#_action${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("_action${infoPrefix}Row").innerHTML); <%-- from template#_action${infoPrefix}Row --%>
|
||||
$("#_action${infoPrefix}List").html(trs.join());
|
||||
$("#_action${infoPrefix}Thead").find("th input[type='checkbox']").prop("checked", false);
|
||||
|
||||
$("#_action${infoPrefix}Paging").setPaging({
|
||||
list:${infoPrefix}Control.groups.dataset,
|
||||
prefix:${infoPrefix}Control.groups.prefix,
|
||||
start:obj.${infoPrefix}Start,
|
||||
totalSize:obj.${infoPrefix}Total,
|
||||
fetchSize:obj.${infoPrefix}Fetch,
|
||||
func:"${infoPrefix}Control.groups.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onCurrentGroupChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.GRP_ID;
|
||||
$("#_action${infoPrefix}List").setCurrentRow(key);
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onGroupSelect = selected => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.groups.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#_action${infoPrefix}List input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
};
|
||||
|
||||
$("#_actionGroupTerm").onEnterPress(_search${infoPrefix}s);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
${infoPrefix}Control.groups.setData({
|
||||
${infoPrefix}List:${groupList},
|
||||
${infoPrefix}Start:${groupStart},
|
||||
${infoPrefix}Fetch:${groupFetch},
|
||||
${infoPrefix}Total:${groupTotal}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,91 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnAddAuthActions" onclick="${infoPrefix}Control.addActions();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveAuthActions" onclick="removeAuthActions();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead>
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input id="authActionToggler" onchange="${infoPrefix}Control.actions.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" style="">기능 그룹</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="authActionList">
|
||||
</tbody>
|
||||
<template id="authActionRow">
|
||||
<tr data-key="{AUTH_ID}-{GRP_ID}">
|
||||
<td style="text-align:center;"><input value="{AUTH_ID}-{GRP_ID}" onchange="${infoPrefix}Control.actions.select('{AUTH_ID}-{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="${infoPrefix}Control.actions.setCurrent('{AUTH_ID}-{GRP_ID}')">{GRP_ID}</td>
|
||||
<td onclick="${infoPrefix}Control.actions.setCurrent('{AUTH_ID}-{GRP_ID}">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="authActionNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="3" class="dataTables_empty text-center">기능 그룹 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="adminActions">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="3" class="dataTables_empty text-center">{authority}는 모든 기능을 사용할 수 있습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="authActionPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="authActionPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
<c:set var="actionGroupFunc" scope="request">function removeAuthActions() {
|
||||
dialog.alert({
|
||||
content:"선택한 기능그룹을 삭제하시겠습니까?",
|
||||
onOK:() => {
|
||||
${infoPrefix}Control.removeActions();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
${infoPrefix}Control.onActionListChange = obj => {
|
||||
let authority = ${infoPrefix}Control.authorities.getCurrent();
|
||||
authority = authority ? authority.AUTH_NM : "";
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.actions.dataset;
|
||||
let empty = ${infoPrefix}List.empty;
|
||||
|
||||
let trs =
|
||||
${infoPrefix}Control.authorities.isAdmin() ? [document.getElementById("adminActions").innerHTML.replace(/{authority}/, authority)] :
|
||||
empty ?
|
||||
[document.getElementById("authActionNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("authActionRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
|
||||
$("#authActionList").html(trs.join());
|
||||
$("#authActionToggler").prop("checked", false);
|
||||
|
||||
$("#authActionPaging").setPaging({
|
||||
list:${infoPrefix}Control.actions.dataset,
|
||||
prefix:${infoPrefix}Control.actions.prefix,
|
||||
start:obj.actionStart,
|
||||
totalSize:obj.actionTotal,
|
||||
fetchSize:obj.actionFetch,
|
||||
func:"${infoPrefix}Control.getActions({index})"
|
||||
});
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onCurrentActionChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let data = item.data;
|
||||
let key = data.AUTH_ID + "-" + data.GRP_ID;
|
||||
$("#authActionList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onActionSelect = selected => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.actions.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#authActionList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveAuthActions").prop("disabled", keys.length < 1);
|
||||
};</c:set>
|
@ -0,0 +1,75 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="infoPrefix-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="id"
|
||||
>아이디</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="id" type="text" required data-map="AUTH_ID" maxlength="50" class="form-control" placeholder="prefixName 아이디" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="name"
|
||||
>이름</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="name" type="text" required data-map="AUTH_NM" maxlength="60" class="form-control" placeholder="prefixName 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>설명</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="description" type="text" data-map="DSCRP" maxlength="200" class="form-control dob-picker" placeholder="prefixName 설명"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button id="btnSaveAuth" onclick="saveinfoPrefix();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var infoPrefixFields = new FormFields("#infoPrefix-form");
|
||||
|
||||
infoPrefixControl.authorities.setInfo = obj => {
|
||||
infoPrefixFields.set(infoPrefixControl, obj);
|
||||
let info = obj.data;
|
||||
let create = isEmpty(info.AUTH_ID);
|
||||
$("input[name='id']").prop("readonly", !create);
|
||||
$("#infoPrefix-form input").onEnterPress(saveinfoPrefix);
|
||||
|
||||
$("input[name='" + (create ? "id" : "name") + "']").focus();
|
||||
$("#btnSaveAuth").prop("disabled", infoPrefixControl.authorities.isBuiltIn(info));
|
||||
}
|
||||
|
||||
infoPrefixControl.authorities.onModify = (changed) => {
|
||||
if (["AUTH_NM"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderinfoPrefixList();
|
||||
infoPrefixControl.authorities.dataset.setState();
|
||||
}
|
||||
|
||||
function saveinfoPrefix() {
|
||||
if (!$("#infoPrefix-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 prefixName 정보를 저장하시겠습니까?",
|
||||
onOK:() => {
|
||||
infoPrefixControl.authorities.save(infoPrefixFields.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceURL=actionGroup-info.jsp
|
||||
</script>
|
@ -0,0 +1,187 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<style id="authorityMainCss">
|
||||
#authorityMainCss+div tr[data-key='ROLE_ADMIN'] > td:nth-child(n+2):nth-child(-n+3),
|
||||
#authorityMainCss+div tr[data-key='ROLE_USER'] > td:nth-child(n+2):nth-child(-n+3),
|
||||
#authorityMainCss+div tr[data-key='ROLE_ANONYMOUS'] > td:nth-child(n+2):nth-child(-n+3) {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<c:set var="prefixName" scope="request">권한</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">권한</h5>
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<div>
|
||||
<div class="input-group" id="${infoPrefix}-query">
|
||||
<select id="${infoPrefix}by" name="by" onchange="document.getElementById('${infoPrefix}term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="authName">이름</option>
|
||||
<option value="authID">아이디</option>
|
||||
</select>
|
||||
<input id="${infoPrefix}term" name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="search${infoPrefix}s();" class="btn btn-primary">찾기</button>
|
||||
<button onclick="${infoPrefix}Control.authorities.newInfo();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemove${infoPrefix}s" onclick="remove${infoPrefix}s();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="${infoPrefix}Thead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="${infoPrefix}Control.authorities.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Full name: activate to sort column descending" style="">아이디</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" style="">이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="${infoPrefix}List">
|
||||
</tbody>
|
||||
<template id="${infoPrefix}Row">
|
||||
<tr data-key="{AUTH_ID}">
|
||||
<td style="text-align:center;"><input value="{AUTH_ID}" onchange="${infoPrefix}Control.authorities.select('{AUTH_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="${infoPrefix}Control.authorities.setCurrent('{AUTH_ID}')" ondblclick="${infoPrefix}Control.authorities.getInfo({})">{AUTH_ID}</td>
|
||||
<td onclick="${infoPrefix}Control.authorities.setCurrent('{AUTH_ID}')" ondblclick="${infoPrefix}Control.authorities.getInfo({})">{AUTH_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.authorities.setCurrent('{AUTH_ID}')" ondblclick="${infoPrefix}Control.authorities.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="${infoPrefix}NotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="${infoPrefix}Paging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:49%; padding-top:.25em;">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" onClick="${infoPrefix}Control.getLinkedList('users');" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-top-users" aria-controls="navs-top-users" aria-selected="true">사용자</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" onClick="${infoPrefix}Control.getLinkedList('actions');" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-top-actions" aria-controls="navs-top-actions" aria-selected="false">기능그룹</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" style="padding:.6em 0;" id="${infoPrefix}RightInclude">
|
||||
<div class="tab-pane fade show active" id="navs-top-users" role="tabpanel">
|
||||
<div class="ox-scroll">
|
||||
<jsp:include page="user-list.jsp" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="navs-top-actions" role="tabpanel">
|
||||
<jsp:include page="actionGroup-list.jsp" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var ${infoPrefix}Control = new AuthorityControl();
|
||||
${infoPrefix}Control.authorities.onSave = (resp) => {
|
||||
if (resp.saved) {
|
||||
dialog.alert("저장됐습니다.");
|
||||
dialog.close(${infoPrefix}Control.authorities.prefixed("dialog"));
|
||||
${infoPrefix}Control.authorities.query.fetchAll = true;
|
||||
${infoPrefix}Control.authorities.load(1);
|
||||
}
|
||||
}
|
||||
${infoPrefix}Control.authorities.onRemove = (selected, resp) => {
|
||||
if (resp.saved){
|
||||
${infoPrefix}Control.authorities.query.fetchAll = true;
|
||||
${infoPrefix}Control.authorities.load(1);
|
||||
}
|
||||
}
|
||||
|
||||
function search${infoPrefix}s() {
|
||||
${infoPrefix}Control.authorities.query = {
|
||||
by:$("#${infoPrefix}-query [name='by']").val(),
|
||||
term:$("#${infoPrefix}-query [name='term']").val()
|
||||
};
|
||||
${infoPrefix}Control.authorities.query.fetchAll = true;
|
||||
${infoPrefix}Control.authorities.load(1);
|
||||
}
|
||||
|
||||
function remove${infoPrefix}s() {
|
||||
dialog.alert({
|
||||
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
||||
onOK:() => {
|
||||
${infoPrefix}Control.removeAuthorities();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function render${infoPrefix}List() {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.authorities.dataset;
|
||||
let empty = ${infoPrefix}List.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("${infoPrefix}NotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("${infoPrefix}Row").innerHTML); <%-- from template#${infoPrefix}Row --%>
|
||||
$("#${infoPrefix}List").html(trs.join());
|
||||
$("#${infoPrefix}Thead").find("th input[type='checkbox']").prop("checked", false);
|
||||
$("#${infoPrefix}RightInclude").find("th input[type='checkbox']").prop("checked", false);
|
||||
}
|
||||
|
||||
${infoPrefix}Control.onAuthorityListChange = obj => {
|
||||
render${infoPrefix}List();
|
||||
|
||||
$("#${infoPrefix}Paging").setPaging({
|
||||
list:${infoPrefix}Control.authorities.dataset,
|
||||
prefix:${infoPrefix}Control.authorities.prefix,
|
||||
start:obj.${infoPrefix}Start,
|
||||
totalSize:obj.${infoPrefix}Total,
|
||||
fetchSize:obj.${infoPrefix}Fetch,
|
||||
func:"${infoPrefix}Control.authorities.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onCurrentAuthorityChange = item => {
|
||||
$("#btnAddActions").prop("disabled", !item || ${infoPrefix}Control.authorities.isAdmin(item.data));
|
||||
$("#btnAddUsers").prop("disabled", !item || ${infoPrefix}Control.authorities.isImplicit(item.data));
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.AUTH_ID;
|
||||
$("#${infoPrefix}List").setCurrentRow(key);
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onAuthoritySelect = selected => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.authorities.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#${infoPrefix}List input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
let builtIn = selected.filter(info => ${infoPrefix}Control.authorities.isBuiltIn(info)).length > 0;
|
||||
|
||||
$("#btnRemove${infoPrefix}s").prop("disabled", keys.length < 1 || builtIn);
|
||||
};
|
||||
|
||||
${userFunc}
|
||||
${actionGroupFunc}
|
||||
|
||||
$("#${infoPrefix}term").onEnterPress(search${infoPrefix}s);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
${infoPrefix}Control.authorities.setData({
|
||||
${infoPrefix}List:${authorityList},
|
||||
${infoPrefix}Start:${authorityStart},
|
||||
${infoPrefix}Fetch:${authorityFetch},
|
||||
${infoPrefix}Total:${authorityTotal}
|
||||
});
|
||||
});
|
||||
//# sourceURL=authority-main.jsp
|
||||
</script>
|
@ -0,0 +1,100 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnAddAuthUsers" onclick="${infoPrefix}Control.addUsers();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveAuthUsers" onclick="removeAuthUsers();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead>
|
||||
<tr>
|
||||
<th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input id="authUserToggler" onchange="${infoPrefix}Control.users.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending">시군구명</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" >기관명</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" >부서명</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" >사용자 계정</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending" >사용자 이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" >등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="authUserList">
|
||||
</tbody>
|
||||
<template id="authUserRow">
|
||||
<tr data-key="{AUTH_ID}-{USER_ID}">
|
||||
<td style="text-align:center;"><input value="{AUTH_ID}-{USER_ID}" onchange="${infoPrefix}Control.users.select('{AUTH_ID}-{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{SGG_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{INST_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{DEPT_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{USER_ACNT}</td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{USER_NM}</td>
|
||||
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="authUserNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="7" class="dataTables_empty text-center">사용자 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="implicitActions">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="7" class="dataTables_empty text-center">{authority}는 사용자를 지정하지 않습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="authUserPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="authUserPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
<c:set var="userFunc" scope="request">
|
||||
function removeAuthUsers() {
|
||||
dialog.alert({
|
||||
content:"선택한 사용자를 삭제하시겠습니까?",
|
||||
onOK:() => {
|
||||
${infoPrefix}Control.removeUsers();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
${infoPrefix}Control.onUserListChange = obj => {
|
||||
let authority = ${infoPrefix}Control.authorities.getCurrent();
|
||||
authority = authority ? authority.AUTH_NM : "";
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.users.dataset;
|
||||
let empty = ${infoPrefix}List.empty;
|
||||
|
||||
let trs =
|
||||
${infoPrefix}Control.authorities.isImplicit() ? [document.getElementById("implicitActions").innerHTML.replace(/{authority}/, authority)] :
|
||||
empty ? [document.getElementById("authUserNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(document.getElementById("authUserRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
|
||||
$("#authUserList").html(trs.join());
|
||||
$("#authUserToggler").prop("checked", false);
|
||||
|
||||
$("#authUserPaging").setPaging({
|
||||
list:${infoPrefix}Control.users.dataset,
|
||||
prefix:${infoPrefix}Control.users.prefix,
|
||||
start:obj.userStart,
|
||||
totalSize:obj.userTotal,
|
||||
fetchSize:obj.userFetch,
|
||||
func:"${infoPrefix}Control.users.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onCurrentUserChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let data = item.data;
|
||||
let key = data.AUTH_ID + "-" + data.USER_ID;
|
||||
$("#authUserList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onUserSelect = selected => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.users.dataset;
|
||||
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
||||
$("#authUserList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveAuthUsers").prop("disabled", keys.length < 1);
|
||||
};</c:set>
|
@ -0,0 +1,135 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="code-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="code"
|
||||
>코드</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="code" type="text" required data-map="CODE" maxlength="15" class="form-control" placeholder="코드" />
|
||||
<input name="groupID" type="hidden" data-map="GRP_ID" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="value"
|
||||
>코드값</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="value" type="text" required data-map="CODE_VAL" maxlength="60" class="form-control" placeholder="코드값" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>설명</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="description" type="text" data-map="DSCRP" maxlength="200" class="form-control" placeholder="코드 설명"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="etc1"
|
||||
>기타값 1</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="etc1" type="text" data-map="ETC1" maxlength="200" class="form-control" placeholder="기타값 1"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="etc2"
|
||||
>기타값2</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="etc2" type="text" data-map="ETC2" maxlength="200" class="form-control" placeholder="기타값 2"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="etc3"
|
||||
>기타값3</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="etc3" type="text" data-map="ET3" maxlength="200" class="form-control" placeholder="기타값 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="createdBy"
|
||||
>등록자</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" data-map="RGTR" readonly class="form-control" placeholder="등록자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>등록일자</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" data-map="REG_DT" readonly class="form-control" placeholder="등록일자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>사용여부</label
|
||||
>
|
||||
<div class="col-sm-10 p-2">
|
||||
<span id="codeInUse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button onclick="saveCode();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var codeFields = new FormFields("#code-form");
|
||||
|
||||
codeControl.codes.setInfo = obj => {
|
||||
let info = obj.data;
|
||||
codeFields.set(codeControl, obj);
|
||||
let create = isEmpty(info.CODE);
|
||||
$("input[name='code']").prop("readonly", !create);
|
||||
$("#code-form input").onEnterPress(saveCode);
|
||||
$("#codeInUse").html("Y" == info.USE_YN ? "사용 중" : "사용하지 않음");
|
||||
document.querySelector("input[name='" + (create ? "code" : "value") + "']").focus();
|
||||
}
|
||||
|
||||
codeControl.codes.onModify = (changed) => {
|
||||
if (["CODE", "CODE_VAL"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderCodeList();
|
||||
codeControl.codes.dataset.setState();
|
||||
}
|
||||
|
||||
function saveCode() {
|
||||
if (!$("#code-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 코드 정보를 저장하시겠습니까?",
|
||||
onOK:() => {
|
||||
codeControl.codes.save(codeFields.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceURL=code-info.jsp
|
||||
</script>
|
@ -0,0 +1,233 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">코드 그룹</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">${prefixName}</h5>
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<%--div>
|
||||
<div class="input-group" id="${infoPrefix}-query">
|
||||
<select id="${infoPrefix}by" name="by" onchange="document.getElementById('${infoPrefix}term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="groupName">이름</option>
|
||||
<option value="groupID">아이디</option>
|
||||
</select>
|
||||
<input id="${infoPrefix}term" name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div--%>
|
||||
<div>
|
||||
<%--button onclick="searchGroups();" class="btn btn-primary">찾기</button--%>
|
||||
<button onclick="codeControl.groups.newInfo();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveGroups" onclick="removeGroups();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="groupThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="codeControl.groups.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Full name: activate to sort column descending">아이디</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending">이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="groupList">
|
||||
</tbody>
|
||||
<template id="groupRow">
|
||||
<tr data-key="{GRP_ID}"{notUsed}>
|
||||
<td style="text-align:center;"><input value="{GRP_ID}" onchange="codeControl.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_ID}</td>
|
||||
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_NM}</td>
|
||||
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="groupNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="groupPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="groupPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">공통 코드</h5>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnAddCode" onclick="codeControl.newCode();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveCodes" onclick="removeCodes();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="codeThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input id="codeToggler" onchange="codeControl.codes.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending">코드</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Email: activate to sort column ascending">코드값</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="codeList">
|
||||
</tbody>
|
||||
<template id="codeRow">
|
||||
<tr data-key="{CODE}"{notUsed}>
|
||||
<td style="text-align:center;"><input value="{CODE}" onchange="codeControl.codes.select('{CODE}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE}</td>
|
||||
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE_VAL}</td>
|
||||
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="codeNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">코드 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="codePagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="codePaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var codeControl = new CodeControl();
|
||||
|
||||
function searchGroups() {
|
||||
codeControl.groups.query = {
|
||||
by:$("#${infoPrefix}-query [name='by']").val(),
|
||||
term:$("#${infoPrefix}-query [name='term']").val()
|
||||
};
|
||||
codeControl.groups.load(1);
|
||||
}
|
||||
|
||||
function removeGroups() {
|
||||
dialog.alert({
|
||||
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
||||
onOK:() => {
|
||||
codeControl.groups.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeCodes() {
|
||||
dialog.alert({
|
||||
content:"선택한 코드를 삭제하시겠습니까?",
|
||||
onOK:() => {
|
||||
codeControl.codes.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderGroupList() {
|
||||
let groupList = codeControl.groups.dataset;
|
||||
let empty = groupList.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("groupNotFound").innerHTML] : <%-- from template#groupNotFound --%>
|
||||
groupList.inStrings(
|
||||
document.getElementById("groupRow").innerHTML,
|
||||
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
|
||||
); <%-- from template#groupRow --%>
|
||||
$("#groupList").html(trs.join());
|
||||
$("#groupThead").find("input[type='checkbox']").prop("checked", false);
|
||||
$("#codeThead").find("input[type='checkbox']").prop("checked", false);
|
||||
}
|
||||
|
||||
codeControl.onGroupListChange = obj => {
|
||||
renderGroupList();
|
||||
|
||||
$("#groupPaging").setPaging({
|
||||
list:codeControl.groups.dataset,
|
||||
prefix:codeControl.groups.prefix,
|
||||
start:obj.groupStart,
|
||||
totalSize:obj.groupTotal,
|
||||
fetchSize:obj.groupFetch,
|
||||
func:"codeControl.groups.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
codeControl.onCurrentGroupChange = item => {
|
||||
$("#btnAddCode").prop("disabled", !item);
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.GRP_ID;
|
||||
$("#groupList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
codeControl.onGroupSelect = selected => {
|
||||
let groupList = codeControl.groups.dataset;
|
||||
let keys = selected.map(e => groupList.getKey(e));
|
||||
$("#groupList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveGroups").prop("disabled", keys.length < 1);
|
||||
};
|
||||
|
||||
function renderCodeList() {
|
||||
let codeList = codeControl.codes.dataset;
|
||||
let empty = codeList.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("codeNotFound").innerHTML] : <%-- from template#groupNotFound --%>
|
||||
codeList.inStrings(
|
||||
document.getElementById("codeRow").innerHTML,
|
||||
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
|
||||
); <%-- from template#groupRow --%>
|
||||
$("#codeList").html(trs.join());
|
||||
$("#codeToggler").prop("checked", false);
|
||||
}
|
||||
|
||||
codeControl.onCodeListChange = obj => {
|
||||
renderCodeList();
|
||||
|
||||
$("#codePaging").setPaging({
|
||||
list:codeControl.codes.dataset,
|
||||
prefix:codeControl.codes.prefix,
|
||||
start:obj ? obj.codeStart : -1,
|
||||
totalSize:obj ? obj.codeTotal : 0,
|
||||
fetchSize:obj ? obj.codeFetch : 10,
|
||||
func:"codeControl.codes.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
codeControl.onCurrentCodeChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let data = item.data;
|
||||
let key = data.CODE;
|
||||
$("#codeList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
codeControl.onCodeSelect = selected => {
|
||||
let codeList = codeControl.codes.dataset;
|
||||
let keys = selected.map(e => codeList.getKey(e));
|
||||
$("#codeList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveCodes").prop("disabled", selected.length < 1);
|
||||
};
|
||||
|
||||
$("#${infoPrefix}term").onEnterPress(searchGroups);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
codeControl.groups.setData({
|
||||
groupList:${groupList},
|
||||
groupStart:${groupStart},
|
||||
groupFetch:${groupFetch},
|
||||
groupTotal:${groupTotal}
|
||||
});
|
||||
});
|
||||
//# sourceURL=code-main.jsp
|
||||
</script>
|
@ -0,0 +1,105 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="group-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="id"
|
||||
>아이디</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="id" type="text" required data-map="GRP_ID" maxlength="50" class="form-control" placeholder="그룹 아이디" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="name"
|
||||
>이름</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="name" type="text" required data-map="GRP_NM" maxlength="60" class="form-control" placeholder="그룹 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>설명</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="description" type="text" data-map="DSCRP" maxlength="200" class="form-control" placeholder="그룹 설명"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="createdBy"
|
||||
>등록자</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" data-map="RGTR" readonly class="form-control" placeholder="등록자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>등록일자</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" data-map="REG_DT" readonly class="form-control" placeholder="등록일자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>사용여부</label
|
||||
>
|
||||
<div class="col-sm-10 p-2">
|
||||
<span id="groupInUse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button onclick="saveGroup();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var groupFields = new FormFields("#group-form");
|
||||
|
||||
codeControl.groups.setInfo = obj => {
|
||||
let info = obj.data;
|
||||
groupFields.set(codeControl, obj);
|
||||
let create = isEmpty(info.GRP_ID);
|
||||
$("input[name='id']").prop("readonly", !create);
|
||||
$("#group-form input").onEnterPress(saveGroup);
|
||||
$("#groupInUse").html(create ? "" : info.USE_YN == "Y" ? "사용 중" : "사용하지 않음");
|
||||
|
||||
document.querySelector("input[name='" + (create ? "id" : "name") + "']").focus();
|
||||
}
|
||||
|
||||
codeControl.groups.onModify = (changed) => {
|
||||
if (["GRP_NM"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderGroupList();
|
||||
codeControl.groups.dataset.setState();
|
||||
}
|
||||
|
||||
function saveGroup() {
|
||||
if (!$("#group-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 그룹 정보를 저장하시겠습니까?",
|
||||
onOK:() => {
|
||||
codeControl.groups.save(groupFields.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceURL=group-info.jsp
|
||||
</script>
|
@ -0,0 +1,102 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="menu-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="id"
|
||||
>아이디</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="id" type="text" readonly maxlength="50" class="form-control" placeholder="저장하시면 시스템이 부여합니다." />
|
||||
<input name="parentID" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="name"
|
||||
>이름</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="name" type="text" required maxlength="60" class="form-control" placeholder="메뉴 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="action"
|
||||
>URL</label
|
||||
>
|
||||
<div class="col-sm-10 input-group w-80">
|
||||
<span id="btnSelectURL" onClick="setURL();" class="input-group-text"><i class="bx bx-search"></i></span>
|
||||
<input name="action" type="text" maxlength="60" class="form-control" placeholder="URL" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="description"
|
||||
>설명</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="description" type="text" maxlength="200" class="form-control" placeholder="메뉴 설명"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="imageName"
|
||||
>이미지 이름</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="imageName" type="text" maxlength="200" class="form-control" placeholder="이미지 이름"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-2 col-form-label text-sm-end" for="imageConf"
|
||||
>이미지 설정</label
|
||||
>
|
||||
<div class="col-sm-10">
|
||||
<input name="imageConf" type="text" maxlength="200" class="form-control" placeholder="이미지 설정"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button id="btnSaveAuth" onclick="saveMenu();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<c:set var="menuFunc" scope="request">
|
||||
var menuFields = new FormFields("#menu-form");
|
||||
|
||||
menuControl.setInfo = obj => {
|
||||
menuFields.set(menuControl, obj);
|
||||
$("input[name='name']").focus();
|
||||
}
|
||||
|
||||
menuControl.onModify = (changed) => {
|
||||
if (["name", "url"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
}
|
||||
|
||||
async function setURL() {
|
||||
let url = await selectURL(false);
|
||||
$("input[name='action']").val(url).change();
|
||||
}
|
||||
|
||||
function saveMenu() {
|
||||
if (!$("#menu-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 메뉴 정보를 저장하시겠습니까?",
|
||||
onOK:() => menuControl.save(menuFields.get())
|
||||
});
|
||||
}
|
||||
|
||||
$("#menu-form input")
|
||||
.onEnterPress(() => saveMenu());
|
||||
</c:set>
|
@ -0,0 +1,134 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
|
||||
<c:set var="prefixName" scope="request">메뉴</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">레이아웃</h5>
|
||||
<div id="menu-tree" class="main-left d-flex flex-column flex-grow-1">
|
||||
<div class="d-flex justify-content-between" style="padding-top:.5em; padding-bottom:.5em; border-top:1px solid #dfdfdf; border-bottom:1px solid #dfdfdf;">
|
||||
<span>
|
||||
<button id="menuToggler" onclick="toggleMenus();" class="btn btn-primary"></button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="menuTree" style="padding-top:1em; min-height:26em; overflow:auto;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">등록 정보</h5>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnRemoveMenus" onclick="removeMenus();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<jsp:include page="menu-info.jsp" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var menuBranches = treeSupport({
|
||||
selector:"#menuTree",
|
||||
trace:wctx.trace,
|
||||
plugins: ["checkbox", "contextmenu", "dnd"] ,
|
||||
core:{check_callback:true,
|
||||
multiple:false
|
||||
},
|
||||
checkbox:{
|
||||
whole_node:false,
|
||||
tie_selection:false
|
||||
},
|
||||
contextmenu:{items:{
|
||||
newMenu:{label:"메뉴 추가", action:function(obj){
|
||||
var current = menuControl.getCurrent(),
|
||||
parentID = current.parentID;
|
||||
menuControl.newInfo({parentID:parentID});
|
||||
$("input[name='parentID']").val(parentID);
|
||||
}},
|
||||
newChildMenu:{label:"하위메뉴 추가", action:function(obj){
|
||||
var current = menuControl.getCurrent(),
|
||||
parentID = current.id;
|
||||
menuControl.newInfo({parentID:parentID});
|
||||
$("input[name='parentID']").val(parentID);
|
||||
log("current", menuControl.getCurrent());
|
||||
}},
|
||||
}},
|
||||
onNodeSelect:function(obj) {
|
||||
var key = obj[0];
|
||||
menuControl.setCurrent(key);
|
||||
},
|
||||
onNodeMove:function(obj) {
|
||||
var parentID = obj.parent,
|
||||
menuID = obj.node.id;
|
||||
if (parentID == "#")
|
||||
parentID = null;
|
||||
menuControl.move(parentID, menuID);
|
||||
},
|
||||
onNodeReorder:function(obj) {
|
||||
var parentID = obj.parent,
|
||||
menuID = obj.node.id,
|
||||
menuIDs = menuBranches.getChildIDs(parentID);
|
||||
menuControl.reorder(menuIDs);
|
||||
},
|
||||
onNodeCheck:function(obj) {
|
||||
var checked = obj.checked,
|
||||
menuID = obj.node.id;
|
||||
menuControl.select(menuID, checked);
|
||||
}
|
||||
});
|
||||
|
||||
function toggleMenus() {
|
||||
$("#menuToggler").text(menuBranches.toggleFolding() == "collapsed" ? "+ 펼치기" : "- 닫기");
|
||||
}
|
||||
|
||||
var menuControl = new MenuControl();
|
||||
|
||||
menuControl.onDatasetChange = obj => {
|
||||
menuBranches.setData(treeHtml(menuControl.menus, {
|
||||
id:function(e){return e.id;},
|
||||
text:function(e){
|
||||
return e.name == e.url ? e.name : e.name + (e.url ? " (" + e.url + ")" : "");
|
||||
}
|
||||
}));
|
||||
$("#btnSelectURL").prop("disabled", menuControl.dataset.empty);
|
||||
}
|
||||
|
||||
menuControl.onCurrentChange = item => {
|
||||
menuControl.setInfo(item.data);
|
||||
menuBranches.selectNode(item.data.id);
|
||||
}
|
||||
|
||||
menuControl.onSelectionChange = selected => {
|
||||
$("#btnRemoveMenus").prop("disabled", selected.length < 1);
|
||||
}
|
||||
|
||||
menuControl.onMenusChanged = () => loadUserMenus();
|
||||
|
||||
${menuFunc}
|
||||
|
||||
async function loadUserMenus() {
|
||||
let userMenus = await menuControl.getUserMenus();
|
||||
setUserMenus(userMenus);
|
||||
}
|
||||
|
||||
function removeMenus() {
|
||||
dialog.alert({
|
||||
content:"선택한 메뉴 정보를 삭제하시겠습니까?",
|
||||
onOK:() => menuControl.remove()
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
$("#menuToggler").text(menuBranches._folding == "collapsed" ? "+ 펼치기" : "- 닫기");
|
||||
menuControl.setData(${menus});
|
||||
menuBranches.open();
|
||||
});
|
||||
//# sourceURL=menu-main.jsp
|
||||
</script>
|
@ -0,0 +1,155 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">시스템 로그</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div id="${infoPrefix}-query" class="d-flex flex-row justify-content-between p-3">
|
||||
<div class="d-flex flex-row">
|
||||
<div class="input-group">
|
||||
<select id="${infoPrefix}logType" name="logType" class="form-select">
|
||||
<option value="">로그유형</option>
|
||||
<option value="log-inout">로그인/아웃</option>
|
||||
<option value="download">다운로드</option>
|
||||
<option value="web">웹</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group" style="margin: 0 1rem 0 1rem">
|
||||
<select id="${infoPrefix}by" name="by" onchange="document.getElementById('${infoPrefix}term').focus();" class="form-select">
|
||||
<option value="userName">사용자 이름</option>
|
||||
<option value="userAccount">사용자 계정</option>
|
||||
<option value="userID">사용자 아이디</option>
|
||||
</select>
|
||||
<input id="${infoPrefix}term" name="term" type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input id="${infoPrefix}fromDate" name="fromDate" type="text" value="${fromDate}" required placeholder="시작일자" class="form-control">
|
||||
<span style="margin: 0 .5rem 0 .5rem"> ~ </span>
|
||||
<input id="${infoPrefix}toDate" name="toDate" type="text" value="${toDate}" required placeholder="종료일자" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="search${infoPrefix}s();" class="btn btn-primary">찾기</button>
|
||||
<button onclick="${infoPrefix}Control.download();" class="btn btn-primary not-empty">다운로드</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead>
|
||||
<tr><th style="width: auto;">계정</th>
|
||||
<th style="width: auto;">사용자이름</th>
|
||||
<th style="width: auto;">IP 주소</th>
|
||||
<th style="width: max-content;">로그유형</th>
|
||||
<th style="width: max-content;">접속일시</th>
|
||||
<th style="width: auto;">URL</th>
|
||||
<th style="width: auto;">설명</th>
|
||||
<th style="width: auto;">파일이름</th>
|
||||
<th style="width: auto;">민감정보</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="${infoPrefix}List">
|
||||
</tbody>
|
||||
<template id="${infoPrefix}Row">
|
||||
<tr data-key="{LOG_ID}" {onclick}>
|
||||
<td>{USER_ACNT}</td>
|
||||
<td>{USER_NM}</td>
|
||||
<td>{IP_ADDR}</td>
|
||||
<td>{LOG_TYPE_NM}</td>
|
||||
<td>{REG_DT}</td>
|
||||
<td>{URL}</td>
|
||||
<td>{DSCRP}</td>
|
||||
<td>{FILE_NM}</td>
|
||||
<td>{PSNL_INFO}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="${infoPrefix}NotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="8" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="${infoPrefix}Paging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var ${infoPrefix}Control = new DatasetControl({
|
||||
prefix: "${infoPrefix}",
|
||||
prefixName: "${prefixName}",
|
||||
keymapper: row => row.LOG_ID,
|
||||
dataGetter: obj => obj.${infoPrefix}List,
|
||||
query: {}
|
||||
});
|
||||
|
||||
function search${infoPrefix}s() {
|
||||
let logType = $("#${infoPrefix}logType").val(),
|
||||
params = {
|
||||
logTypes: logType ? [logType] : [],
|
||||
fromDate: $("#${infoPrefix}fromDate").val().replace(/-/gi, ""),
|
||||
toDate: $("#${infoPrefix}toDate").val().replace(/-/gi, "")
|
||||
},
|
||||
terms = $("#${infoPrefix}-query [name='term']").val();
|
||||
if (terms) {
|
||||
switch ($("#${infoPrefix}-query [name='by']").val()) {
|
||||
case "userName": params.userName = terms; break;
|
||||
case "userAccount": params.userAccounts = [terms.toUpperCase()]; break;
|
||||
case "userID": params.userIDs = [terms]; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
${infoPrefix}Control.query = params;
|
||||
${infoPrefix}Control.load(1);
|
||||
}
|
||||
|
||||
${infoPrefix}Control.onDatasetChange = obj => {
|
||||
let ${infoPrefix}List = ${infoPrefix}Control.dataset,
|
||||
empty = ${infoPrefix}List.empty,
|
||||
|
||||
trs = empty ?
|
||||
[document.getElementById("${infoPrefix}NotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
${infoPrefix}List.inStrings(
|
||||
document.getElementById("${infoPrefix}Row").innerHTML, <%-- from template#${infoPrefix}Row --%>
|
||||
(str, dataItem) => str
|
||||
.replace(/{onclick}=""/gi, 'onclick="syslogControl.setCurrent(\'' + dataItem.getValue("LOG_ID") + '\');"')
|
||||
);
|
||||
$("#${infoPrefix}List").html(trs.join());
|
||||
$("#${infoPrefix}-query button.not-empty").prop("disabled", empty);
|
||||
|
||||
$("#${infoPrefix}Paging").setPaging({
|
||||
list:${infoPrefix}Control.dataset,
|
||||
prefix:${infoPrefix}Control.prefix,
|
||||
start:obj.${infoPrefix}Start,
|
||||
totalSize:obj.${infoPrefix}Total,
|
||||
fetchSize:obj.${infoPrefix}Fetch,
|
||||
func:"${infoPrefix}Control.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
${infoPrefix}Control.onCurrentChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.LOG_ID;
|
||||
$("#${infoPrefix}List").setCurrentRow(key);
|
||||
};
|
||||
|
||||
$("#${infoPrefix}term").onEnterPress(search${infoPrefix}s);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
${infoPrefix}Control.setData({
|
||||
${infoPrefix}List:${syslogList},
|
||||
${infoPrefix}Start:${syslogStart},
|
||||
${infoPrefix}Fetch:${syslogFetch},
|
||||
${infoPrefix}Total:${syslogTotal}
|
||||
});
|
||||
$("#${infoPrefix}-query #${infoPrefix}fromDate, #${infoPrefix}-query #${infoPrefix}toDate").datePicker();
|
||||
});
|
||||
//# sourceURL=${infoPrefix}-main.jsp
|
||||
</script>
|
@ -0,0 +1,101 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="dept-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="deptID">부서코드</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="deptID" type="text" required data-map="DEPT_CD" maxlength="7" class="form-control" placeholder="부서코드" />
|
||||
<input name="sggID" type="hidden" data-map="SGG_CD" />
|
||||
<input name="instCode" type="hidden" data-map="INST_CD" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="name">부서이름</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="name" type="text" required data-map="DEPT_NM" maxlength="100" class="form-control" placeholder="부서이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="telno">전화번호</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="telno" type="text" data-map="DEPT_TELNO" maxlength="20" class="form-control" placeholder="전화번호"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="faxno">팩스번호</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="faxno" type="text" data-map="DEPT_FXNO" maxlength="20" class="form-control" placeholder="팩스번호"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="createdBy">등록자</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" data-map="RGTR" readonly class="form-control" placeholder="등록자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="description">등록일자</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" data-map="REG_DT" readonly class="form-control" placeholder="등록일자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="description">사용여부</label>
|
||||
<div class="col-sm-9" style="padding:.5em .7em;">
|
||||
<input name="useYN" type="hidden" data-map="USE_YN" />
|
||||
<span id="deptInUse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12" style="text-align:right;">
|
||||
<button onclick="saveDept();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var deptFields = new FormFields("#dept-form");
|
||||
|
||||
sggDeptControl.depts.setInfo = obj => {
|
||||
let info = obj.data;
|
||||
deptFields.set(sggDeptControl.depts, obj);
|
||||
let create = isEmpty(info.DEPT_CD);
|
||||
$("input[name='deptID']").prop("readonly", !create);
|
||||
$("#dept-form input").onEnterPress(saveDept);
|
||||
$("#deptInUse").html("Y" == info.USE_YN ? "사용 중" : "사용하지 않음");
|
||||
document.querySelector("input[name='" + (create ? "deptID" : "name") + "']").focus();
|
||||
}
|
||||
|
||||
sggDeptControl.depts.onModify = (changed) => {
|
||||
if (["DEPT_NM"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderDeptList();
|
||||
sggDeptControl.depts.dataset.setState();
|
||||
}
|
||||
|
||||
function saveDept() {
|
||||
if (!$("#dept-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 부서 정보를 저장하시겠습니까?",
|
||||
onOK:() => sggDeptControl.depts.save(deptFields.get())
|
||||
});
|
||||
}
|
||||
//# sourceURL=dept-info.jsp
|
||||
</script>
|
@ -0,0 +1,98 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
|
||||
<form id="password-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-4 col-form-label text-sm-end required" for="currentPassword">
|
||||
현재 비밀번호
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="currentPassword" type="password" required class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-4 col-form-label text-sm-end required" for="password">
|
||||
새 비밀번호
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="password" type="password" required class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-4 col-form-label text-sm-end required" for="confirmPassword">
|
||||
새 비밀번호 확인
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="confirmPassword" type="password" required class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-md-6">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-sm-3">
|
||||
<button type="button" onclick="validPassword();" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
function validPassword(){
|
||||
if($("#password-form input[name='currentPassword']").val() == ""){
|
||||
dialog.alert("현재 비밀번호를 입력하세요.");
|
||||
return;
|
||||
}
|
||||
if($("#password-form input[name='password']").val() == ""){
|
||||
dialog.alert("새 비밀번호를 입력하세요.");
|
||||
return;
|
||||
}
|
||||
if($("#password-form input[name='confirmPassword']").val() == ""){
|
||||
dialog.alert("새 비밀번호 확인을 입력하세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
let match = Array.from(document.querySelectorAll("input[name='password'],input[name='confirmPassword']"))
|
||||
.map(input => input.value)
|
||||
.reduce((total, current) => total == current);
|
||||
if (!match) {
|
||||
dialog.alert({
|
||||
content:"새 비밀번호와 새 비밀번호 확인이 다릅니다.",
|
||||
onClose:function(){
|
||||
document.querySelector("input[name='confirmPassword']").focus();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
savePassword();
|
||||
}
|
||||
|
||||
function savePassword(){
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/user/changePassword.do"),
|
||||
data : {
|
||||
userIDs : MY_INFO.id,
|
||||
password : $("#password-form input[name='password']").val(),
|
||||
currentPassword : $("#password-form input[name='currentPassword']").val(),
|
||||
init : false
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
dialog.alert("비밀번호 변경에 성공하였습니다.");
|
||||
dialog.close("changePasswordDialog");
|
||||
} else {
|
||||
dialog.alert("비밀번호 변경에 실패하였습니다.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,57 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<!-- Page Body -->
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0">
|
||||
<thead>
|
||||
<tr><th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" aria-sort="ascending" style="">시군구</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="">기관</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" style="">부서</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sggDeptList">
|
||||
</tbody>
|
||||
<template id="sggDeptRow">
|
||||
<tr data-key="{dataKey}">
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{SGG_CD}</td>
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{SGG_NM}</td>
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{INST_CD}</td>
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{INST_NM}</td>
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{DEPT_CD}</td>
|
||||
<td onclick="sggDepts.setCurrent('{dataKey}')">{DEPT_NM}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="sggDeptNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">부서정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var sggDepts = new Dataset({
|
||||
keymapper: info => info.dataKey,
|
||||
onDatasetChange: obj => {
|
||||
let empty = sggDepts.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("sggDeptNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
||||
sggDepts.inStrings(document.getElementById("sggDeptRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
|
||||
$("#sggDeptList").html(trs.join());
|
||||
},
|
||||
onCurrentChange: item => {
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.dataKey;
|
||||
$("#sggDeptList").setCurrentRow(key);
|
||||
}
|
||||
});
|
||||
|
||||
function getSelectedDept() {
|
||||
return sggDepts.getCurrent();
|
||||
}
|
||||
|
||||
sggDepts.setData(${sggDepts});
|
||||
//# sourceURL=select-sggDepts.jsp
|
||||
</script>
|
@ -0,0 +1,126 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">사용자</c:set>
|
||||
<div class="card" data-doctx="select-user"><!-- Page Body -->
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<div>
|
||||
<div class="input-group" id="DataTables_Table_0_length">
|
||||
<select name="by" onchange="userSelector.find('term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="userName">이름</option>
|
||||
<option value="userAccount">계정</option>
|
||||
</select>
|
||||
<input name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="userSelector.search();" class="btn btn-primary">찾기</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" >
|
||||
<thead name="userThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="userSelector.dataset.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >시군구명</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >기관명</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >부서명</th>
|
||||
<th class="sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Full name: activate to sort column descending" >계정</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" >등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody name="userList">
|
||||
</tbody>
|
||||
<template name="userRow">
|
||||
<tr data-key="{USER_ID}">
|
||||
<td style="text-align:center;"><input value="{USER_ID}" onchange="userSelector.dataset.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{SGG_NM}</td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{INST_NM}</td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{DEPT_NM}</td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{USER_ACNT}</td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{USER_NM}</td>
|
||||
<td onclick="userSelector.setCurrent('{USER_ID}')" ondblclick="userSelector.getInfo({})">{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template name="userNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="7" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label name="userPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul name="userPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/ Page Body -->
|
||||
<script >
|
||||
var userSelector = newUserControl("[data-doctx='select-user']");
|
||||
|
||||
function getSelectedUser() {
|
||||
let selected = userSelector.dataset.getKeys("selected");
|
||||
if (selected.length < 1)
|
||||
return dialog.alert("사용자를 선택하십시오.");
|
||||
else
|
||||
return selected;
|
||||
}
|
||||
|
||||
userSelector.search = () => {
|
||||
userSelector.query = {
|
||||
by: userSelector.find("name","by").value,
|
||||
term: userSelector.find("name","term").value
|
||||
};
|
||||
userSelector.load(1);
|
||||
}
|
||||
|
||||
userSelector.onDatasetChange = obj => {
|
||||
let list = userSelector.dataset;
|
||||
let empty = list.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[userSelector.find("name","userNotFound").innerHTML] :
|
||||
list.inStrings(userSelector.find("name","userRow").innerHTML);
|
||||
userSelector.find("name","userList").innerHTML = trs.join("");
|
||||
userSelector.querySelector("[name='userThead'] th input[type='checkbox']").checked = false;
|
||||
|
||||
$(userSelector.selector("[name='userPaging']")).setPaging({
|
||||
list: list,
|
||||
prefix: userSelector.prefix,
|
||||
start: obj.userStart,
|
||||
totalSize: obj.userTotal,
|
||||
fetchSize: obj.userFetch,
|
||||
func:"userSelector.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
userSelector.onCurrentChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.USER_ID;
|
||||
$(userSelector.selector("[name='userList']")).setCurrentRow(key);
|
||||
};
|
||||
|
||||
userSelector.onSelectionChange = selected => {
|
||||
let list = userSelector.dataset;
|
||||
let keys = selected.map(e => list.getKey(e));
|
||||
$(userSelector.selector("[name='userList'] input[type='checkbox']")).each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
};
|
||||
|
||||
$(userSelector.selector("[name='term']")).onEnterPress(userSelector.search);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
userSelector.setData({
|
||||
userList:${userList},
|
||||
userStart:${userStart},
|
||||
userFetch:${userFetch},
|
||||
userTotal:${userTotal}
|
||||
});
|
||||
});
|
||||
//# sourceURL=select-user.jsp
|
||||
</script>
|
@ -0,0 +1,246 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">기관 정보</c:set>
|
||||
<!-- Page Body -->
|
||||
<div class="d-flex flex-column flex-grow-1">
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">${prefixName}</h5>
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<%--div>
|
||||
<div class="input-group" id="${infoPrefix}-query">
|
||||
<select id="${infoPrefix}by" name="by" onchange="document.getElementById('${infoPrefix}term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
||||
<option value="sggName">이름</option>
|
||||
<option value="sggID">아이디</option>
|
||||
</select>
|
||||
<input id="${infoPrefix}term" name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
</div>
|
||||
</div--%>
|
||||
<div>
|
||||
<%--button onclick="searchSggs();" class="btn btn-primary">찾기</button--%>
|
||||
<button onclick="sggDeptControl.newSgg();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveSggs" onclick="removeSggs();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="sggThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="sggDeptControl.sggs.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="text-center sorting sorting_asc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2" aria-sort="ascending">시군구</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="2">기관</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sggList">
|
||||
</tbody>
|
||||
<template id="sggRow">
|
||||
<tr data-key="{SGG_CD}"{notUsed}>
|
||||
<td style="text-align:center;"><input value="{SGG_CD}" onchange="sggDeptControl.sggs.select('{SGG_CD}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="sggDeptControl.sggs.setCurrent('{SGG_CD}')" ondblclick="sggDeptControl.sggs.getInfo({})">{SGG_CD}</td>
|
||||
<td onclick="sggDeptControl.sggs.setCurrent('{SGG_CD}')" ondblclick="sggDeptControl.sggs.getInfo({})">{SGG_NM}</td>
|
||||
<td onclick="sggDeptControl.sggs.setCurrent('{SGG_CD}')" ondblclick="sggDeptControl.sggs.getInfo({})">{INST_CD}</td>
|
||||
<td onclick="sggDeptControl.sggs.setCurrent('{SGG_CD}')" ondblclick="sggDeptControl.sggs.getInfo({})">{INST_NM}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="sggNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName}를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="sggPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="sggPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:49%;">
|
||||
<h5 class="mt-3">부서 정보</h5>
|
||||
<div class="d-flex flex-row justify-content-end p-3">
|
||||
<div>
|
||||
<button id="btnAddDept" onclick="sggDeptControl.newDept();" class="btn btn-primary">+ 추가</button>
|
||||
<button id="btnRemoveDepts" onclick="removeDepts();" class="btn btn-primary">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
||||
<thead id="deptThead">
|
||||
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input id="deptToggler" onchange="sggDeptControl.depts.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1">부서코드</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1">부서이름</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1">전화번호</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="deptList">
|
||||
</tbody>
|
||||
<template id="deptRow">
|
||||
<tr data-key="{DEPT_CD}"{notUsed}>
|
||||
<td style="text-align:center;"><input value="{DEPT_CD}" onchange="sggDeptControl.depts.select('{DEPT_CD}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td onclick="sggDeptControl.depts.setCurrent('{DEPT_CD}')" ondblclick="sggDeptControl.depts.getInfo({})">{DEPT_CD}</td>
|
||||
<td onclick="sggDeptControl.depts.setCurrent('{DEPT_CD}')" ondblclick="sggDeptControl.depts.getInfo({})">{DEPT_NM}</td>
|
||||
<td onclick="sggDeptControl.depts.setCurrent('{DEPT_CD}')" ondblclick="sggDeptControl.depts.getInfo({})">{DEPT_TELNO}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="deptNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="4" class="dataTables_empty text-center">부서 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label id="deptPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="deptPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var sggDeptControl = new SggDeptControl();
|
||||
sggDeptControl.sggs.query = {includeAll: true};
|
||||
<%--
|
||||
function searchSggs() {
|
||||
sggDeptControl.sggs.query = {
|
||||
by:$("#${infoPrefix}-query [name='by']").val(),
|
||||
term:$("#${infoPrefix}-query [name='term']").val()
|
||||
includeAll: true
|
||||
};
|
||||
sggDeptControl.sggs.load(1);
|
||||
}--%>
|
||||
|
||||
function removeSggs() {
|
||||
dialog.alert({
|
||||
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
||||
onOK:() => {
|
||||
sggDeptControl.sggs.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeDepts() {
|
||||
dialog.alert({
|
||||
content:"선택한 코드를 삭제하시겠습니까?",
|
||||
onOK:() => {
|
||||
sggDeptControl.depts.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderSggList() {
|
||||
let sggList = sggDeptControl.sggs.dataset;
|
||||
let empty = sggList.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("sggNotFound").innerHTML] : <%-- from template#sggNotFound --%>
|
||||
sggList.inStrings(
|
||||
document.getElementById("sggRow").innerHTML,
|
||||
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
|
||||
); <%-- from template#sggRow --%>
|
||||
$("#sggList").html(trs.join());
|
||||
$("#sggThead").find("th input[type='checkbox']").prop("checked", false);
|
||||
$("#deptThead").find("th input[type='checkbox']").prop("checked", false);
|
||||
}
|
||||
|
||||
sggDeptControl.sggs.onDatasetChange = obj => {
|
||||
renderSggList();
|
||||
|
||||
$("#sggPaging").setPaging({
|
||||
list:sggDeptControl.sggs.dataset,
|
||||
prefix:sggDeptControl.sggs.prefix,
|
||||
start:obj.sggStart,
|
||||
totalSize:obj.sggTotal,
|
||||
fetchSize:obj.sggFetch,
|
||||
func:"sggDeptControl.sggs.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
sggDeptControl.sggs.onCurrentChange = item => {
|
||||
$("#btnAddDept").prop("disabled", !item);
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.SGG_CD;
|
||||
$("#sggList").setCurrentRow(key);
|
||||
sggDeptControl.getDepts({includeAll: true});
|
||||
};
|
||||
|
||||
sggDeptControl.sggs.onSelectionChange = selected => {
|
||||
let sggList = sggDeptControl.sggs.dataset;
|
||||
let keys = selected.map(e => sggList.getKey(e));
|
||||
$("#sggList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnRemoveSggs").prop("disabled", keys.length < 1);
|
||||
};
|
||||
|
||||
function renderDeptList() {
|
||||
let deptList = sggDeptControl.depts.dataset;
|
||||
let empty = deptList.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("deptNotFound").innerHTML] : <%-- from template#sggNotFound --%>
|
||||
deptList.inStrings(
|
||||
document.getElementById("deptRow").innerHTML,
|
||||
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
|
||||
); <%-- from template#sggRow --%>
|
||||
$("#deptList").html(trs.join());
|
||||
$("#deptToggler").prop("checked", false);
|
||||
}
|
||||
|
||||
sggDeptControl.depts.onDatasetChange = obj => {
|
||||
renderDeptList();
|
||||
|
||||
$("#deptPaging").setPaging({
|
||||
list:sggDeptControl.depts.dataset,
|
||||
prefix:sggDeptControl.depts.prefix,
|
||||
start:obj ? obj.deptStart : -1,
|
||||
totalSize:obj ? obj.deptTotal : 0,
|
||||
fetchSize:obj ? obj.deptFetch : 10,
|
||||
func:"sggDeptControl.depts.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
sggDeptControl.depts.onCurrentChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let data = item.data;
|
||||
let key = data.DEPT_CD;
|
||||
$("#deptList").setCurrentRow(key);
|
||||
};
|
||||
|
||||
sggDeptControl.depts.onSelectionChange = selected => {
|
||||
let deptList = sggDeptControl.depts.dataset;
|
||||
let keys = selected.map(e => deptList.getKey(e));
|
||||
$("#deptList input[type='checkbox']").each(function() {
|
||||
let checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
let sgg = sggDeptControl.sggs.getCurrent();
|
||||
sgg = sgg ? sgg.USE_YN : "N";
|
||||
|
||||
$("#btnAddDept").prop("disabled", "N" == sgg);
|
||||
$("#btnRemoveDepts").prop("disabled", selected.length < 1);
|
||||
};
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
sggDeptControl.sggs.setData({
|
||||
sggList:${sggList},
|
||||
sggStart:${sggStart},
|
||||
sggFetch:${sggFetch},
|
||||
sggTotal:${sggTotal}
|
||||
});
|
||||
sggDeptControl.depts.setData({
|
||||
deptList:${deptList},
|
||||
deptStart:${deptStart},
|
||||
deptFetch:${deptFetch},
|
||||
deptTotal:${deptTotal}
|
||||
});
|
||||
|
||||
<%-- $("#${infoPrefix}term").onEnterPress(searchSggs); --%>
|
||||
});
|
||||
//# sourceURL=sgg-dept.jsp
|
||||
</script>
|
@ -0,0 +1,122 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="sgg-form">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">시군구</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="row justify-content-between" style="padding: 0 .75rem;">
|
||||
<input name="sggID" type="text" required data-map="SGG_CD" maxlength="5" class="form-control" style="width: 28%;" placeholder="시군구 코드" />
|
||||
<input name="sggName" type="text" required data-map="SGG_NM" maxlength="60" class="form-control" style="width: 70%;" placeholder="시군구 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">기관</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="row justify-content-between" style="padding: 0 .75rem;">
|
||||
<select name="instType" data-map="INST_SE_CD" class="form-control" style="width: 24%;">
|
||||
<option value="">구분</option>
|
||||
<option value="01">시청</option>
|
||||
<option value="02">구청</option>
|
||||
<option value="03">군청</option>
|
||||
<option value="04">도청</option>
|
||||
<option value="05">출장소</option>
|
||||
<option value="06">사무소</option>
|
||||
</select>
|
||||
<input name="instCode" type="text" data-map="INST_CD" maxlength="7" class="form-control" style="width: 25%;" placeholder="기관 코드"/>
|
||||
<input name="instName" type="text" data-map="INST_NM" maxlength="100" class="form-control" style="width: 48%;" placeholder="기관 이름"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">주소</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="row justify-content-between" style="padding: 0 .75rem;">
|
||||
<input name="instAddress" type="text" data-map="INST_ADDR" maxlength="200" class="form-control" placeholder="주소"/>
|
||||
<input name="instDetailAddress" type="text" data-map="INST_DADDR" maxlength="200" class="form-control" style="margin: .5rem 0;" placeholder="상세주소"/>
|
||||
<input name="instZipCode" type="text" data-map="INST_ZIP" maxlength="6" class="form-control" style="width: 32%;" placeholder="기관 우편번호"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">직인 파일</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="row justify-content-between" style="padding: 0 .75rem;">
|
||||
<input name="officialSealFilepath" type="text" data-map="OFFCS_FILE_PATH" maxlength="200" class="form-control" placeholder="직인 파일경로"/>
|
||||
<input name="officialSealFilename" type="text" data-map="OFFCS_FILE_NM" maxlength="100" class="form-control" style="margin: .5rem 0;" placeholder="직인 파일이름"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="createdBy">등록자</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" data-map="RGTR" readonly class="form-control" placeholder="등록자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">등록일자</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" data-map="REG_DT" readonly class="form-control" placeholder="등록일자"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end">사용여부</label>
|
||||
<div class="col-sm-9" style="padding:.5em .7em;">
|
||||
<input name="useYN" type="hidden" data-map="USE_YN" />
|
||||
<span id="sggInUse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-sm-12" style="text-align:right;">
|
||||
<button onclick="saveSgg();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
var sggFields = new FormFields("#sgg-form");
|
||||
|
||||
sggDeptControl.sggs.setInfo = obj => {
|
||||
let info = obj.data;
|
||||
sggFields.set(sggDeptControl.sggs, obj);
|
||||
let create = isEmpty(info.SGG_CD);
|
||||
$("input[name='sggID']").prop("readonly", !create);
|
||||
$("#sgg-form input").onEnterPress(saveSgg);
|
||||
$("#sggInUse").html(info.USE_YN == "Y" ? "사용 중" : "사용하지 않음");
|
||||
|
||||
document.querySelector("input[name='" + (create ? "sggID" : "sggName") + "']").focus();
|
||||
}
|
||||
|
||||
sggDeptControl.sggs.onModify = (changed) => {
|
||||
if (["SGG_NM"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
renderSggList();
|
||||
sggDeptControl.sggs.dataset.setState();
|
||||
}
|
||||
|
||||
function saveSgg() {
|
||||
if (!$("#sgg-form input").validInputs()) return;
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 시군구 정보를 저장하시겠습니까?",
|
||||
onOK:() => sggDeptControl.sggs.save(sggFields.get())
|
||||
});
|
||||
}
|
||||
//# sourceURL=sgg-info.jsp
|
||||
</script>
|
@ -0,0 +1,309 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="infoPrefix-form" data-doctx="user">
|
||||
<input type="hidden" name="cntnSeCd" data-map="CNTN_SE_CD" />
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 text-sm-end col-form-label required">
|
||||
사용자구분
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="userSeCd" class="form-select" data-map="USER_SE_CD"
|
||||
required title="사용자구분">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="col-form-label required">
|
||||
시군구/기관 및 부서
|
||||
</label>
|
||||
<select name="institute" class="form-select no-bgi" data-map="NSTT_CD"
|
||||
required title="시군구/기관 및 부서" disabled>
|
||||
<option value=""></option>
|
||||
<c:forEach items="${allOgdpList}" var="item">
|
||||
<option value="${item.INST_CD}">${item.SGG_NM} / ${item.INST_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<select name="deptCode" class="form-select no-bgi" data-map="DEPT_CD"
|
||||
required title="시군구/기관 및 부서" disabled>
|
||||
<option value=""></option>
|
||||
<c:forEach items="${allOgdpList}" var="item">
|
||||
<option value="${item.DEPT_CD}">${item.DEPT_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="orgID" data-map="ORG_ID" />
|
||||
|
||||
<div class="dropdown d-inline-flex">
|
||||
<button type="button"
|
||||
id="btnSelectOgdp"
|
||||
class="btn btn-md btn-secondary dropdown-toggle"
|
||||
data-bs-toggle="dropdown"
|
||||
>선택</button>
|
||||
<ul class="dropdown-menu oy-auto mh-px-300">
|
||||
<c:forEach items="${ableOgdpList}" var="item">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
onclick="setOgdpCodeValues('${item.INST_CD}','${item.DEPT_CD}','${item.SGG_CD}')">
|
||||
${item.OGDP_NM}
|
||||
</a>
|
||||
</li>
|
||||
</c:forEach>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end required" for="account"
|
||||
>계정</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="id" type="hidden" data-map="USER_ID" />
|
||||
<input name="account" type="text" required data-map="USER_ACNT" class="form-control" placeholder="prefixName 계정" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end required" for="name"
|
||||
>이름</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input name="name" type="text" required data-map="USER_NM" class="form-control" placeholder="prefixName 이름" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end required" for="password"
|
||||
>비밀번호</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input name="password" type="password" required class="form-control" placeholder="비밀번호" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end required" for="confirmPassword"
|
||||
>비밀번호 확인</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input name="confirmPassword" type="password" required class="form-control" placeholder="비밀번호 확인" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end required" for="emailAddress"
|
||||
>이메일 주소</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input name="emailAddress" type="email" required data-map="EML_ADRS" class="form-control" placeholder="이메일 주소" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 select2-primary">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="phoneNo"
|
||||
>전화번호(유선)</label
|
||||
>
|
||||
<div class="col-sm-9">
|
||||
<input name="phoneNo" type="text" data-map="TELNO" class="form-control phone-mask" placeholder="000-0000-0000" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="faxNo">팩스</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="faxNo" type="text" data-map="FXNO" class="form-control phone-mask" placeholder="000-0000-0000"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="positionName">직위</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="positionName" type="text" data-map="POS_NM" class="form-control" placeholder="직위"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="mobilePhoneNo">휴대전화</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="mobilePhoneNo" type="text" data-map="MBL_TELNO" class="form-control" placeholder="휴대전화"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label text-sm-end" for="status">상태</label>
|
||||
<div class="col-sm-9">
|
||||
<c:if test='${currentUser.hasAuthorities("ROLE_ADMIN")}'>
|
||||
<div class="form-check form-check-inline mt-3">
|
||||
<input name="status" value="P" type="radio" data-map="STTS" class="form-check-input"/>
|
||||
<label class="form-check-label" for="approved">승인</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="status" value="A" type="radio" data-map="STTS" class="form-check-input"/>
|
||||
<label class="form-check-label" for="applied">신청</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="status" value="D" type="radio" data-map="STTS" class="form-check-input"/>
|
||||
<label class="form-check-label" for="removed">삭제</label>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test='${!currentUser.hasAuthorities("ROLE_ADMIN")}'>
|
||||
<input name="status" type="hidden" data-map="STTS" class="form-control" placeholder="상태"/>
|
||||
<label class="col-form-label" for=STTS></label>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 justify-content-end">
|
||||
<div class="col-md-6">
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-sm-3">
|
||||
<button onclick="saveinfoPrefix();" type="button" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<datalist id="allOgdpList">
|
||||
<c:forEach items="${allOgdpList}" var="item">
|
||||
<option value="${item.OGDP_CD}">${item.OGDP_NM}</option>
|
||||
</c:forEach>
|
||||
</datalist>
|
||||
|
||||
<datalist id="userSeCdList">
|
||||
<c:forEach items="${CMN008List}" var="item">
|
||||
<option value="${item.code}">${item.value}</option>
|
||||
</c:forEach>
|
||||
</datalist>
|
||||
|
||||
<script type="text/javascript">
|
||||
var infoPrefixFields = new FimsFormFields("#infoPrefix-form");
|
||||
|
||||
infoPrefixCtrl.setInfo = (obj) => {
|
||||
let create = isEmpty(obj.data.USER_ACNT);
|
||||
if(create){
|
||||
obj.data.CNTN_SE_CD = "01";
|
||||
}
|
||||
|
||||
let isInnerUser = (obj.data.CNTN_SE_CD == "01");
|
||||
if(!isInnerUser){
|
||||
$("#infoPrefix-form select[name='userSeCd']").html($("#userSeCdList option[value='21']").clone());
|
||||
$("#btnSelectOgdp").attr("hidden","hidden");
|
||||
} else {
|
||||
$("#infoPrefix-form select[name='userSeCd']").html($("#userSeCdList option[value!='21']").clone());
|
||||
$("#btnSelectOgdp").removeAttr("hidden");
|
||||
}
|
||||
|
||||
infoPrefixFields.set(infoPrefixCtrl,obj);
|
||||
|
||||
$("#infoPrefix-form input[name='account']").prop("readonly", !create);
|
||||
$("#infoPrefix-form input[name='name']").prop("readonly", !create);
|
||||
|
||||
if(create){
|
||||
$("#infoPrefix-form :radio[name='status'][value='D']").attr("hidden","hidden");
|
||||
$("#infoPrefix-form label[for='removed']").attr("hidden","hidden");
|
||||
} else {
|
||||
$("#infoPrefix-form :radio[name='status'][value='D']").removeAttr("hidden");
|
||||
$("#infoPrefix-form label[for='removed']").removeAttr("hidden");
|
||||
}
|
||||
|
||||
$("#infoPrefix-form input[type='password']").each(function(){
|
||||
let password = $(this).prop("required", create);
|
||||
let div = password.parent().parent().parent();
|
||||
if (create) {
|
||||
div.removeAttr("hidden");
|
||||
} else {
|
||||
div.attr("hidden","hidden");
|
||||
}
|
||||
});
|
||||
|
||||
let positionNameDiv = $("#infoPrefix-form input[name='positionName']").parent().parent().parent();
|
||||
if (isInnerUser) {
|
||||
positionNameDiv.removeAttr("hidden");
|
||||
} else {
|
||||
positionNameDiv.attr("hidden","hidden");
|
||||
}
|
||||
|
||||
let mobilePhoneNoDiv = $("#infoPrefix-form input[name='mobilePhoneNo']").parent().parent().parent();
|
||||
if (!isInnerUser) {
|
||||
mobilePhoneNoDiv.removeAttr("hidden");
|
||||
} else {
|
||||
mobilePhoneNoDiv.attr("hidden","hidden");
|
||||
}
|
||||
|
||||
let stts = "";
|
||||
if(obj.data.STTS == "D"){
|
||||
stts = "삭제";
|
||||
} else if(obj.data.STTS == "P"){
|
||||
stts = "승인";
|
||||
} else {
|
||||
stts = "신청";
|
||||
}
|
||||
$("#infoPrefix-form label[for='STTS']").html(stts);
|
||||
|
||||
$("#infoPrefix-form").find("input,select")
|
||||
.change(function() {
|
||||
let input = $(this),
|
||||
name = input.attr("data-map"),
|
||||
val = input.val();
|
||||
infoPrefixCtrl.setValue(name, val);
|
||||
})
|
||||
.onEnterPress(saveinfoPrefix);
|
||||
|
||||
document.querySelector("#infoPrefix-form input[name='" + (create ? "account" : "name") + "']").focus();
|
||||
}
|
||||
|
||||
infoPrefixCtrl.onModify = (changed) => {
|
||||
if (["USER_NM", "EML_ADRS", "MBL_TELNO"].filter(e => changed.includes(e)).length < 1)
|
||||
return;
|
||||
|
||||
infoPrefixCtrl.renderList();
|
||||
infoPrefixCtrl.dataset.setState();
|
||||
}
|
||||
|
||||
function saveinfoPrefix() {
|
||||
if (!$("#infoPrefix-form").find("input,select").validInputs()) return;
|
||||
|
||||
let match = Array.from(document.querySelectorAll("#infoPrefix-form input[type='password']"))
|
||||
.map(input => input.value)
|
||||
.reduce((total, current) => total == current);
|
||||
if (!match) {
|
||||
dialog.alert({
|
||||
content:"비밀번호와 비밀번호 확인이 다릅니다.",
|
||||
onClose:function(){
|
||||
document.querySelector("#infoPrefix-form input[name='confirmPassword']").focus();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
dialog.alert({
|
||||
content:"현재 prefixName 정보를 저장하시겠습니까?",
|
||||
onOK:() => {
|
||||
infoPrefixCtrl.save(infoPrefixFields.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setOgdpCodeValues(institute, deptCode, sggCd){
|
||||
$("#infoPrefix-form [name='institute']").val(institute).trigger("change");
|
||||
$("#infoPrefix-form [name='deptCode']").val(deptCode).trigger("change");
|
||||
$("#infoPrefix-form [name='orgID']").val(sggCd).trigger("change");
|
||||
}
|
||||
|
||||
//# sourceURL=user-info.jsp
|
||||
</script>
|
@ -0,0 +1,174 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">사용자</c:set>
|
||||
<div data-doctx="user" class="d-flex flex-column flex-grow-1"><!-- Page Body -->
|
||||
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
|
||||
<div class="d-flex flex-row justify-content-between p-3">
|
||||
<div class="d-flex flex-grow-1 me-5">
|
||||
<div class="input-group me-3 w-px-400">
|
||||
<select name="by" onchange="userCtrl.find('name', 'term').focus();" class="form-select">
|
||||
<option value="userName">이름</option>
|
||||
<option value="userAccount">계정</option>
|
||||
</select>
|
||||
<input name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
||||
|
||||
</div>
|
||||
<label for="userStatus" class="form-label fw-bold px-3 d-flex flex-wrap align-content-center justify-content-center">상태</label>
|
||||
<select name="status" class="form-select">
|
||||
<option value="">전체</option>
|
||||
<option value="A">신청</option>
|
||||
<option value="P">승인</option>
|
||||
<option value="D">삭제</option>
|
||||
</select>
|
||||
<label for="type" class="form-label fw-bold px-3 d-flex flex-wrap align-content-center justify-content-center">접속구분</label>
|
||||
<select name="type" class="form-select">
|
||||
<option value="">전체</option>
|
||||
<c:forEach items="${CMN009List}" var="item">
|
||||
<option value="${item.code}">${item.value}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="userCtrl.search();" class="btn btn-primary">찾기</button>
|
||||
<button onclick="userCtrl.newInfo();" class="btn btn-primary">+ 추가</button>
|
||||
<button onclick="userCtrl.removeUsers();" class="btn btn-primary enable-onfound">- 제거</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead name="userThead">
|
||||
<tr><th tabindex="0" style="width: 158.828px; text-align:center;"><input onchange="userCtrl.select(this.checked);" type="checkbox" class="form-check-input"></th>
|
||||
<th class="sorting" style="width: 146.156px;">상태</th>
|
||||
<th class="sorting" style="width: 146.156px;">사용자구분</th>
|
||||
<th class="sorting" style="width: 146.156px;">기관</th>
|
||||
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">계정</th>
|
||||
<th class="sorting" style="width: 146.156px;">이름</th>
|
||||
<th class="sorting" style="width: 146.156px;">부서</th>
|
||||
<th class="sorting" style="width: 195.688px;">이메일</th>
|
||||
<th class="sorting" style="width: 160.141px;">전화번호(유선)</th>
|
||||
<th class="sorting" style="width: 230.469px;">등록일자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody name="userList">
|
||||
</tbody>
|
||||
<template name="userRow">
|
||||
<tr data-key="{USER_ID}">
|
||||
<td style="text-align:center;"><input value="{USER_ID}" onchange="userCtrl.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
|
||||
<td {onclick} {ondblclick}>{STTS_NM}</td>
|
||||
<td {onclick} {ondblclick}>{USER_SE_NM}</td>
|
||||
<td {onclick} {ondblclick}>{INST_NM}</td>
|
||||
<td {onclick} {ondblclick}>{USER_ACNT}</td>
|
||||
<td {onclick} {ondblclick}>{USER_NM}</td>
|
||||
<td {onclick} {ondblclick}>{DEPT_NM}</td>
|
||||
<td {onclick} {ondblclick}>{EML_ADRS}</td>
|
||||
<td {onclick} {ondblclick}>{TELNO}</td>
|
||||
<td {onclick} {ondblclick}>{REG_DT}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template name="userNotFound">
|
||||
<tr class="odd">
|
||||
<td valign="top" colspan="10" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
<div class="d-flex flex-row p-3 justify-content-between">
|
||||
<label name="userPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul name="userPaging" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Page Body -->
|
||||
<script >
|
||||
var userCtrl = newUserControl();
|
||||
|
||||
userCtrl.search = () => {
|
||||
userCtrl.query = {
|
||||
by: userCtrl.find('name', "by").value,
|
||||
term: userCtrl.find('name', "term").value,
|
||||
status: userCtrl.find('name', "status").value,
|
||||
type: userCtrl.find('name', "type").value,
|
||||
};
|
||||
|
||||
if(userCtrl.query.by == "userAccount"){
|
||||
userCtrl.query.term = userCtrl.query.term.toUpperCase();
|
||||
}
|
||||
|
||||
userCtrl.load(1);
|
||||
}
|
||||
|
||||
userCtrl.removeUsers= () => {
|
||||
dialog.alert({
|
||||
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
||||
onOK:() => {
|
||||
userCtrl.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
userCtrl.renderList = () => {
|
||||
let userList = userCtrl.dataset;
|
||||
let empty = userList.empty;
|
||||
|
||||
let trs = empty ?
|
||||
[document.getElementById("userNotFound").innerHTML] : <%-- from template#userNotFound --%>
|
||||
userList.inStrings(
|
||||
userCtrl.find('name', "userRow").innerHTML, <%-- from template#userRow --%>
|
||||
(str, dataItem) => str
|
||||
.replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
|
||||
.replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
|
||||
);
|
||||
userCtrl.find('name', "userList").innerHTML = trs.join("");
|
||||
userCtrl.find("[name='userThead'] th input[type='checkbox']").checked = false;
|
||||
}
|
||||
|
||||
userCtrl.onDatasetChange = obj => {
|
||||
userCtrl.renderList();
|
||||
|
||||
$(userCtrl.selector("[name='userPaging']")).setPaging({
|
||||
list:userCtrl.dataset,
|
||||
prefix:userCtrl.prefix,
|
||||
start:obj.userStart,
|
||||
totalSize:obj.userTotal,
|
||||
fetchSize:obj.userFetch,
|
||||
func:"userCtrl.load({index})"
|
||||
});
|
||||
};
|
||||
|
||||
userCtrl.onCurrentChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
let key = item.data.USER_ID;
|
||||
$(userCtrl.selector("[name='userList']")).setCurrentRow(key);
|
||||
};
|
||||
|
||||
userCtrl.onSelectionChange = selected => {
|
||||
let userList = userCtrl.dataset;
|
||||
let keys = selected.map(e => userList.getKey(e));
|
||||
|
||||
userCtrl.findAll("[name='userList'] input[type='checkbox']")
|
||||
.forEach(node => {
|
||||
node.checked = keys.includes(node.value);
|
||||
});
|
||||
|
||||
userCtrl.findAll(".enable-onfound")
|
||||
.forEach(node => {
|
||||
node.disabled = keys.length < 1;
|
||||
});
|
||||
};
|
||||
|
||||
$(userCtrl.selector("[name='term']")).onEnterPress(userCtrl.search);
|
||||
|
||||
$(function(){
|
||||
${onload}
|
||||
userCtrl.setData({
|
||||
userList:${userList},
|
||||
userStart:${userStart},
|
||||
userFetch:${userFetch},
|
||||
userTotal:${userTotal}
|
||||
});
|
||||
});
|
||||
//# sourceURL=user-main.jsp
|
||||
</script>
|
Loading…
Reference in New Issue