공지사항 관리 수정

main
이범준 3 months ago
parent 7092c778a2
commit 3b5cdfd4b7

@ -686,7 +686,7 @@ $(document).ready(function(){
return; return;
} }
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}"); dialog.close($P.selfDlgId());
} }
//납부자 삭제 //납부자 삭제
@ -1173,12 +1173,12 @@ $(document).ready(function(){
$P.$find("refreshEnd").on("refreshEnd", function(){ $P.$find("refreshEnd").on("refreshEnd", function(){
if(this.dataset.cursorKey == null || this.dataset.cursorKey == ""){ if(this.dataset.cursorKey == null || this.dataset.cursorKey == ""){
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}"); dialog.close($P.selfDlgId());
return; return;
} }
if(!$P.provided.hasData(this.dataset.cursorKey)){ if(!$P.provided.hasData(this.dataset.cursorKey)){
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}"); dialog.close($P.selfDlgId());
return; return;
} }

@ -6,25 +6,25 @@
<div class="card wrapper-list"> <div class="card wrapper-list">
<div class="container-page-btn"> <div class="container-page-btn">
<button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark w-px-120" title="초기화"> <button type="button" name="btnReset" class="btn btn-outline-dark w-px-120" title="초기화">
초기화 초기화
</button> </button>
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" id="btnSearch--${pageName}" class="btn btn-search w-px-120" title="검색"> <button type="button" name="btnSearch" class="btn btn-search w-px-120" title="검색">
검색 검색
</button> </button>
</span> </span>
</div> </div>
<form id="frmSearch--${pageName}" name="frmSearch"> <form name="frmSearch">
<div class="container-search"> <div class="container-search">
<div class="row g-1"> <div class="row g-1">
<div class="col-12"> <div class="col-12">
<select id="by--${pageName}" name="by" class="form-select"> <select is="id-select" name="by" class="form-select">
<option value="NTC_TTL">제목</option> <option value="NTC_TTL">제목</option>
<option value="NTC_CN">내용</option> <option value="NTC_CN">내용</option>
</select> </select>
<input type="text" id="term--${pageName}" name="term" class="form-control" /> <input type="text" is="id-input" name="term" class="form-control" />
</div> </div>
</div> </div>
</div> </div>
@ -32,19 +32,18 @@
</form> </form>
<div> <div>
<div id="gridbuttonArea--${pageName}" class="container-page-btn"> <div name="gridbuttonArea" class="container-page-btn">
<div class="d-flex flex-row justify-content-between"> <div class="d-flex flex-row justify-content-between">
<span id="ntcPaging--${pageName}PagingInfo" name="ntcPagingInfo" <span is="paing-info" name="ntcPagingInfo" class="dataTables_info">
class="dataTables_info"></span> </span>
<ul name="ntcPaging" <ul name="ntcPaging" class="pagination pagination-primary">
class="pagination pagination-primary">
</ul> </ul>
</div> </div>
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<span> <span>
<button type="button" class="btn btn-primary w-px-120" <button type="button" class="btn btn-primary w-px-120"
id="btnAdd--${pageName}" title="추가"> name="btnAdd" title="추가">
추가 추가
</button> </button>
</span> </span>
@ -53,12 +52,12 @@
</div> </div>
<div class="card-datatable text-nowrap"> <div class="card-datatable text-nowrap">
<div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer"> <div name="DataTables_Table_0_wrapper" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="table-responsive--${pageName}" class="table-responsive ox-scroll oy-scroll h-px-500"> <div name="table-responsive" class="table-responsive ox-scroll oy-scroll h-px-500">
<table id="DataTables_Table_0--${pageName}" <table name="DataTables_Table_0"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer"> class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr id="ntcThead--${pageName}"> <tr name="ntcThead">
<th style="width: 80px;" class="cmn">No.</th> <th style="width: 80px;" class="cmn">No.</th>
<th style="width: 180px;">시군구명</th> <th style="width: 180px;">시군구명</th>
<th style="width: 800px;">제목</th> <th style="width: 800px;">제목</th>
@ -66,9 +65,9 @@
<th class="dummy-th"></th> <th class="dummy-th"></th>
</tr> </tr>
</thead> </thead>
<tbody id="ntcTbody--${pageName}"> <tbody name="ntcTbody">
</tbody> </tbody>
<template id="ntcRow--${pageName}"> <template name="ntcRow">
<tr data-key="{NTC_ID}"> <tr data-key="{NTC_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{SGG_NM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{SGG_NM}</td>
@ -77,7 +76,7 @@
<td class="dummy-td"></td> <td class="dummy-td"></td>
</tr> </tr>
</template> </template>
<template id="ntcNotFound--${pageName}"> <template name="ntcNotFound">
<tr> <tr>
<td valign="top" colspan="5" class="dataTables_empty text-center"> <td valign="top" colspan="5" class="dataTables_empty text-center">
공지사항 정보를 찾지 못했습니다. 공지사항 정보를 찾지 못했습니다.
@ -90,7 +89,7 @@
</div> </div>
<div class="toast-container position-fixed bottom-0 end-0 p-3"> <div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="divToast--${pageName}" class="toast" role="alert" aria-live="assertive" aria-atomic="true"> <div name="divToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-body bg-black text-white"> <div class="toast-body bg-black text-white">
삭제 되었습니다. 삭제 되었습니다.
</div> </div>
@ -116,7 +115,7 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), { $P.toast = new bootstrap.Toast($P.find("divToast"), {
animation: true, animation: true,
autohide: true, autohide: true,
delay: 2000 delay: 2000
@ -154,7 +153,7 @@ $(document).ready(function(){
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#ntcTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.find("ntcTbody"));
} }
$P.ctrl.dataset.onSelectionChange = (selectedArr) => { $P.ctrl.dataset.onSelectionChange = (selectedArr) => {
@ -165,7 +164,7 @@ $(document).ready(function(){
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnReset = () => { $P.fnReset = () => {
var searchForm = $("#frmSearch--${pageName}"); var searchForm = $P.$find("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false); searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
searchForm.find("input[type='checkbox']").prop("checked", false); searchForm.find("input[type='checkbox']").prop("checked", false);
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
@ -177,7 +176,7 @@ $(document).ready(function(){
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields($P.selector("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
@ -202,8 +201,8 @@ $(document).ready(function(){
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
var notFound = [document.getElementById("ntcNotFound--${pageName}").innerHTML]; var notFound = [$P.find("ntcNotFound").innerHTML];
var found = document.getElementById("ntcRow--${pageName}").innerHTML; var found = $P.find("ntcRow").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickNtcList('" + dataItem.getValue("NTC_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickNtcList('" + dataItem.getValue("NTC_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickNtcList('" + dataItem.getValue("NTC_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickNtcList('" + dataItem.getValue("NTC_ID") + "');");
@ -223,7 +222,7 @@ $(document).ready(function(){
initScroll = false; initScroll = false;
} }
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore); $P.find("table-responsive").changeContent(trs, initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
@ -234,7 +233,7 @@ $(document).ready(function(){
return; return;
} }
$("#ntcTbody--${pageName}").setCurrentRow(dataKey); $P.$find("ntcTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
@ -292,21 +291,21 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $P.$find("btnReset").on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchNtcList()); $P.$find("btnSearch").on('click', () => $P.searchNtcList());
$('#btnAdd--${pageName}').on('click', () => $P.createNtc()); $P.$find("btnAdd").on('click', () => $P.createNtc());
/************************************************************************** /**************************************************************************
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/
fnMakeResizableTable($("#table-responsive--${pageName}")[0]); fnMakeResizableTable($P.find("table-responsive"));
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollNtcList); fnMakeScrollableTable($P.find("table-responsive"), $P.scrollNtcList);
$P.fnReset(); $P.fnReset();
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
if(MY_INFO.institute != "ADMIN00"){ if(MY_INFO.institute != "ADMIN00"){
$("#btnAdd--${pageName}").attr("hidden","hidden"); $P.$find("btnAdd").attr("hidden","hidden");
} }
}); });

@ -5,17 +5,17 @@
<div class="container-xxl flex-grow-1 px-0"> <div class="container-xxl flex-grow-1 px-0">
<div class="card"> <div class="card">
<form id="frmEdit--${pageName}" name="frmEdit"> <form name="frmEdit">
<input type="text" id="ntcId--${pageName}" name="ntcId" data-map="NTC_ID" hidden /> <input type="text" name="ntcId" data-map="NTC_ID" hidden />
<div class="row g-1"> <div class="row g-1">
<div class="col-md-12"> <div class="col-md-12">
<label for="sggCd--${pageName}" <label is="name-label" for="sggCd"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end"> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">
시군구 시군구
</label> </label>
<select id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" class="form-select"> <select is="id-select" name="sggCd" data-map="SGG_CD" class="form-select">
<option value="">전체</option> <option value="">전체</option>
<c:forEach items="${sggList}" var="item"> <c:forEach items="${sggList}" var="item">
<c:if test="${item.SGG_CD ne 'ADMIN'}"> <c:if test="${item.SGG_CD ne 'ADMIN'}">
@ -25,20 +25,20 @@
</select> </select>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label for="ntcTtl--${pageName}" <label is="name-label" for="ntcTtl"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required"> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">
제목 제목
</label> </label>
<input type="text" id="ntcTtl--${pageName}" name="ntcTtl" data-map="NTC_TTL" <input type="text" is="id-input" name="ntcTtl" data-map="NTC_TTL"
class="form-control w-px-800" required /> class="form-control w-px-800" required />
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label for="ntcCn--${pageName}" <label is="name-label" for="ntcCn"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end align-top required"> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end align-top required">
내용 내용
</label> </label>
<textarea type="text" id="ntcCn--${pageName}" name="ntcCn" data-map="NTC_CN" <textarea is="id-textarea" name="ntcCn" data-map="NTC_CN"
rows="15" rows="15"
class="form-control w-px-800" required></textarea> class="form-control w-px-800" required></textarea>
</div> </div>
@ -48,8 +48,8 @@
<div class="row m-3"> <div class="row m-3">
<div class="col-md-12"> <div class="col-md-12">
<span class="float-end"> <span class="float-end">
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button> <button type="button" name="btnSave" class="btn btn-primary">저장</button>
<button type="button" id="btnRemove--${pageName}" class="btn btn-primary">삭제</button> <button type="button" name="btnRemove" class="btn btn-primary">삭제</button>
</span> </span>
</div> </div>
</div> </div>
@ -83,7 +83,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, Dataset, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields($P.selector("frmEdit"));
$P.ctrl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
@ -113,7 +113,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.fnSave = () => { $P.fnSave = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return; if(!customValidate($P.$find("frmEdit").find("input"))) return;
var info = $P.formFields.get(); var info = $P.formFields.get();
@ -124,7 +124,7 @@ $(document).ready(function(){
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("ntcInfoDialog"); dialog.close($P.selfDlgId());
dialog.alert({ dialog.alert({
content:"저장되었습니다.", content:"저장되었습니다.",
onOK : () => $P.provided.refreshList() onOK : () => $P.provided.refreshList()
@ -156,8 +156,8 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$("#btnSave--${pageName}").on('click', () => $P.fnSave()); $P.$find("btnSave").on('click', () => $P.fnSave());
$("#btnRemove--${pageName}").on('click', () => $P.fnRemove()); $P.$find("btnRemove").on('click', () => $P.fnRemove());
/************************************************************************** /**************************************************************************
* 초기화 * 초기화
@ -166,14 +166,14 @@ $(document).ready(function(){
if(ntcInfo == null){ if(ntcInfo == null){
$P.ctrl.dataset.setData([]); $P.ctrl.dataset.setData([]);
$("#btnRemove--${pageName}").attr("hidden","hidden"); $P.$find("btnRemove").attr("hidden","hidden");
} else { } else {
$P.ctrl.dataset.setData([ntcInfo]); $P.ctrl.dataset.setData([ntcInfo]);
$("#sggCd--${pageName}").attr("disabled","disabled"); $P.$find("sggCd").attr("disabled","disabled");
if(MY_INFO.institute != "ADMIN00"){ if(MY_INFO.institute != "ADMIN00"){
$("#btnSave--${pageName}").attr("hidden","hidden"); $P.$find("btnSave").attr("hidden","hidden");
$("#btnRemove--${pageName}").attr("hidden","hidden"); $P.$find("btnRemove").attr("hidden","hidden");
} }
} }

@ -124,7 +124,7 @@ $(document).ready(function(){
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("scheduleInfoDialog"); dialog.close($P.selfDlgId());
dialog.alert({ dialog.alert({
content:"저장되었습니다.", content:"저장되었습니다.",
init : function() { init : function() {
@ -145,7 +145,7 @@ $(document).ready(function(){
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("scheduleInfoDialog"); dialog.close($P.selfDlgId());
dialog.alert({ dialog.alert({
content:"저장되었습니다.", content:"저장되었습니다.",
init : function() { init : function() {
@ -172,7 +172,7 @@ $(document).ready(function(){
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("scheduleInfoDialog"); dialog.close($P.selfDlgId());
dialog.alert({ dialog.alert({
content:"삭제되었습니다.", content:"삭제되었습니다.",
init : function() { init : function() {

@ -286,12 +286,18 @@ $(document).ready(function(){
data : params, data : params,
success : (resp) => { success : (resp) => {
let dialogName = "deptInfoDialog";
let dialogId = dialogName+"-"+uuid();
dialog.open({ dialog.open({
id : "deptInfoDialog", id : dialogId,
title : "부서 정보", title : "부서 정보",
size : "xl", size : "xl",
content : resp, content : resp,
init : () => { init : () => {
$("#"+dialogId).attr("name", dialogName);
$("#"+dialogId).attr("data-ref-doctx","${pageName}");
var parentRes = new Object(); var parentRes = new Object();
var childReq = pageObject.childReq.pop(); var childReq = pageObject.childReq.pop();

@ -320,7 +320,7 @@ $(document).ready(function(){
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("deptInfoDialog"); dialog.close($P.selfDlgId());
dialog.alert({ dialog.alert({
content:"저장되었습니다.", content:"저장되었습니다.",
onOK : () => $P.provided.refreshList() onOK : () => $P.provided.refreshList()

Loading…
Cancel
Save