부서 목록 조회 추가
parent
eb971bee60
commit
78f485b8b7
@ -1,4 +1,338 @@
|
||||
<%@ 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="pageKorName" scope="request">부서관리</c:set>
|
||||
부서관리 메인
|
||||
<div class="content-wrapper">
|
||||
<div class="container-xxl flex-grow-1 px-0">
|
||||
<div class="card wrapper-list">
|
||||
|
||||
<div class="container-page-btn">
|
||||
<button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark w-px-120" title="초기화">
|
||||
초기화
|
||||
</button>
|
||||
<span class="container-window-btn-right">
|
||||
<button type="button" id="btnSearch--${pageName}" class="btn btn-search w-px-120" title="검색">
|
||||
검색
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<form id="frmSearch--${pageName}" name="frmSearch">
|
||||
<div class="container-search">
|
||||
<div class="row g-1">
|
||||
<div class="col-3">
|
||||
<label class="form-label fw-bold form-search-title">시군구</label>
|
||||
<select id="sggCd--${pageName}" name="sggCd" class="form-select" disabled>
|
||||
<option value="">전체</option>
|
||||
<c:forEach items="${sggList}" var="item">
|
||||
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<label class="form-label fw-bold form-search-title">기관명</label>
|
||||
<input type="text" id="instNm--${pageName}" name="instNm" class="form-control" />
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<label class="form-label fw-bold form-search-title">기관코드</label>
|
||||
<input type="text" id="instCd--${pageName}" name="instCd" class="form-control" maxlength="7" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-1">
|
||||
<div class="col-3">
|
||||
<label class="form-label fw-bold form-search-title">부서명</label>
|
||||
<input type="text" id="deptNm--${pageName}" name="deptNm" class="form-control" />
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<label class="form-label fw-bold form-search-title">부서코드</label>
|
||||
<input type="text" id="deptCd--${pageName}" name="deptCd" class="form-control" maxlength="7" />
|
||||
</div>
|
||||
<div class="col-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<div id="gridbuttonArea--${pageName}" class="container-page-btn">
|
||||
<div class="d-flex flex-row justify-content-between">
|
||||
<label id="deptPaging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||
<ul id="deptPaging--${pageName}" class="pagination pagination-primary">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<span class="container-window-btn-right">
|
||||
<span>
|
||||
<button type="button" class="btn btn-primary w-px-120"
|
||||
id="btnAdd--${pageName}" title="추가">
|
||||
추가
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary w-px-120"
|
||||
id="btnDel--${pageName}" title="삭제">
|
||||
삭제
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div id="table-responsive--${pageName}" class="table-responsive"
|
||||
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||
<table id="DataTables_Table_0--${pageName}"
|
||||
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead class="sticky-thead">
|
||||
<tr id="deptThead--${pageName}">
|
||||
<th style="width: 80px;" class="cmn">No.</th>
|
||||
<th class="cmn" style="width: 56px;">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
onchange="pageObject['${pageName}'].deptControl.select(this.checked);" />
|
||||
</th>
|
||||
<th style="width: 200px;">시군구명</th>
|
||||
<th style="width: 200px;">시군구코드</th>
|
||||
<th style="width: 200px;">기관명</th>
|
||||
<th style="width: 200px;">기관코드</th>
|
||||
<th style="width: 200px;">부서명</th>
|
||||
<th style="width: 200px;">부서코드</th>
|
||||
<th class="dummy-th"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="deptTbody--${pageName}">
|
||||
</tbody>
|
||||
<template id="deptRow--${pageName}">
|
||||
<tr data-key="{DEPT_CD}">
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
|
||||
<td class="text-center">
|
||||
<input type="checkbox" class="form-check-input" value="{DEPT_CD}"
|
||||
onchange="pageObject['${pageName}'].deptControl.select('{DEPT_CD}', this.checked);">
|
||||
</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{SGG_NM}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{SGG_CD}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{INST_NM}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{INST_CD}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{DEPT_NM}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEPT_CD}</td>
|
||||
<td class="dummy-td"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="deptNotFound--${pageName}">
|
||||
<tr>
|
||||
<td valign="top" colspan="99" class="dataTables_empty text-center">
|
||||
부서 정보를 찾지 못했습니다.
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content-backdrop fade"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
pageObject["${pageName}"] = {};
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var $P = pageObject["${pageName}"];
|
||||
|
||||
/**************************************************************************
|
||||
* DatasetControl
|
||||
**************************************************************************/
|
||||
$P.deptControl = new DatasetControl({
|
||||
urls : {
|
||||
load : wctx.url("/mngt/mngt04/010/list.do"),
|
||||
getInfo : wctx.url("/mngt/mngt04/020/info.do")
|
||||
},
|
||||
dataGetter : obj => obj["List"], appendData:true,
|
||||
keymapper : info => info ? info.DEPT_CD : "",
|
||||
formats: {
|
||||
REG_DT : datetimeFormat,
|
||||
MDFCN_DT : datetimeFormat
|
||||
}
|
||||
});
|
||||
$P.deptControl.defaultFetchSize = FETCH_XS;
|
||||
$P.deptControl.untilPageNum = 0;
|
||||
$P.deptControl.beforeCurrent = null;
|
||||
$P.deptControl.tableRenderComplete = false;
|
||||
|
||||
/**************************************************************************
|
||||
* DatasetControl.on
|
||||
**************************************************************************/
|
||||
$P.deptControl.onDatasetChange = (obj) => {
|
||||
|
||||
$P.renderDeptList(obj["Total"]);
|
||||
|
||||
$("#deptPaging--${pageName}").setPagingInfo({
|
||||
list: $P.deptControl.dataset,
|
||||
prefix: "deptPaging--${pageName}",
|
||||
start: obj["Start"],
|
||||
totalSize: obj["Total"],
|
||||
fetchSize: obj["Fetch"],
|
||||
func: "pageObject['${pageName}'].deptControl.load({index})"
|
||||
});
|
||||
|
||||
$P.deptControl.tableRenderComplete = true;
|
||||
};
|
||||
|
||||
$P.deptControl.onCurrentChange = (item) => {
|
||||
|
||||
if(!$P.deptControl.tableRenderComplete){
|
||||
return;
|
||||
}
|
||||
|
||||
$P.deptControl.tableRenderComplete = false;
|
||||
if(!item){
|
||||
$P.clickDeptList("", true);
|
||||
} else {
|
||||
$P.clickDeptList($P.deptControl.getCurrent()["DEPT_CD"], true);
|
||||
}
|
||||
}
|
||||
|
||||
$P.deptControl.onSelectionChange = (selected) => {
|
||||
var deptDS = $P.deptControl.dataset;
|
||||
var keys = selected.map(e => deptDS.getKey(e));
|
||||
|
||||
$("#deptTbody--${pageName} input[type='checkbox']").each(function() {
|
||||
var checkbox = $(this);
|
||||
checkbox.prop("checked", keys.includes(checkbox.val()));
|
||||
});
|
||||
|
||||
$("#btnDel--${pageName}").prop("disabled", keys.length < 1);
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* pageObject.function
|
||||
**************************************************************************/
|
||||
$P.fnReset = () => {
|
||||
var searchForm = $("#frmSearch--${pageName}");
|
||||
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
|
||||
searchForm.find("input[type='checkbox']").prop("checked", false);
|
||||
searchForm.find("input[type='hidden']").val("");
|
||||
searchForm.find("input[type='text']").val("");
|
||||
|
||||
searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd);
|
||||
|
||||
$P.deptControl.setData([]);
|
||||
}
|
||||
|
||||
|
||||
$P.refreshDeptList = () => {
|
||||
$P.deptControl.untilPageNum = $P.deptControl.query.pageNum;
|
||||
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize * $P.deptControl.query.pageNum;
|
||||
$P.deptControl.load(1);
|
||||
}
|
||||
|
||||
$P.searchDeptList = () => {
|
||||
$P.deptControl.query = $P.getParams();
|
||||
$P.deptControl.load(1);
|
||||
}
|
||||
|
||||
$P.scrollDeptList = () => {
|
||||
$P.deptControl.load($P.deptControl.query.pageNum + 1);
|
||||
}
|
||||
|
||||
$P.clickDeptList = (dataKey, auto) => {
|
||||
if(dataKey == ""){
|
||||
return;
|
||||
}
|
||||
|
||||
$("#deptTbody--${pageName}").setCurrentRow(dataKey);
|
||||
|
||||
if(!auto){
|
||||
$P.deptControl.setCurrent(dataKey);
|
||||
}
|
||||
}
|
||||
|
||||
$P.dblclickDeptList = (dataKey) => {
|
||||
var params = {
|
||||
deptCd : dataKey
|
||||
};
|
||||
|
||||
ajax.get({
|
||||
url : $P.deptControl.urls.getInfo,
|
||||
data : params,
|
||||
success : resp => {
|
||||
|
||||
dialog.open({
|
||||
id : "deptInfoDialog",
|
||||
title : "부서 정보", size : "xxl",
|
||||
content : resp,
|
||||
init : () => {}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$P.renderDeptList = (total) => {
|
||||
|
||||
var deptList = $P.deptControl.dataset;
|
||||
var empty = deptList.empty;
|
||||
|
||||
var found = document.getElementById("deptRow--${pageName}").innerHTML;
|
||||
var notFound = [document.getElementById("deptNotFound--${pageName}").innerHTML];
|
||||
|
||||
var replacer = (str, dataItem) => str
|
||||
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickDeptList('" + dataItem.getValue("DEPT_CD") + "');")
|
||||
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickDeptList('" + dataItem.getValue("DEPT_CD") + "');");
|
||||
|
||||
var trs = empty ? notFound : deptList.inStrings(found, replacer);
|
||||
var noMore = (total == deptList.length);
|
||||
var initScroll = ($P.deptControl.query.pageNum < 2) && ($P.deptControl.untilPageNum == 0);
|
||||
|
||||
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
|
||||
|
||||
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
|
||||
|
||||
if($P.deptControl.untilPageNum != 0){
|
||||
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize;
|
||||
$P.deptControl.query.pageNum = $P.deptControl.untilPageNum;
|
||||
$P.deptControl.untilPageNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$P.getParams = () => {
|
||||
var formFields = new FimsFormFields("#frmSearch--${pageName}");
|
||||
var data = formFields.get();
|
||||
data.fetchSize = $P.deptControl.defaultFetchSize;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* element.on
|
||||
**************************************************************************/
|
||||
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
|
||||
$('#btnSearch--${pageName}').on('click', () => $P.searchDeptList());
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 초기화
|
||||
**************************************************************************/
|
||||
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
|
||||
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDeptList);
|
||||
|
||||
$P.fnReset();
|
||||
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
|
||||
|
||||
if(MY_INFO.institute == "default"){
|
||||
$("#sggCd--${pageName}").removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -0,0 +1,3 @@
|
||||
<%@ 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="pageKorName" scope="request">부서 정보</c:set>
|
Loading…
Reference in New Issue