|
|
@ -1,30 +1,29 @@
|
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
|
|
|
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
|
|
|
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
|
|
|
<c:set var="prefixName" scope="request">사용자</c:set>
|
|
|
|
<c:set var="prefixName" scope="request">사용자</c:set>
|
|
|
|
<!-- Page Body -->
|
|
|
|
<div data-doctx="user" class="d-flex flex-column flex-grow-1"><!-- 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 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-row justify-content-between p-3">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div class="input-group" id="${infoPrefix}-query">
|
|
|
|
<div class="input-group">
|
|
|
|
<select id="${infoPrefix}by" onchange="document.getElementById('${infoPrefix}term').focus();" aria-controls="DataTables_Table_0" class="form-select">
|
|
|
|
<select name="by" onchange="userCtrl.find('term').focus();" class="form-select">
|
|
|
|
<option value="${infoPrefix}Name">이름</option>
|
|
|
|
<option value="userName">이름</option>
|
|
|
|
<option value="${infoPrefix}Account">계정</option>
|
|
|
|
<option value="userAccount">계정</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<input id="${infoPrefix}term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
|
|
|
<input name="term" autofocus type="text" placeholder="조회 조건을 입력하십시오." class="form-control">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<button onclick="search${infoPrefix}s();" class="btn btn-primary">찾기</button>
|
|
|
|
<button onclick="userCtrl.search();" class="btn btn-primary">찾기</button>
|
|
|
|
<button onclick="${infoPrefix}Control.newInfo();" class="btn btn-primary">+ 추가</button>
|
|
|
|
<button onclick="userCtrl.newInfo();" class="btn btn-primary">+ 추가</button>
|
|
|
|
<button id="btnRemove${infoPrefix}s" onclick="remove${infoPrefix}s();" class="btn btn-primary">- 제거</button>
|
|
|
|
<button onclick="userCtrl.removeUsers();" class="btn btn-primary enable-onfound">- 제거</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
|
|
|
|
<table class="datatables-ajax table table-bordered dataTable no-footer">
|
|
|
|
<thead id="${infoPrefix}Thead">
|
|
|
|
<thead name="userThead">
|
|
|
|
<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>
|
|
|
|
<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 sorting_asc" aria-sort="ascending" style="width: 223.719px;">계정</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: 195.688px;">이메일</th>
|
|
|
@ -32,11 +31,11 @@
|
|
|
|
<th class="sorting" style="width: 230.469px;">등록일자</th>
|
|
|
|
<th class="sorting" style="width: 230.469px;">등록일자</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
<tbody id="${infoPrefix}List">
|
|
|
|
<tbody name="userList">
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
<template id="${infoPrefix}Row">
|
|
|
|
<template name="userRow">
|
|
|
|
<tr data-key="{USER_ID}">
|
|
|
|
<tr data-key="{USER_ID}">
|
|
|
|
<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 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}>{USER_ACNT}</td>
|
|
|
|
<td {onclick} {ondblclick}>{USER_ACNT}</td>
|
|
|
|
<td {onclick} {ondblclick}>{USER_NM}</td>
|
|
|
|
<td {onclick} {ondblclick}>{USER_NM}</td>
|
|
|
|
<td {onclick} {ondblclick}>{EML_ADRS}</td>
|
|
|
|
<td {onclick} {ondblclick}>{EML_ADRS}</td>
|
|
|
@ -44,7 +43,7 @@
|
|
|
|
<td {onclick} {ondblclick}>{REG_DT}</td>
|
|
|
|
<td {onclick} {ondblclick}>{REG_DT}</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template id="${infoPrefix}NotFound">
|
|
|
|
<template name="userNotFound">
|
|
|
|
<tr class="odd">
|
|
|
|
<tr class="odd">
|
|
|
|
<td valign="top" colspan="6" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
|
|
|
<td valign="top" colspan="6" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
@ -52,94 +51,88 @@
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="d-flex flex-row p-3 justify-content-between">
|
|
|
|
<div class="d-flex flex-row p-3 justify-content-between">
|
|
|
|
<label id="${infoPrefix}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
|
|
|
<label name="userPagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
|
|
|
<ul id="${infoPrefix}Paging" class="pagination pagination-primary">
|
|
|
|
<ul name="userPaging" class="pagination pagination-primary">
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!--/ Page Body -->
|
|
|
|
<!--/ Page Body -->
|
|
|
|
|
|
|
|
<script >
|
|
|
|
<script >
|
|
|
|
var ${infoPrefix}Control = new UserControl();
|
|
|
|
var userCtrl = newUserControl();
|
|
|
|
|
|
|
|
|
|
|
|
function search${infoPrefix}s() {
|
|
|
|
userCtrl.search = () => {
|
|
|
|
${infoPrefix}Control.query = {
|
|
|
|
userCtrl.query = {
|
|
|
|
by:$("#${infoPrefix}-query [name='by']").val(),
|
|
|
|
by: userCtrl.find("by").value,
|
|
|
|
term:$("#${infoPrefix}-query [name='term']").val()
|
|
|
|
term: userCtrl.find("term").value
|
|
|
|
};
|
|
|
|
};
|
|
|
|
${infoPrefix}Control.load(1);
|
|
|
|
userCtrl.load(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function remove${infoPrefix}s() {
|
|
|
|
userCtrl.removeUsers = () => {
|
|
|
|
dialog.alert({
|
|
|
|
dialog.alert({
|
|
|
|
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
|
|
|
content:"선택한 ${prefixName} 정보를 제거하시겠습니까?",
|
|
|
|
onOK:() => {
|
|
|
|
onOK:() => {
|
|
|
|
${infoPrefix}Control.remove();
|
|
|
|
userCtrl.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function render${infoPrefix}List() {
|
|
|
|
userCtrl.renderList = () => {
|
|
|
|
let ${infoPrefix}List = ${infoPrefix}Control.dataset;
|
|
|
|
let userList = userCtrl.dataset,
|
|
|
|
let empty = ${infoPrefix}List.empty;
|
|
|
|
empty = userList.empty;
|
|
|
|
|
|
|
|
|
|
|
|
let trs = empty ?
|
|
|
|
let trs = empty ?
|
|
|
|
[document.getElementById("${infoPrefix}NotFound").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
|
|
|
|
[userCtrl.find("userNotFound").innerHTML] :
|
|
|
|
${infoPrefix}List.inStrings(
|
|
|
|
userList.inStrings(
|
|
|
|
document.getElementById("${infoPrefix}Row").innerHTML, <%-- from template#${infoPrefix}Row --%>
|
|
|
|
userCtrl.find("userRow").innerHTML,
|
|
|
|
(str, dataItem) => str
|
|
|
|
(str, dataItem) => str
|
|
|
|
.replace(/{onclick}=""/gi, 'onclick="userControl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
|
|
|
|
.replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
|
|
|
|
.replace(/{ondblclick}=""/gi, 'ondblclick="userControl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
|
|
|
|
.replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.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 + '\')"')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
--%>
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
$("#${infoPrefix}List").html(trs.join());
|
|
|
|
userCtrl.find("userList").innerHTML = trs.join("");
|
|
|
|
$("#${infoPrefix}Thead").find("th input[type='checkbox']").prop("checked", false);
|
|
|
|
userCtrl.querySelector("[name='userThead'] th input[type='checkbox']").checked = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
${infoPrefix}Control.onDatasetChange = obj => {
|
|
|
|
userCtrl.onDatasetChange = obj => {
|
|
|
|
render${infoPrefix}List();
|
|
|
|
userCtrl.renderList();
|
|
|
|
|
|
|
|
|
|
|
|
$("#${infoPrefix}Paging").setPaging({
|
|
|
|
$("#userPaging").setPaging({
|
|
|
|
list:${infoPrefix}Control.dataset,
|
|
|
|
list: userCtrl.dataset,
|
|
|
|
prefix:${infoPrefix}Control.prefix,
|
|
|
|
prefix: userCtrl.prefix,
|
|
|
|
start:obj.${infoPrefix}Start,
|
|
|
|
start: obj.userStart,
|
|
|
|
totalSize:obj.${infoPrefix}Total,
|
|
|
|
totalSize: obj.userTotal,
|
|
|
|
fetchSize:obj.${infoPrefix}Fetch,
|
|
|
|
fetchSize: obj.userFetch,
|
|
|
|
func:"${infoPrefix}Control.load({index})"
|
|
|
|
func:"userCtrl.load({index})"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
${infoPrefix}Control.onCurrentChange = item => {
|
|
|
|
userCtrl.onCurrentChange = item => {
|
|
|
|
if (!item) return;
|
|
|
|
if (!item) return;
|
|
|
|
|
|
|
|
|
|
|
|
let key = item.data.USER_ID;
|
|
|
|
let key = item.data.USER_ID;
|
|
|
|
$("#${infoPrefix}List").setCurrentRow(key);
|
|
|
|
$(userCtrl.selector("[name='userList']")).setCurrentRow(key);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
${infoPrefix}Control.onSelectionChange = selected => {
|
|
|
|
userCtrl.onSelectionChange = selected => {
|
|
|
|
let ${infoPrefix}List = ${infoPrefix}Control.dataset;
|
|
|
|
let userList = userCtrl.dataset;
|
|
|
|
let keys = selected.map(e => ${infoPrefix}List.getKey(e));
|
|
|
|
let keys = selected.map(e => userList.getKey(e));
|
|
|
|
$("#${infoPrefix}List input[type='checkbox']").each(function() {
|
|
|
|
userCtrl.querySelectorAll("[name='userList'] input[type='checkbox']")
|
|
|
|
let checkbox = $(this);
|
|
|
|
.forEach(node => {
|
|
|
|
checkbox.prop("checked", keys.includes(checkbox.val()));
|
|
|
|
node.checked = keys.includes(node.value);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#btnRemove${infoPrefix}s").prop("disabled", keys.length < 1);
|
|
|
|
userCtrl.querySelectorAll(".enable-onfound")
|
|
|
|
|
|
|
|
.forEach(node => {
|
|
|
|
|
|
|
|
node.disabled = keys.length < 1;
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$("#${infoPrefix}term").onEnterPress(search${infoPrefix}s);
|
|
|
|
$(userCtrl.selector("[name='term']")).onEnterPress(userCtrl.search);
|
|
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
$(function(){
|
|
|
|
${onload}
|
|
|
|
${onload}
|
|
|
|
${infoPrefix}Control.setData({
|
|
|
|
userCtrl.setData({
|
|
|
|
${infoPrefix}List:${userList},
|
|
|
|
userList:${userList},
|
|
|
|
${infoPrefix}Start:${userStart},
|
|
|
|
${infoPrefix}Start:${userStart},
|
|
|
|
${infoPrefix}Fetch:${userFetch},
|
|
|
|
${infoPrefix}Fetch:${userFetch},
|
|
|
|
${infoPrefix}Total:${userTotal}
|
|
|
|
${infoPrefix}Total:${userTotal}
|
|
|
|