formfields 수정

main
이범준 6 months ago
parent 3bd0574964
commit 902b27cc92

@ -1,6 +1,6 @@
<%@ 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">
<form id="actioninfoPrefix-form">
<div class="row g-3">
<div class="col-md-12">
<div class="row">
@ -40,39 +40,32 @@
</form>
<script type="text/javascript">
var infoPrefixFields = new FormFields("#infoPrefix-form");
var actioninfoPrefixFields = new FormFields("#actioninfoPrefix-form");
infoPrefixControl.groups.setInfo = obj => {
infoPrefixFields.set(obj);
actioninfoPrefixControl.groups.setInfo = obj => {
actioninfoPrefixFields.set(actioninfoPrefixControl, obj);
let create = isEmpty(obj.data.GRP_ID);
$("input[name='id']").prop("readonly", !create);
$("#infoPrefix-form input")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
val = input.val();
infoPrefixControl.groups.setValue(name, val);
})
.onEnterPress(saveinfoPrefix);
$("#actioninfoPrefix-form input").onEnterPress(saveinfoPrefix);
document.querySelector("input[name='" + (create ? "id" : "name") + "']").focus();
}
infoPrefixControl.groups.onModify = (changed) => {
actioninfoPrefixControl.groups.onModify = (changed) => {
if (["GRP_NM"].filter(e => changed.includes(e)).length < 1)
return;
renderinfoPrefixList();
infoPrefixControl.groups.dataset.setState();
renderactioninfoPrefixList();
actioninfoPrefixControl.groups.dataset.setState();
}
function saveinfoPrefix() {
if (!$("#infoPrefix-form input").validInputs()) return;
if (!$("#actioninfoPrefix-form input").validInputs()) return;
dialog.alert({
content:"현재 prefixName 정보를 저장하시겠습니까?",
onOK:() => {
infoPrefixControl.groups.save(infoPrefixFields.get());
actioninfoPrefixControl.groups.save(actioninfoPrefixFields.get());
}
});
}

@ -1,97 +1,81 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<%--h4 id="pageTitle" class="fw-bold py-3 mb-4">페이지 제목</h4--%>
<c:set var="prefixName" scope="request">기능 그룹</c:set>
<c:set var="prefixName" scope="request">기능 그룹</c:set>
<!-- Page Body -->
<div class="card">
<div class="card-datatable text-nowrap">
<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 class="w-50 mx-3">
<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="DataTables_Table_0_length">
<select id="by" onchange="document.getElementById('term').focus();" aria-controls="DataTables_Table_0" class="form-select">
<option value="${infoPrefix}Name">기능그룹 이름</option>
<option value="${infoPrefix}ID">기능그룹 아이디</option>
<option value="${infoPrefix}Name">이름</option>
<option value="${infoPrefix}ID">아이디</option>
</select>
<input id="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.groups.newInfo();" class="btn btn-primary">+ 추가</button>
<button id="btnRemove${infoPrefix}s" onclick="remove${infoPrefix}s();" class="btn btn-primary">- 제거</button>
<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>
<tr>
<th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" class="text-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">기능그룹 아이디</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><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="${infoPrefix}List">
<tbody id="action${infoPrefix}List">
</tbody>
<template id="${infoPrefix}Row">
<template id="action${infoPrefix}Row">
<tr data-key="{GRP_ID}">
<td class="text-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>
<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="${infoPrefix}NotFound">
<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">
<span id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<ul id="${infoPrefix}Paging" class="pagination pagination-primary">
<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 class="w-50 mx-3">
<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="${infoPrefix}Control.addActions();" class="btn btn-primary">+ 추가</button>
<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>
<tr>
<th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" class="text-center">
<input id="actionToggler" 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">기능 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">등록일자</th>
<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 class="text-center">
<input value="{GRP_ID}-{ACTION}" onchange="${infoPrefix}Control.actions.select('{GRP_ID}-{ACTION}', this.checked);" type="checkbox" class="form-check-input">
</td>
<td onclick="${infoPrefix}Control.actions.setCurrent('{GRP_ID}-{ACTION}')">{ACTION}</td>
<td onclick="${infoPrefix}Control.actions.setCurrent('{GRP_ID}-{ACTION}">{REG_DT}</td>
<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">
@ -101,7 +85,7 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="actionPagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<label id="actionPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="actionPaging" class="pagination pagination-primary">
</ul>
</div>
@ -109,37 +93,23 @@
</div>
</div>
</div>
</div>
<!--/ Page Body -->
<script >
var action${infoPrefix}Control = new ActionGroupControl();
<hr class="my-5" />
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
<script>
var ${infoPrefix}Control = new ActionGroupControl();
function search${infoPrefix}s() {
${infoPrefix}Control.groups.query = {
function searchaction${infoPrefix}s() {
action${infoPrefix}Control.groups.query = {
by:$("#by").val(),
term:$("#term").val()
};
${infoPrefix}Control.groups.load(1);
action${infoPrefix}Control.groups.load(1);
}
function remove${infoPrefix}s() {
function removeaction${infoPrefix}s() {
dialog.alert({
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
onOK:() => {
${infoPrefix}Control.groups.remove();
action${infoPrefix}Control.groups.remove();
}
});
}
@ -148,57 +118,57 @@ function removeActions() {
dialog.alert({
content:"선택한 기능 URL을 삭제하시겠습니까?",
onOK:() => {
${infoPrefix}Control.removeActions();
action${infoPrefix}Control.removeActions();
}
});
}
function render${infoPrefix}List() {
let ${infoPrefix}List = ${infoPrefix}Control.groups.dataset;
let empty = ${infoPrefix}List.empty;
function renderaction${infoPrefix}List() {
let ${infoPrefix}List = action${infoPrefix}Control.groups.dataset;
let empty = action${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());
[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());
$("th input[type='checkbox']").prop("checked", false);
}
${infoPrefix}Control.onGroupListChange = obj => {
render${infoPrefix}List();
action${infoPrefix}Control.onGroupListChange = obj => {
renderaction${infoPrefix}List();
$("#${infoPrefix}Paging").setPaging({
list:${infoPrefix}Control.groups.dataset,
prefix:${infoPrefix}Control.groups.prefix,
$("#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:"${infoPrefix}Control.groups.load({index})"
func:"action${infoPrefix}Control.groups.load({index})"
});
};
${infoPrefix}Control.onCurrentGroupChange = item => {
action${infoPrefix}Control.onCurrentGroupChange = item => {
$("#btnAddActions").prop("disabled", !item);
if (!item) return;
let key = item.data.GRP_ID;
$("#${infoPrefix}List").setCurrentRow(key);
$("#action${infoPrefix}List").setCurrentRow(key);
};
${infoPrefix}Control.onGroupSelect = selected => {
let ${infoPrefix}List = ${infoPrefix}Control.groups.dataset;
action${infoPrefix}Control.onGroupSelect = selected => {
let ${infoPrefix}List = action${infoPrefix}Control.groups.dataset;
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
$("#${infoPrefix}List input[type='checkbox']").each(function() {
$("#action${infoPrefix}List input[type='checkbox']").each(function() {
let checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnRemove${infoPrefix}s").prop("disabled", keys.length < 1);
$("#btnRemoveaction${infoPrefix}s").prop("disabled", keys.length < 1);
};
${infoPrefix}Control.onActionListChange = obj => {
let ${infoPrefix}List = ${infoPrefix}Control.actions.dataset;
action${infoPrefix}Control.onActionListChange = obj => {
let ${infoPrefix}List = action${infoPrefix}Control.actions.dataset;
let empty = ${infoPrefix}List.empty;
let trs = empty ?
@ -208,16 +178,16 @@ ${infoPrefix}Control.onActionListChange = obj => {
$("#actionToggler").prop("checked", false);
$("#actionPaging").setPaging({
list:${infoPrefix}Control.actions.dataset,
prefix:${infoPrefix}Control.actions.prefix,
list:action${infoPrefix}Control.actions.dataset,
prefix:action${infoPrefix}Control.actions.prefix,
start:obj.actionStart,
totalSize:obj.actionTotal,
fetchSize:obj.actionFetch,
func:"${infoPrefix}Control.actions.load({index})"
func:"action${infoPrefix}Control.actions.load({index})"
});
};
${infoPrefix}Control.onCurrentActionChange = item => {
action${infoPrefix}Control.onCurrentActionChange = item => {
if (!item) return;
let data = item.data;
@ -225,8 +195,8 @@ ${infoPrefix}Control.onCurrentActionChange = item => {
$("#actionList").setCurrentRow(key);
};
${infoPrefix}Control.onActionSelect = selected => {
let ${infoPrefix}List = ${infoPrefix}Control.actions.dataset;
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);
@ -236,15 +206,16 @@ ${infoPrefix}Control.onActionSelect = selected => {
$("#btnRemoveActions").prop("disabled", keys.length < 1);
};
$("#term").onEnterPress(search${infoPrefix}s);
$("#term").onEnterPress(searchaction${infoPrefix}s);
$(function(){
${onload}
${infoPrefix}Control.groups.setData({
action${infoPrefix}Control.groups.setData({
${infoPrefix}List:${groupList},
${infoPrefix}Start:${groupStart},
${infoPrefix}Fetch:${groupFetch},
${infoPrefix}Total:${groupTotal}
});
});
//# sourceURL=actionGroup-main.jsp
</script>

@ -8,47 +8,44 @@
<div class="d-flex flex-row justify-content-between p-3">
<div>
<div class="input-group" id="DataTables_Table_0_length">
<select id="_groupBy" onchange="document.getElementById('_groupTerm').focus();" aria-controls="DataTables_Table_0" class="form-select">
<option value="${infoPrefix}Name">기능그룹 이름</option>
<option value="${infoPrefix}ID">기능그룹 아이디</option>
<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="_groupTerm" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
<input id="_actionGroupTerm" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
</div>
</div>
<div>
<button onclick="search${infoPrefix}s();" class="btn btn-primary">찾기</button>
<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>
<tr>
<th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" class="text-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">기능그룹 아이디</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><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="_${infoPrefix}List">
<tbody id="_action${infoPrefix}List">
</tbody>
<template id="${infoPrefix}Row">
<template id="_action${infoPrefix}Row">
<tr data-key="{GRP_ID}">
<td class="text-center">
<input value="{GRP_ID}" onchange="${infoPrefix}Control.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<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="${infoPrefix}NotFound">
<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">
<span id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<ul id="${infoPrefix}Paging" class="pagination pagination-primary">
<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>
@ -66,10 +63,10 @@ function getSelectedActionGroup() {
return selected;
}
function search${infoPrefix}s() {
function _search${infoPrefix}s() {
${infoPrefix}Control.groups.query = {
by:$("#_groupBy").val(),
term:$("#_groupTerm").val()
by:$("#_actionGroupBy").val(),
term:$("#_actionGroupTerm").val()
};
${infoPrefix}Control.groups.load(1);
}
@ -79,12 +76,12 @@ ${infoPrefix}Control.onGroupListChange = obj => {
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());
[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());
$("th input[type='checkbox']").prop("checked", false);
$("#${infoPrefix}Paging").setPaging({
$("#_action${infoPrefix}Paging").setPaging({
list:${infoPrefix}Control.groups.dataset,
prefix:${infoPrefix}Control.groups.prefix,
start:obj.${infoPrefix}Start,
@ -98,19 +95,19 @@ ${infoPrefix}Control.onCurrentGroupChange = item => {
if (!item) return;
let key = item.data.GRP_ID;
$("#_${infoPrefix}List").setCurrentRow(key);
$("#_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));
$("#_${infoPrefix}List input[type='checkbox']").each(function() {
$("#_action${infoPrefix}List input[type='checkbox']").each(function() {
let checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
};
$("#_groupTerm").onEnterPress(search${infoPrefix}s);
$("#_actionGroupTerm").onEnterPress(_search${infoPrefix}s);
$(function(){
${onload}

@ -2,49 +2,43 @@
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<div class="d-flex flex-row justify-content-end p-3">
<div>
<button id="btnAddActions" onclick="${infoPrefix}Control.addActions();" class="btn btn-primary">+ 추가</button>
<button id="btnRemoveActions" onclick="removeActions();" class="btn btn-primary">- 제거</button>
<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" class="text-center">
<input id="actionToggler" 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">기능 그룹 아이디</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><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="authActions">
<tbody id="authActionList">
</tbody>
<template id="authActionRow">
<tr data-key="{AUTH_ID}-{GRP_ID}">
<td class="text-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 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}')">{GRP_NM}</td>
<td onclick="${infoPrefix}Control.actions.setCurrent('{AUTH_ID}-{GRP_ID}">{REG_DT}</td>
</tr>
</template>
<template id="actionNotFound">
<template id="authActionNotFound">
<tr class="odd">
<td valign="top" colspan="4" class="dataTables_empty text-center">기능 그룹 정보를 찾지 못했습니다.</td>
<td valign="top" colspan="3" class="dataTables_empty text-center">기능 그룹 정보를 찾지 못했습니다.</td>
</tr>
</template>
<template id="adminActions">
<tr class="odd">
<td valign="top" colspan="4" class="dataTables_empty text-center">{authority}는 모든 기능을 사용할 수 있습니다.</td>
<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">
<span id="actionPagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<ul id="actionPaging" class="pagination pagination-primary">
<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 removeActions() {
<c:set var="actionGroupFunc" scope="request">function removeAuthActions() {
dialog.alert({
content:"선택한 기능그룹을 삭제하시겠습니까?",
onOK:() => {
@ -62,12 +56,12 @@ ${infoPrefix}Control.onActionListChange = obj => {
let trs =
${infoPrefix}Control.authorities.isAdmin() ? [document.getElementById("adminActions").innerHTML.replace(/{authority}/, authority)] :
empty ?
[document.getElementById("actionNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
[document.getElementById("authActionNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}List.inStrings(document.getElementById("authActionRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
$("#authActions").html(trs.join());
$("#actionToggler").prop("checked", false);
$("#authActionList").html(trs.join());
$("#authActionToggler").prop("checked", false);
$("#actionPaging").setPaging({
$("#authActionPaging").setPaging({
list:${infoPrefix}Control.actions.dataset,
prefix:${infoPrefix}Control.actions.prefix,
start:obj.actionStart,
@ -82,16 +76,16 @@ ${infoPrefix}Control.onCurrentActionChange = item => {
let data = item.data;
let key = data.AUTH_ID + "-" + data.GRP_ID;
$("#authActions").setCurrentRow(key);
$("#authActionList").setCurrentRow(key);
};
${infoPrefix}Control.onActionSelect = selected => {
let ${infoPrefix}List = ${infoPrefix}Control.actions.dataset;
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
$("#authActions input[type='checkbox']").each(function() {
$("#authActionList input[type='checkbox']").each(function() {
let checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnRemoveActions").prop("disabled", keys.length < 1);
$("#btnRemoveAuthActions").prop("disabled", keys.length < 1);
};</c:set>

@ -43,18 +43,11 @@
var infoPrefixFields = new FormFields("#infoPrefix-form");
infoPrefixControl.authorities.setInfo = obj => {
infoPrefixFields.set(obj);
infoPrefixFields.set(infoPrefixControl, obj);
let info = obj.data;
let create = isEmpty(info.AUTH_ID);
$("input[name='id']").prop("readonly", !create);
$("#infoPrefix-form input")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
val = input.val();
infoPrefixControl.authorities.setValue(name, val);
})
.onEnterPress(saveinfoPrefix);
$("#infoPrefix-form input").onEnterPress(saveinfoPrefix);
$("input[name='" + (create ? "id" : "name") + "']").focus();
$("#btnSaveAuth").prop("disabled", infoPrefixControl.authorities.isBuiltIn(info));

@ -1,27 +1,19 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<%--h4 id="pageTitle" class="fw-bold py-3 mb-4">페이지 제목</h4--%>
<c:set var="prefixName" scope="request">권한</c:set>
<c:set var="prefixName" scope="request">권한</c:set>
<!-- Page Body -->
<div class="card">
<div class="card-datatable text-nowrap">
<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 class="w-40 mx-3">
<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="DataTables_Table_0_length">
<select id="by" onchange="document.getElementById('term').focus();" aria-controls="DataTables_Table_0" class="form-select">
<option value="authName">권한 이름</option>
<option value="authID">권한 아이디</option>
<option value="authName">이름</option>
<option value="authID">아이디</option>
</select>
<input id="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
</div>
@ -32,22 +24,19 @@
<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 compress-cell" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
<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" class="text-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">권한 아이디</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><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 class="text-center">
<input value="{AUTH_ID}" onchange="${infoPrefix}Control.authorities.select('{AUTH_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<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>
@ -60,14 +49,13 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite">
</span>
<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 class="pt-3 w-60 mx-3">
<div class="nav-align-top">
<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>
@ -76,7 +64,7 @@
<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 py-2 px-0">
<div class="tab-content" style="padding:.6em 0;">
<div class="tab-pane fade show active" id="navs-top-users" role="tabpanel">
<jsp:include page="user-list.jsp" />
</div>
@ -84,27 +72,13 @@
<jsp:include page="actionGroup-list.jsp" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--/ Page Body -->
<hr class="my-5" />
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
<script>
<script >
var ${infoPrefix}Control = new AuthorityControl();
function search${infoPrefix}s() {

@ -2,15 +2,13 @@
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<div class="d-flex flex-row justify-content-end p-3">
<div>
<button id="btnAddUsers" onclick="${infoPrefix}Control.addUsers();" class="btn btn-primary">+ 추가</button>
<button id="btnRemoveUsers" onclick="removeUsers();" class="btn btn-primary">- 제거</button>
<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 compress-cell" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
<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" class="text-center">
<input id="authUserToggler" onchange="${infoPrefix}Control.users.select(this.checked);" type="checkbox" class="form-check-input"></th>
<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>
@ -19,13 +17,11 @@
<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="authUsers">
<tbody id="authUserList">
</tbody>
<template id="authUserRow">
<tr data-key="{AUTH_ID}-{USER_ID}">
<td class="text-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 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}')">{NSTT_NM}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{DEPT_NM}</td>
@ -34,7 +30,7 @@
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}">{REG_DT}</td>
</tr>
</template>
<template id="userNotFound">
<template id="authUserNotFound">
<tr class="odd">
<td valign="top" colspan="7" class="dataTables_empty text-center">사용자 정보를 찾지 못했습니다.</td>
</tr>
@ -46,12 +42,12 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="userPagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<ul id="userPaging" class="pagination pagination-primary">
<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 removeUsers() {
function removeAuthUsers() {
dialog.alert({
content:"선택한 사용자를 삭제하시겠습니까?",
onOK:() => {
@ -68,12 +64,12 @@ ${infoPrefix}Control.onUserListChange = obj => {
let trs =
${infoPrefix}Control.authorities.isImplicit() ? [document.getElementById("implicitActions").innerHTML.replace(/{authority}/, authority)] :
empty ? [document.getElementById("userNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
empty ? [document.getElementById("authUserNotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}List.inStrings(document.getElementById("authUserRow").innerHTML); <%-- from template#${infoPrefix}Row --%>
$("#authUsers").html(trs.join());
$("#authUserList").html(trs.join());
$("#authUserToggler").prop("checked", false);
$("#userPaging").setPaging({
$("#authUserPaging").setPaging({
list:${infoPrefix}Control.users.dataset,
prefix:${infoPrefix}Control.users.prefix,
start:obj.userStart,
@ -88,16 +84,16 @@ ${infoPrefix}Control.onCurrentUserChange = item => {
let data = item.data;
let key = data.AUTH_ID + "-" + data.USER_ID;
$("#authUsers").setCurrentRow(key);
$("#authUserList").setCurrentRow(key);
};
${infoPrefix}Control.onUserSelect = selected => {
let ${infoPrefix}List = ${infoPrefix}Control.users.dataset;
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
$("#authUsers input[type='checkbox']").each(function() {
$("#authUserList input[type='checkbox']").each(function() {
let checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnRemoveUsers").prop("disabled", keys.length < 1);
$("#btnRemoveAuthUsers").prop("disabled", keys.length < 1);
};</c:set>

@ -105,17 +105,10 @@ var codeFields = new FormFields("#code-form");
codeControl.codes.setInfo = obj => {
let info = obj.data;
codeFields.set(obj);
codeFields.set(codeControl, obj);
let create = isEmpty(info.CODE);
$("input[name='code']").prop("readonly", !create);
$("#code-form input")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
val = input.val();
codeControl.codes.setValue(name, val);
})
.onEnterPress(saveCode);
$("#code-form input").onEnterPress(saveCode);
$("#codeInUse").html("Y" == info.USE_YN ? "사용 중" : "사용하지 않음");
document.querySelector("input[name='" + (create ? "code" : "value") + "']").focus();
}

@ -1,19 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<%--h4 id="pageTitle" class="fw-bold py-3 mb-4">페이지 제목</h4--%>
<c:set var="prefixName" scope="request">코드 그룹</c:set>
<c:set var="prefixName" scope="request">코드 그룹</c:set>
<!-- Page Body -->
<div class="card">
<div class="card-datatable text-nowrap">
<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 class="w-50 mx-3">
<div style="width:49%;">
<h5 class="mt-3">${prefixName}</h5>
<div class="d-flex flex-row justify-content-between p-3">
<%--div>
@ -33,9 +26,7 @@
</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" class="text-center">
<input onchange="codeControl.groups.select(this.checked);" type="checkbox" class="form-check-input"></th>
<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>
@ -45,8 +36,7 @@
</tbody>
<template id="groupRow">
<tr data-key="{GRP_ID}">
<td class="text-center">
<input value="{GRP_ID}" onchange="codeControl.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<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>
@ -59,12 +49,12 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="groupPagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<label id="groupPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="groupPaging" class="pagination pagination-primary">
</ul>
</div>
</div>
<div class="w-50 mx-3">
<div style="width:49%;">
<h5 class="mt-3">공통 코드</h5>
<div class="d-flex flex-row justify-content-end p-3">
<div>
@ -74,10 +64,7 @@
</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" class="text-center">
<input id="codeToggler" onchange="codeControl.codes.select(this.checked);" type="checkbox" class="form-check-input">
</th>
<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>
@ -87,9 +74,7 @@
</tbody>
<template id="codeRow">
<tr data-key="{CODE}">
<td class="text-center">
<input value="{CODE}" onchange="codeControl.codes.select('{CODE}', this.checked);" type="checkbox" class="form-check-input">
</td>
<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>
@ -102,7 +87,7 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="codePagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<label id="codePagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="codePaging" class="pagination pagination-primary">
</ul>
</div>
@ -110,22 +95,8 @@
</div>
</div>
</div>
</div>
<!--/ Page Body -->
<hr class="my-5" />
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
<script>
<script >
var codeControl = new CodeControl();
function searchGroups() {
@ -149,7 +120,7 @@ function removeCodes() {
dialog.alert({
content:"선택한 코드를 삭제하시겠습니까?",
onOK:() => {
codeControl.removeCodes();
codeControl.codes.remove();
}
});
}
@ -214,9 +185,9 @@ codeControl.onCodeListChange = obj => {
$("#codePaging").setPaging({
list:codeControl.codes.dataset,
prefix:codeControl.codes.prefix,
start:obj.codeStart,
totalSize:obj.codeTotal,
fetchSize:obj.codeFetch,
start:obj ? obj.codeStart : -1,
totalSize:obj ? obj.codeTotal : 0,
fetchSize:obj ? obj.codeFetch : 10,
func:"codeControl.codes.load({index})"
});
};
@ -251,4 +222,5 @@ $(function(){
groupTotal:${groupTotal}
});
});
//# sourceURL=code-main.jsp
</script>

@ -74,17 +74,10 @@ var groupFields = new FormFields("#group-form");
codeControl.groups.setInfo = obj => {
let info = obj.data;
groupFields.set(obj);
groupFields.set(codeControl, obj);
let create = isEmpty(info.GRP_ID);
$("input[name='id']").prop("readonly", !create);
$("#group-form input")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
val = input.val();
codeControl.groups.setValue(name, val);
})
.onEnterPress(saveGroup);
$("#group-form input").onEnterPress(saveGroup);
$("#groupInUse").html(create ? "" : info.USE_YN == "Y" ? "사용 중" : "사용하지 않음");
document.querySelector("input[name='" + (create ? "id" : "name") + "']").focus();

@ -74,7 +74,7 @@
var menuFields = new FormFields("#menu-form");
menuControl.setInfo = obj => {
menuFields.set(obj);
menuFields.set(menuControl, obj);
$("input[name='name']").focus();
}
@ -98,11 +98,5 @@ function saveMenu() {
}
$("#menu-form input")
.change(function() {
let input = $(this),
name = input.attr("name"),
val = input.val();
menuControl.setValue(name, val);
})
.onEnterPress(() => saveMenu());
</c:set>

@ -1,33 +1,25 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- inner page css -->
<!-- inner page html -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<%--h4 id="pageTitle" class="fw-bold py-3 mb-4">페이지 제목</h4--%>
<c:set var="prefixName" scope="request">메뉴</c:set>
<link rel="stylesheet" href="<c:url value="/resources/3rd-party/sneat/libs/jstree/jstree.css"/>" /--%>
<c:set var="prefixName" scope="request">메뉴</c:set>
<!-- Page Body -->
<div class="card">
<div class="card-datatable text-nowrap">
<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 class="w-50 mx-3">
<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 py-2 border-separator-y">
<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" class="pt-3 ox-auto oy-auto">
<div id="menuTree" style="padding-top:1em; min-height:26em; overflow:auto;">
</div>
</div>
</div>
<div class="w-50 mx-3">
<div style="width:49%;">
<h5 class="mt-3">등록 정보</h5>
<div class="d-flex flex-row justify-content-end p-3">
<div>
@ -39,18 +31,8 @@
</div>
</div>
</div>
</div>
<!-- Page Body -->
<hr class="my-5" />
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<script>
<!--/ Page Body -->
<script >
var menuBranches = treeSupport({
selector:"#menuTree",
trace:wctx.trace,
@ -148,4 +130,5 @@ $(function(){
menuControl.setData(${menus});
menuBranches.open();
});
//# sourceURL=menu-main.jsp
</script>

@ -21,9 +21,7 @@
</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" class="text-center">
<input onchange="${infoPrefix}Control.dataset.select(this.checked);" type="checkbox" class="form-check-input"></th>
<tr><th tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="text-align:center;"><input onchange="${infoPrefix}Control.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" 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>
@ -36,9 +34,7 @@
</tbody>
<template id="_${infoPrefix}Row">
<tr data-key="{USER_ID}">
<td class="text-center">
<input value="{USER_ID}" onchange="${infoPrefix}Control.dataset.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input">
</td>
<td style="text-align:center;"><input value="{USER_ID}" onchange="${infoPrefix}Control.dataset.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{SGG_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{NSTT_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{DEPT_NM}</td>
@ -54,7 +50,7 @@
</template>
</table>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="_${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<label id="_${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="_${infoPrefix}Paging" class="pagination pagination-primary">
</ul>
</div>

@ -179,7 +179,7 @@
<script type="text/javascript">
var infoPrefixFields = new FormFields("#infoPrefix-form");
var infoPrefixFields = new FimsFormFields("#infoPrefix-form");
infoPrefixControl.setInfo = obj => {
infoPrefixFields.set(obj);
@ -190,9 +190,9 @@ infoPrefixControl.setInfo = obj => {
let password = $(this).prop("required", create);
let div = password.parent().parent().parent();
if (create) {
div.show();
div.removeAttr("hidden");
} else
div.hide();
div.attr("hidden","hidden");
});
$("#infoPrefix-form").find("input,select")
.change(function() {

@ -1,17 +1,8 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- Content wrapper -->
<div class="content-wrapper">
<!-- Content -->
<div class="container-xxl flex-grow-1 container-p-y">
<%--h4 id="pageTitle" class="fw-bold py-3 mb-4">페이지 제목</h4--%>
<c:set var="prefixName" scope="request">사용자</c:set>
<c:set var="prefixName" scope="request">사용자</c:set>
<!-- Page Body -->
<div class="card">
<div class="card-datatable text-nowrap">
<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-between p-3">
@ -33,16 +24,13 @@
<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 tabindex="0" class="text-center" style="width: 158.828px;">
<input onchange="${infoPrefix}Control.select(this.checked);" type="checkbox" class="form-check-input">
</th>
<tr><th tabindex="0" style="width: 158.828px; text-align:center;"><input onchange="${infoPrefix}Control.select(this.checked);" type="checkbox" class="form-check-input"></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: 146.156px;">부서</th>
<th class="sorting" style="width: 160.141px;">전화번호(유선)</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>
@ -50,15 +38,13 @@
</tbody>
<template id="${infoPrefix}Row">
<tr data-key="{USER_ID}">
<td class="text-center">
<input value="{USER_ID}" onchange="${infoPrefix}Control.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input">
</td>
<td style="text-align:center;"><input value="{USER_ID}" onchange="${infoPrefix}Control.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td {onclick} {ondblclick}>{USER_ACNT}</td>
<td {onclick} {ondblclick}>{USER_NM}</td>
<td {onclick} {ondblclick}>{NSTT_NM}</td>
<td {onclick} {ondblclick}>{DEPT_NM}</td>
<td {onclick} {ondblclick}>{TELNO}</td>
<td {onclick} {ondblclick}>{EML_ADRS}</td>
<td {onclick} {ondblclick}>{TELNO}</td>
<td {onclick} {ondblclick}>{REG_DT}</td>
</tr>
</template>
@ -70,26 +56,14 @@
</table>
</div>
<div class="d-flex flex-row p-3 justify-content-between">
<span id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></span>
<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>
</div>
<!--/ Page Body -->
<hr class="my-5" />
</div>
<!-- / Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- Content wrapper -->
<script>
<script >
var ${infoPrefix}Control = new UserControl();
function search${infoPrefix}s() {
@ -118,16 +92,16 @@ function render${infoPrefix}List() {
${infoPrefix}List.inStrings(
document.getElementById("${infoPrefix}Row").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, 'onclick="userControl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
.replace(/{ondblclick}/gi, 'ondblclick="userControl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
<%-- OR
.replace(/{onclick}=""/gi, 'onclick="userControl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
.replace(/{ondblclick}=""/gi, 'ondblclick="userControl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
<%-- OR
(str, dataItem) => {
let userID = dataItem.getValue("USER_ID");
return str
.replace(/{onclick}/gi, 'onclick="userControl.setCurrent(\'' + userID + '\');"')
.replace(/{ondblclick}/gi, 'ondblclick="userControl.getInfo(\'' + userID + '\')"')
.replace(/{onclick}=""/gi, 'onclick="userControl.setCurrent(\'' + userID + '\');"')
.replace(/{ondblclick}=""/gi, 'ondblclick="userControl.getInfo(\'' + userID + '\')"')
}
--%>
--%>
);
$("#${infoPrefix}List").html(trs.join());
$("th input[type='checkbox']").prop("checked", false);
@ -175,4 +149,5 @@ $(function(){
${infoPrefix}Total:${userTotal}
});
});
//# sourceURL=user-main.jsp
</script>

@ -224,7 +224,7 @@
<script src="/resources/js/base/base-fims.js"></script>
<script>
var userFields = new FormFields("#user-form");
var userFields = new FimsFormFields("#user-form");
var userControl = new UserControl();
userControl.setInfo = obj => {
@ -240,9 +240,9 @@ userControl.setInfo = obj => {
let password = $(this).prop("required", create);
let div = password.parent().parent().parent();
if (create) {
div.show();
div.removeAttr("hidden");
} else
div.hide();
div.attr("hidden","hidden");
});
$("#user-form").find("input,select")
.change(function() {

@ -686,22 +686,36 @@ class FormFields {
this.datamap = [];
}
set(obj) {
set(ctrl, obj) {
let setChanged = evt => {
let input = evt.target,
name = input.getAttribute("data-map"),
val = input.value;
ctrl.setValue(name, val);
};
document.querySelectorAll(this.children).forEach(input => {
let prop = input.getAttribute("data-map")
|| input.name
|| input.id;
if (!prop) return;
input.removeEventListener("change", setChanged);
let dataItem = obj instanceof DataItem,
value = dataItem ? obj.getValue(prop) : obj[prop];
value = dataItem ? obj.getValue(prop) : obj[prop],
inputType = (input.type || input.tagName || "").toLowerCase();
if ("radio" == input.type) {
if (value && value == input.value)
input.checked = true;
} else {
input.value = ifEmpty(value, "");
switch (inputType) {
case "radio": input.checked = value && value == input.value; break;
case "checkbox": input.checked = value && value == input.value; break;
case "select":
for(let option of input.options) {
option.selected = option.value == value;
}
break;
default: input.value = ifEmpty(value, ""); break;
}
input.addEventListener("change", setChanged);
});
}
@ -714,11 +728,6 @@ class FormFields {
if (input.checked)
obj[property] = value;
} else {
let dataFmtType = input.getAttribute("data-fmt-type");
if (["day", "time"].includes(dataFmtType))
obj[property] = value.replace(/-|:/gi, "");
else
obj[property] = value;
}
// log(property, value, "radio" == input.type ? "radio" : "", input.checked ? "checked" : "");

Loading…
Cancel
Save