다이얼로그 관련 소스정리

main
이범준 3 months ago
parent a61d7d05d4
commit dada3444b3

@ -915,12 +915,18 @@ $(document).ready(function(){
return; return;
} }
let dialogName = "levyExclDialog";
let dialogId = dialogName+"-"+uuid();
dialog.open({ dialog.open({
id : "levyExclDialog--${pageName}", id : dialogId,
title : "부과제외 정보", title : "부과제외 정보",
content : resp, content : resp,
size : "md", size : "md",
init : () => {}, init : () => {
$("#"+dialogId).attr("name", dialogName);
$("#"+dialogId).attr("data-ref-doctx","${pageName}");
},
onClose : () => {} onClose : () => {}
}); });
@ -961,12 +967,18 @@ $(document).ready(function(){
return; return;
} }
let dialogName = "overTimeProcessDialog";
let dialogId = dialogName+"-"+uuid();
dialog.open({ dialog.open({
id : "overTimeProcessDialog--${pageName}", id : dialogId,
title : "2시간 초과 처리", title : "2시간 초과 처리",
content : resp, content : resp,
size : "lg", size : "lg",
init : () => {}, init : () => {
$("#"+dialogId).attr("name", dialogName);
$("#"+dialogId).attr("data-ref-doctx","${pageName}");
},
onClose : () => {} onClose : () => {}
}); });
} }
@ -974,8 +986,8 @@ $(document).ready(function(){
} }
$P.popupSavedCallback = (saved) => { $P.popupSavedCallback = (saved) => {
if($("#levyExclDialog--${pageName}").length > 0){ if($P.refDlgId("levyExclDialog") != ""){
dialog.close("levyExclDialog--${pageName}"); dialog.close($P.refDlgId("levyExclDialog"));
} }
if(saved){ if(saved){
@ -1005,7 +1017,9 @@ $(document).ready(function(){
, title: "사용자 검색" , title: "사용자 검색"
, content: resp , content: resp
, size: "lg" , size: "lg"
, init: () => { setDialogZindex(); } , init: () => {
setDialogZindex();
}
}); });
} }
}); });

@ -61,7 +61,7 @@
</div> </div>
<div class="card-datatable text-nowrap"> <div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer"> <div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-600"> <div name="table-responsive" class="table-responsive ox-scroll oy-scroll h-px-600">
<table class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer"> <table class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr name="exmptnVhclTheadTr"> <tr name="exmptnVhclTheadTr">
@ -347,16 +347,21 @@ $(document).ready(function(){
fetch(wctx.url("/resources/html/inputRsnDialog.html")) fetch(wctx.url("/resources/html/inputRsnDialog.html"))
.then(function(resp) { return resp.text(); }) .then(function(resp) { return resp.text(); })
.then(function(template) { .then(function(template) {
let dialogName = "inputDelRsnDialog";
let dialogId = dialogName + "-" + uuid();
dialog.open({ dialog.open({
id: "inputDelRsnDialog--${pageName}" id: dialogId
, title: "삭제 사유 입력" , title: "삭제 사유 입력"
, size: "lg" , size: "lg"
, content: template , content: template
, init: () => { setDialogZindex(); } , init: () => {
setDialogZindex();
$("#"+dialogId).attr("name", dialogName);
$("#"+dialogId).attr("data-ref-doctx","${pageName}");
}
, onOK: () => { , onOK: () => {
$P.fnRemove($("#reason").val()); $P.fnRemove($("#reason").val());
} }
}); });
}); });

@ -132,7 +132,7 @@
// 저장 callback // 저장 callback
$P.control.onSave = (resp) => { $P.control.onSave = (resp) => {
let dialogTitle = $("#" + $P.control.prefix + "Dialog--${openerPageName}").find("h5.modal-title").html(); let dialogTitle = $($("#frmEdit--${pageName}").parents(".modal")[0]).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력 // 메시지 출력
@ -143,7 +143,7 @@
}); });
if (resp.saved) { if (resp.saved) {
dialog.close($P.control.prefix + "Dialog--${openerPageName}"); dialog.close($("#frmEdit--${pageName}").parents(".modal")[0].id);
if ("${savedCallbackFuncName}" != "") { if ("${savedCallbackFuncName}" != "") {
${savedCallbackFuncName}(resp.saved); ${savedCallbackFuncName}(resp.saved);

@ -18,7 +18,18 @@ class DoctxFinder extends EventTarget {
return document.querySelector("[data-doctx='"+this.doctx+"']"); return document.querySelector("[data-doctx='"+this.doctx+"']");
} }
selfDlgId(){ selfDlgId(){
if($(this.selfElement()).parents(".modal").length > 0){
return $(this.selfElement()).parents(".modal")[0].id; return $(this.selfElement()).parents(".modal")[0].id;
} else {
return "";
}
}
refDlgId(dlgName){
if($(".modal[data-ref-doctx='"+this.doctx+"'][name='"+dlgName+"']").length > 0){
return $(".modal[data-ref-doctx='"+this.doctx+"'][name='"+dlgName+"']")[0].id;
} else {
return "";
}
} }
$find(name){ $find(name){
return $(document.querySelector("[data-doctx='"+this.doctx+"']")).find("[name='"+name+"']"); return $(document.querySelector("[data-doctx='"+this.doctx+"']")).find("[name='"+name+"']");

Loading…
Cancel
Save