공지사항 관련 소스 위치 변경

main
이범준 2 months ago
parent a33d6ccd1d
commit d590018678

@ -0,0 +1,305 @@
<%@ 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" data-doctx="${pageName}">
<div class="container-xxl flex-grow-1 px-0">
<div class="card wrapper-list">
<div class="container-page-btn">
<button type="button" name="btnReset" class="btn btn-outline-dark w-px-120" title="초기화">
초기화
</button>
<span class="container-window-btn-right">
<button type="button" name="btnSearch" class="btn btn-search w-px-120" title="검색">
검색
</button>
</span>
</div>
<form name="frmSearch">
<div class="container-search">
<div class="row g-1">
<div class="col-12">
<select is="id-select" name="by" class="form-select">
<option value="NTC_TTL">제목</option>
<option value="NTC_CN">내용</option>
</select>
<input type="text" is="id-input" name="term" class="form-control" />
</div>
</div>
</div>
</form>
<div>
<div name="gridbuttonArea" class="container-page-btn">
<div class="d-flex flex-row justify-content-between">
<span is="paing-info" name="ntcPagingInfo" class="dataTables_info"></span>
<ul name="ntcPaging" class="pagination pagination-primary"></ul>
</div>
<span class="container-window-btn-right">
<span>
<button type="button" class="btn btn-primary w-px-120"
name="btnAdd" title="추가">
추가
</button>
</span>
</span>
</div>
</div>
<div class="card-datatable text-nowrap">
<div name="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div name="table-responsive" class="table-responsive ox-scroll oy-scroll h-px-500">
<table name="ntcTable" class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr name="ntcThead">
<th style="width: 80px;" class="cmn">No.</th>
<th style="width: 180px;">시군구명</th>
<th style="width: 800px;">제목</th>
<th style="width: 180px;">작성일시</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody name="ntcTbody">
</tbody>
<template is="curly-brackets" name="ntcRow">
<tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">ROW_NUM</td>
<td onclick ondblclick class="text-start">SGG_NM</td>
<td onclick ondblclick class="text-start">NTC_TTL</td>
<td onclick ondblclick class="text-center">REG_DT</td>
<td class="dummy-td"></td>
</tr>
</template>
<template name="ntcNotFound">
<tr>
<td valign="top" colspan="5" class="dataTables_empty text-center">
공지사항 정보를 찾지 못했습니다.
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div name="divToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-body bg-black text-white">
삭제 되었습니다.
</div>
</div>
</div>
</div>
</div>
<div class="content-backdrop fade"></div>
</div>
<script>
LoadScript("mngt01010Script",wctx.url("/webjars/js/fims/mngt/mngt01010.js?ver=${ver}"));
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
var $P = pageObject["${pageName}"];
$P.toast = new bootstrap.Toast($P.findn("divToast"), {
animation: true,
autohide: true,
delay: 2000
});
/**************************************************************************
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = newMngt01010Control($P);
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderNtcList(obj?.Paging?.totalSize, ctrl.dataset.length, trs, option);
$P.pagingSupport.setPagingInfo(obj);
};
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("ntcTbody"));
}
ctrl.dataset.onSelectionChange = (selectedArr) => {
};
$P.pagingSupport = new FimsPagingSupport({
doq: $P,
linkContainer: "[name='ntcPaging']"
});
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
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);
ctrl.dataset.setData([]);
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchNtcList = () => {
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollNtcList = () => {
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshNtcList = () => {
if(ctrl.query.pageNum == null){
return;
}
ctrl.reload({all : true});
}
$P.getGridTemplate = () => {
var notFound = [$P.findn("ntcNotFound").innerHTML];
var found = $P.findn("ntcRow").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickNtcList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickNtcList('{NTC_ID}');");
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderNtcList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
$P.findn("table-responsive").changeContent(trs, initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
}
$P.clickNtcList = (dataIndex) => {
if(dataIndex == ""){
return;
}
$P.$findn("ntcTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataIndex);
}
$P.dblclickNtcList = (dataKey) => {
$P.getInfo(dataKey);
}
$P.createNtc = () => {
$P.getInfo();
}
$P.getInfo = (ntcId) => {
var params = {};
if(ntcId != null){
params.ntcId = ntcId;
}
ajax.get({
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
let dialogName = "ntcInfoDialog";
let dialogId = dialogName+"-"+uuid();
dialog.open({
id : dialogId,
title : "공지사항 상세",
size : "xl",
content : resp,
init : () => {
$("#"+dialogId).attr("name", dialogName);
$("#"+dialogId).attr("data-ref-doctx","${pageName}");
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
} else {
parentRes[reqKey] = function(){};
}
}
pageObject.parentRes.push(parentRes);
}
});
}
});
}
$P.provide = {
"refreshList" : function(){
$P.refreshNtcList();
},
};
/**************************************************************************
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchNtcList());
$P.$findn("btnAdd").on('click', () => $P.createNtc());
/**************************************************************************
* 초기화
**************************************************************************/
Componentization.fnMakeResizableTable($P.findn("table-responsive"));
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollNtcList);
$P.fnReset();
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
if(MY_INFO.institute != "ADMIN00"){
$P.$findn("btnAdd").attr("hidden","hidden");
}
});
</script>

@ -0,0 +1,171 @@
<%@ 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" data-doctx="${pageName}">
<div class="container-xxl flex-grow-1 px-0">
<div class="card">
<form name="frmEdit">
<input type="text" name="ntcId" data-map="NTC_ID" hidden />
<div class="row g-1">
<div class="col-md-12">
<label is="name-label" for="sggCd"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">
시군구
</label>
<select is="id-select" name="sggCd" data-map="SGG_CD" class="form-select">
<option value="">전체</option>
<c:forEach items="${sggList}" var="item">
<c:if test="${item.SGG_CD ne 'ADMIN'}">
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
</c:if>
</c:forEach>
</select>
</div>
<div class="col-md-12">
<label is="name-label" for="ntcTtl"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">
제목
</label>
<input type="text" is="id-input" name="ntcTtl" data-map="NTC_TTL"
class="form-control w-px-800" required />
</div>
<div class="col-md-12">
<label is="name-label" for="ntcCn"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end align-top required">
내용
</label>
<textarea is="id-textarea" name="ntcCn" data-map="NTC_CN"
rows="15"
class="form-control w-px-800" required></textarea>
</div>
</div>
<div class="row m-3">
<div class="col-md-12">
<span class="float-end">
<button type="button" name="btnSave" class="btn btn-primary">저장</button>
<button type="button" name="btnRemove" class="btn btn-primary">삭제</button>
</span>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
LoadScript("mngt01020Script",wctx.url("/webjars/js/fims/mngt/mngt01020.js?ver=${ver}"));
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"].provided = {};
pageObject.childReq = [];
pageObject.childReq.push({
refreshList : function(){ },
});
$(document).ready(function(){
var $P = pageObject["${pageName}"];
if(pageObject.parentRes.length > 0){
$P.provided = pageObject.parentRes.pop();
} else {
$P.provided = pageObject.childReq.pop();
}
/**************************************************************************
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
var ctrl = newMngt01020Control($P);
ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){
return;
}
$P.formFields.set(ctrl,dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnSave = () => {
if(!AppSupport.customValidate($P.$findn("frmEdit").find("input"))) return;
var info = $P.formFields.get();
var create = ctrl.dataset.empty;
ajax.post({
url : create ? ctrl.urls.create : ctrl.urls.update,
data : info,
success : (resp) => {
if(resp.saved){
dialog.close($P.selfDlgId());
dialog.alert({
content:"저장되었습니다.",
onOK : () => $P.provided.refreshList()
});
}
}
});
}
$P.fnRemove = () => {
var info = $P.formFields.get();
ajax.post({
url : ctrl.urls.remove,
data : info,
success : (resp) => {
if(resp.saved){
dialog.close("ntcInfoDialog");
dialog.alert({
content:"삭제되었습니다.",
onOK : () => $P.provided.refreshList()
});
}
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$P.$findn("btnSave").on('click', () => $P.fnSave());
$P.$findn("btnRemove").on('click', () => $P.fnRemove());
/**************************************************************************
* 초기화
**************************************************************************/
var ntcInfo = ${ntcInfo};
if(ntcInfo == null){
ctrl.dataset.setData([]);
$P.$findn("btnRemove").attr("hidden","hidden");
} else {
ctrl.dataset.setData([ntcInfo]);
$P.$findn("sggCd").attr("disabled","disabled");
if(MY_INFO.institute != "ADMIN00"){
$P.$findn("btnSave").attr("hidden","hidden");
$P.$findn("btnRemove").attr("hidden","hidden");
}
}
});
</script>

@ -0,0 +1,16 @@
function newMngt01010Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"],
appendData:true,
keys : ["NTC_ID"],
urls : {
load : wctx.url("/mngt/mngt01/010/list.do"),
getInfo : wctx.url("/mngt/mngt01/020/info.do")
},
formats: {
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat
}
});
return page.ctrl;
}

@ -0,0 +1,15 @@
function newMngt01020Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.NTC_ID : "",
urls : {
create : wctx.url("/mngt/mngt01/020/create.do"),
update : wctx.url("/mngt/mngt01/020/update.do"),
remove : wctx.url("/mngt/mngt01/020/remove.do")
},
formats: {
}
});
return page.ctrl;
}
Loading…
Cancel
Save