refactor : DatasetControl 이름 수정

main
이범준 4 months ago
parent af80e5aae5
commit 2168406044

@ -134,7 +134,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.layoutControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.LAYOUT_ID : "", keymapper : info => info ? info.LAYOUT_ID : "",
urls : { urls : {
@ -146,29 +146,29 @@ $(document).ready(function(){
MDFCN_DT : datetimeFormat MDFCN_DT : datetimeFormat
} }
}); });
$P.layoutControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.layoutControl.query = { pageNum : 1, fetchSize : $P.layoutControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.layoutControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.layoutControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderLayoutList(obj["Total"], $P.layoutControl.dataset.length, trs, option); $P.renderLayoutList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.layoutControl.dataset, obj, "layoutPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "layoutPaging--${pageName}");
}; };
$P.layoutControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.layoutControl.dataset, dataItem, $("#layoutTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#layoutTbody--${pageName}")[0]);
} }
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.layoutControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do");
$P.layoutControl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do"); $P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do");
$P.fnReset(); $P.fnReset();
} }
@ -180,32 +180,32 @@ $(document).ready(function(){
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
searchForm.find("input[type='text']").val(""); searchForm.find("input[type='text']").val("");
$P.layoutControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.layoutControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchLayoutList = () => { $P.searchLayoutList = () => {
$P.layoutControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.layoutControl.load(1); $P.ctrl.load(1);
} }
$P.scrollLayoutList = () => { $P.scrollLayoutList = () => {
$P.layoutControl.load($P.layoutControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshLayoutList = () => { $P.refreshLayoutList = () => {
if($P.layoutControl.query.pageNum == null){ if($P.ctrl.query.pageNum == null){
return; return;
} }
$P.layoutControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -225,7 +225,7 @@ $(document).ready(function(){
$P.renderLayoutList = (total, listLength, trs, option) => { $P.renderLayoutList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.layoutControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -242,7 +242,7 @@ $(document).ready(function(){
$("#layoutTbody--${pageName}").setCurrentRow(dataKey); $("#layoutTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.layoutControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickLayoutList = (dataKey) => { $P.dblclickLayoutList = (dataKey) => {
@ -260,7 +260,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.layoutControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {

@ -268,7 +268,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.layoutControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.FILE_LAYOUT_ID : "", keymapper : info => info ? info.FILE_LAYOUT_ID : "",
urls : { urls : {
@ -284,11 +284,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.layoutControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
return; return;
} }
$P.formFields.set($P.layoutControl, dataItem); $P.formFields.set($P.ctrl, dataItem);
} }
/************************************************************************** /**************************************************************************
@ -300,10 +300,10 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
var create = $P.layoutControl.dataset.empty; var create = $P.ctrl.dataset.empty;
ajax.post({ ajax.post({
url : create ? $P.layoutControl.urls.create : $P.layoutControl.urls.update, url : create ? $P.ctrl.urls.create : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -326,7 +326,7 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
ajax.post({ ajax.post({
url : $P.layoutControl.urls.remove, url : $P.ctrl.urls.remove,
data : { data : {
fileLayoutId : info.fileLayoutId fileLayoutId : info.fileLayoutId
}, },
@ -358,9 +358,9 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
var layoutInfo = ${layoutInfo}; var layoutInfo = ${layoutInfo};
if(layoutInfo != null){ if(layoutInfo != null){
$P.layoutControl.dataset.setData([layoutInfo]); $P.ctrl.dataset.setData([layoutInfo]);
} else { } else {
$P.layoutControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
$("#sggCd--${pageName}").val(MY_INFO.info.sggCd); $("#sggCd--${pageName}").val(MY_INFO.info.sggCd);
$("#instCd--${pageName}").val(MY_INFO.info.instCd); $("#instCd--${pageName}").val(MY_INFO.info.instCd);
$("#deptCd--${pageName}").val(MY_INFO.info.deptCd); $("#deptCd--${pageName}").val(MY_INFO.info.deptCd);

@ -174,7 +174,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.parsedInfoControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], dataGetter : obj => obj["List"],
keymapper : info => info ? info.FILE_NAME : "", keymapper : info => info ? info.FILE_NAME : "",
urls : { }, urls : { },
@ -189,16 +189,16 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.parsedInfoControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.parsedInfoControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderParsedInfoList(obj["Total"], $P.parsedInfoControl.dataset.length, trs); $P.renderParsedInfoList(obj["Total"], $P.ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.parsedInfoControl.dataset, obj, "parsedInfoPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "parsedInfoPaging--${pageName}");
}; };
$P.parsedInfoControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
$("#imageArea--${pageName}").html(""); $("#imageArea--${pageName}").html("");
if(dataItem && dataItem.data){ if(dataItem && dataItem.data){
@ -296,7 +296,7 @@ $(document).ready(function(){
//서버에 등록된 파일 조회 //서버에 등록된 파일 조회
$P.searchFileList = () => { $P.searchFileList = () => {
$P.parsedInfoControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
ajax.post({ ajax.post({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/list.do"), url : wctx.url("/${taskSeCd}/crdn/crdn05/020/list.do"),
@ -304,7 +304,7 @@ $(document).ready(function(){
taskSeCd : $("#taskSeCd--${pageName}").val() taskSeCd : $("#taskSeCd--${pageName}").val()
}, },
success : (resp) => { success : (resp) => {
$P.parsedInfoControl.dataset.setData(resp); $P.ctrl.dataset.setData(resp);
} }
}); });
} }
@ -368,7 +368,7 @@ $(document).ready(function(){
return; return;
} }
$P.parsedInfoControl.dataset.setCurrent(dataKey); $P.ctrl.dataset.setCurrent(dataKey);
}; };
$P.createCrdn = () => { $P.createCrdn = () => {
@ -424,7 +424,7 @@ $(document).ready(function(){
}; };
$P.deleteFile = () => { $P.deleteFile = () => {
var current = $P.parsedInfoControl.dataset.getCurrent(); var current = $P.ctrl.dataset.getCurrent();
if(current == null) return; if(current == null) return;
var fileName = current.FILE_NAME; var fileName = current.FILE_NAME;
@ -446,7 +446,7 @@ $(document).ready(function(){
} }
$P.removeCallback = (removedFileName) => { $P.removeCallback = (removedFileName) => {
$P.parsedInfoControl.dataset.remove(removedFileName); $P.ctrl.dataset.remove(removedFileName);
$P.removeTableRow(removedFileName); $P.removeTableRow(removedFileName);
} }
@ -478,7 +478,7 @@ $(document).ready(function(){
$("#btnFileUpload--${pageName}").on("click", function(){ $P.uploadLocalFile(); }); $("#btnFileUpload--${pageName}").on("click", function(){ $P.uploadLocalFile(); });
$("#btnInsertCrdn--${pageName}").on("click", function(){ $("#btnInsertCrdn--${pageName}").on("click", function(){
$P.tempGroup = Object.groupBy($P.parsedInfoControl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID); $P.tempGroup = Object.groupBy($P.ctrl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID);
if($.isEmptyObject($P.tempGroup)){ if($.isEmptyObject($P.tempGroup)){
alert("처리할 자료가 없습니다."); alert("처리할 자료가 없습니다.");
@ -503,7 +503,7 @@ $(document).ready(function(){
} }
}); });
$P.parsedInfoControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
}); });
</script> </script>

@ -255,7 +255,8 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.useTeamControl = new DatasetControl({ //사용중인 팀
$P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:false, dataGetter : obj => obj["List"], appendData:false,
keymapper : info => info ? info.TEAM_ID : "", keymapper : info => info ? info.TEAM_ID : "",
urls : { urls : {
@ -271,8 +272,8 @@ $(document).ready(function(){
DEL_DT : datetimeFormat DEL_DT : datetimeFormat
} }
}); });
//삭제된 팀
$P.delTeamControl = new DatasetControl({ $P.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false, dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "", keymapper : info => info ? info.TEAM_ID : "",
urls : { }, urls : { },
@ -288,24 +289,24 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.useTeamControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("useTeam"); var t = $P.getGridTemplate("useTeam");
var trs = Apply.fromDataset.getTbody($P.useTeamControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderUseTeamList(obj["Total"], $P.useTeamControl.dataset.length, trs); $P.renderUseTeamList(obj["Total"], $P.ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.useTeamControl.dataset, obj, "useTeamPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "useTeamPaging--${pageName}");
}; };
$P.delTeamControl.dataset.onDatasetChange = (obj, option) => { $P.alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("delTeam"); var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody($P.delTeamControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.alt.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], $P.delTeamControl.dataset.length, trs); $P.renderDelTeamList(obj["Total"], $P.alt.dataset.length, trs);
}; };
$P.useTeamControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
$("#teamNm--${pageName}").val(""); $("#teamNm--${pageName}").val("");
$("#crdnSeCd--${pageName}").val(""); $("#crdnSeCd--${pageName}").val("");
@ -317,7 +318,7 @@ $(document).ready(function(){
return; return;
} }
Apply.fromDataset.currentRow($P.useTeamControl.dataset, dataItem, $("#useTeamTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#useTeamTbody--${pageName}")[0]);
$("#teamNm--${pageName}").val(dataItem.data.TEAM_NM); $("#teamNm--${pageName}").val(dataItem.data.TEAM_NM);
$("#crdnSeCd--${pageName}").val(dataItem.data.CRDN_SE_CD); $("#crdnSeCd--${pageName}").val(dataItem.data.CRDN_SE_CD);
@ -340,21 +341,21 @@ $(document).ready(function(){
searchForm.find("input[type='text']").val(""); searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
$P.useTeamControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
var editForm = $("#frmEdit--${pageName}"); var editForm = $("#frmEdit--${pageName}");
editForm.find("input[type='text']").val(""); editForm.find("input[type='text']").val("");
editForm.find("input[type='hidden']").val(""); editForm.find("input[type='hidden']").val("");
$P.delTeamControl.dataset.setData([]); $P.alt.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.useTeamControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do");
$P.useTeamControl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do"); $P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do");
$P.useTeamControl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do"); $P.ctrl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do");
} }
$P.getParams = () => { $P.getParams = () => {
@ -366,16 +367,16 @@ $(document).ready(function(){
$P.searchUseTeamList = () => { $P.searchUseTeamList = () => {
$P.useTeamControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.useTeamControl.load(1); $P.ctrl.load(1);
} }
$P.refreshUseTeamList = () => { $P.refreshUseTeamList = () => {
if($P.useTeamControl.query.pageNum == null){ if($P.ctrl.query.pageNum == null){
$P.useTeamControl.query.pageNum = 1; $P.ctrl.query.pageNum = 1;
} }
$P.useTeamControl.load(1); $P.ctrl.load(1);
} }
$P.getGridTemplate = (gridType) => { $P.getGridTemplate = (gridType) => {
@ -413,7 +414,7 @@ $(document).ready(function(){
} }
$P.clickUseTeamList = (dataKey) => { $P.clickUseTeamList = (dataKey) => {
$P.useTeamControl.dataset.setCurrent(dataKey); $P.ctrl.dataset.setCurrent(dataKey);
} }
$P.fnSave = () => { $P.fnSave = () => {
@ -423,7 +424,7 @@ $(document).ready(function(){
data.taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val(); data.taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.useTeamControl.urls.save, url : $P.ctrl.urls.save,
data : data, data : data,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -434,9 +435,9 @@ $(document).ready(function(){
} }
$P.fnRemove = () => { $P.fnRemove = () => {
var dataKey = $P.useTeamControl.dataset.getCurrent()["TEAM_ID"]; var dataKey = $P.ctrl.dataset.getCurrent()["TEAM_ID"];
ajax.get({ ajax.get({
url : $P.useTeamControl.urls.remove, url : $P.ctrl.urls.remove,
data : { data : {
"teamId" : dataKey "teamId" : dataKey
}, },
@ -462,7 +463,7 @@ $(document).ready(function(){
}, },
success:(resp) => { success:(resp) => {
$P.delTeamControl.dataset.setData(resp); $P.alt.dataset.setData(resp);
} }
}); });

@ -155,7 +155,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.exmptnVhclControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "", keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
urls : { urls : {
@ -172,23 +172,23 @@ $(document).ready(function(){
DEL_DT : datetimeFormat DEL_DT : datetimeFormat
} }
}); });
$P.exmptnVhclControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.exmptnVhclControl.query = { pageNum : 1, fetchSize : $P.exmptnVhclControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.exmptnVhclControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.exmptnVhclControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.exmptnVhclControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.exmptnVhclControl.dataset.length, trs, option); $P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.exmptnVhclControl.dataset, obj, "exmptnVhclPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "exmptnVhclPaging--${pageName}");
}; };
$P.exmptnVhclControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.exmptnVhclControl.dataset, dataItem, $("#exmptnVhclTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#exmptnVhclTbody--${pageName}")[0]);
} }
/************************************************************************** /**************************************************************************
@ -199,44 +199,44 @@ $(document).ready(function(){
searchForm.find("input[type='text']").val(""); searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
$P.exmptnVhclControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.taskSeCd = "BPV"; data.taskSeCd = "BPV";
data.fetchSize = $P.exmptnVhclControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchExmptnVhclList = () => { $P.searchExmptnVhclList = () => {
$P.exmptnVhclControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.exmptnVhclControl.load(1); $P.ctrl.load(1);
} }
$P.scrollExmptnVhclList = () => { $P.scrollExmptnVhclList = () => {
$P.exmptnVhclControl.load($P.exmptnVhclControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshExmptnVhclList = () => { $P.refreshExmptnVhclList = () => {
if($P.exmptnVhclControl.query.pageNum == null){ if($P.ctrl.query.pageNum == null){
$P.exmptnVhclControl.query.pageNum = 1; $P.ctrl.query.pageNum = 1;
} }
$P.exmptnVhclControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.exmptnVhclControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.exmptnVhclControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
$P.exmptnVhclControl.download(); $P.ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -256,7 +256,7 @@ $(document).ready(function(){
$P.renderExmptnVhclList = (total, listLength, trs, option) => { $P.renderExmptnVhclList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.exmptnVhclControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -274,7 +274,7 @@ $(document).ready(function(){
return; return;
} }
if($P.exmptnVhclControl.dataset.getData(dataKey)["DEL_YN"] == "N"){ if($P.ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){
$("#btnOpenDelRsn--${pageName}").prop("disabled", false); $("#btnOpenDelRsn--${pageName}").prop("disabled", false);
} else { } else {
$("#btnOpenDelRsn--${pageName}").prop("disabled", true); $("#btnOpenDelRsn--${pageName}").prop("disabled", true);
@ -283,14 +283,14 @@ $(document).ready(function(){
$("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey); $("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.exmptnVhclControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickExmptnVhclList = (dataKey) => { $P.dblclickExmptnVhclList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
var data = $P.exmptnVhclControl.dataset.getData(dataKey); var data = $P.ctrl.dataset.getData(dataKey);
if(data.DEL_YN == "Y"){ if(data.DEL_YN == "Y"){
dialog.alert({ dialog.alert({
content : "삭제된 자료입니다.", content : "삭제된 자료입니다.",
@ -305,7 +305,7 @@ $(document).ready(function(){
$P.getInfo = (param) => { $P.getInfo = (param) => {
ajax.get({ ajax.get({
url : $P.exmptnVhclControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data: param, data: param,
success:(resp) => { success:(resp) => {
dialog.open({ dialog.open({
@ -334,7 +334,7 @@ $(document).ready(function(){
$P.newInfo = () => { $P.newInfo = () => {
ajax.get({ ajax.get({
url : $P.exmptnVhclControl.urls.newInfo, url : $P.ctrl.urls.newInfo,
data: {}, data: {},
success:(resp) => { success:(resp) => {
dialog.open({ dialog.open({
@ -377,9 +377,9 @@ $(document).ready(function(){
} }
$P.fnRemove = () => { $P.fnRemove = () => {
var dataKey = $P.exmptnVhclControl.dataset.getCurrent()["EXMPTN_VHCL_ID"]; var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({ ajax.get({
url : $P.exmptnVhclControl.urls.remove, url : $P.ctrl.urls.remove,
data : { data : {
"exmptnVhclId" : dataKey, "exmptnVhclId" : dataKey,
"delRsn" : $("#delRsn--${pageName}").val() "delRsn" : $("#delRsn--${pageName}").val()
@ -394,7 +394,7 @@ $(document).ready(function(){
}; };
$P.fnOpenHistory = () => { $P.fnOpenHistory = () => {
var dataKey = $P.exmptnVhclControl.dataset.getCurrent()["EXMPTN_VHCL_ID"]; var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({ ajax.get({
url : wctx.url("/BPV/crdn/crdn08/030/list.do"), url : wctx.url("/BPV/crdn/crdn08/030/list.do"),

@ -94,7 +94,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.exmptnVhclControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj.exmptnVhclInfo, dataGetter : obj => obj.exmptnVhclInfo,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "", keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
urls : { urls : {
@ -110,7 +110,7 @@ $(document).ready(function(){
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.setInfo = (item) => { $P.setInfo = (item) => {
$P.formFields.set($P.exmptnVhclControl, item); $P.formFields.set($P.ctrl, item);
var create = isEmpty(item.EXMPTN_VHCL_ID); var create = isEmpty(item.EXMPTN_VHCL_ID);
$("#vhrno--${pageName}").prop("readonly", !create); $("#vhrno--${pageName}").prop("readonly", !create);
@ -130,7 +130,7 @@ $(document).ready(function(){
var create = isEmpty(info.exmptnVhclId); var create = isEmpty(info.exmptnVhclId);
ajax.post({ ajax.post({
url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create, url : !create ? $P.ctrl.urls.update : $P.ctrl.urls.create,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);

@ -75,7 +75,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.exmptnVhclControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj, appendData:false, dataGetter : obj => obj, appendData:false,
keymapper : info => info ? info.HSTRY_SN : "", keymapper : info => info ? info.HSTRY_SN : "",
urls : { }, urls : { },
@ -93,10 +93,10 @@ $(document).ready(function(){
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.exmptnVhclControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.exmptnVhclControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.exmptnVhclControl.dataset.length, trs); $P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs);
} }
/************************************************************************** /**************************************************************************
@ -124,6 +124,6 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
} }
$P.exmptnVhclControl.dataset.setData(list); $P.ctrl.dataset.setData(list);
}); });
</script> </script>

@ -119,7 +119,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.cvlcptControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter:obj => obj.cvlcptInfo, dataGetter:obj => obj.cvlcptInfo,
keymapper:info => info ? info.CRDN_ID : "", keymapper:info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -134,8 +134,8 @@ $(document).ready(function() {
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.cvlcptControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.cvlcptControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -158,7 +158,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.cvlcptControl.urls.getInfo, url: $P.ctrl.urls.getInfo,
data: { "crdnId" : crdnId }, data: { "crdnId" : crdnId },
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
@ -166,7 +166,7 @@ $(document).ready(function() {
success : (resp) => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.dataset.setData([cvlcptInfo]); $P.ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($("#crdnId--${pageName}").val()); var cs = $P.provided.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs); $("#countStauts--${pageName}").val(cs);
@ -194,7 +194,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
var cvlcptInfo = ${cvlcptInfo}; var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.dataset.setData([cvlcptInfo]); $P.ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($("#crdnId--${pageName}").val()); var cs = $P.provided.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs); $("#countStauts--${pageName}").val(cs);
}); });

@ -86,7 +86,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.cvlcptControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter:obj => obj.cvlcptInfo, dataGetter:obj => obj.cvlcptInfo,
keymapper:info => info ? info.CRDN_ID : "", keymapper:info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -103,8 +103,8 @@ $(document).ready(function() {
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.cvlcptControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.cvlcptControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -127,7 +127,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.cvlcptControl.urls.getInfo, url: $P.ctrl.urls.getInfo,
data: { "crdnId" : crdnId }, data: { "crdnId" : crdnId },
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
@ -135,7 +135,7 @@ $(document).ready(function() {
success : (resp) => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.dataset.setData([cvlcptInfo]); $P.ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val()); var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs); $("#countStauts--${pageName}").val(cs);
@ -156,7 +156,7 @@ $(document).ready(function() {
} }
ajax.post({ ajax.post({
url : $P.cvlcptControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -191,7 +191,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
var cvlcptInfo = ${cvlcptInfo}; var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.dataset.setData([cvlcptInfo]); $P.ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val()); var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs); $("#countStauts--${pageName}").val(cs);

@ -175,7 +175,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.dmndControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.INDIV_ID : "", keymapper : info => info ? info.INDIV_ID : "",
urls : { urls : {
@ -189,23 +189,23 @@ $(document).ready(function(){
RSPNS_DT : datetimeFormat RSPNS_DT : datetimeFormat
} }
}); });
$P.dmndControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.dmndControl.query = { pageNum : 1, fetchSize : $P.dmndControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.dmndControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.dmndControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.dmndControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderDmndList(obj["Total"], $P.dmndControl.dataset.length, trs, option); $P.renderDmndList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.dmndControl.dataset, obj, "dmndPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "dmndPaging--${pageName}");
}; };
$P.dmndControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.dmndControl.dataset, dataItem, $("#dmndTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#dmndTbody--${pageName}")[0]);
} }
/************************************************************************** /**************************************************************************
@ -215,65 +215,65 @@ $(document).ready(function(){
$('#schDmndYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date); $('#schDmndYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schDmndYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schDmndYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.dmndControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.dmndControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
$P.dmndControl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do"); $P.ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
$P.dmndControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do"); $P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.dmndControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchDmndList = () => { $P.searchDmndList = () => {
$P.dmndControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.dmndControl.load(1); $P.ctrl.load(1);
} }
$P.scrollDmndList = () => { $P.scrollDmndList = () => {
$P.dmndControl.load($P.dmndControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshDmndList = () => { $P.refreshDmndList = () => {
if(!$P.dmndControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
$P.dmndControl.beforeCurrent = { $P.ctrl.beforeCurrent = {
key : $P.dmndControl.dataset.getCurrent()["INDIV_ID"], key : $P.ctrl.dataset.getCurrent()["INDIV_ID"],
index : $P.dmndControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
} }
Apply.fromDatasetControl.reload($P.dmndControl).then((resp)=>{ Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.dmndControl.dataset, resp); Apply.toDataset.set($P.ctrl.dataset, resp);
$P.dmndControl.dataset.onDatasetChange(resp, {reloaded : true}); $P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.dmndControl.beforeCurrent != null){ if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.dmndControl.beforeCurrent.key; var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.dmndControl.beforeCurrent.index; var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.dmndControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
if(!$P.dmndControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
var info = $P.dmndControl.dataset.getData(beforeCurrentKey); var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.dmndControl.dataset.setCurrent(beforeCurrentKey,true); $P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.dmndControl.dataset.length - 1)){ if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.dmndControl.dataset.getDataset()[$P.dmndControl.dataset.length - 1]; info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
} else { } else {
info = $P.dmndControl.dataset.getDataset()[beforeCurrentIndex]; info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.dmndControl.dataset.setCurrent(info["INDIV_ID"],true); $P.ctrl.dataset.setCurrent(info["INDIV_ID"],true);
} }
} }
} }
@ -297,7 +297,7 @@ $(document).ready(function(){
$P.renderDmndList = (total, listLength, trs, option) => { $P.renderDmndList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.dmndControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -311,24 +311,24 @@ $(document).ready(function(){
} }
$("#dmndTbody--${pageName}").setCurrentRow(dataKey); $("#dmndTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.dmndControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.fnRemove = (allCompleteDataIds) => { $P.fnRemove = (allCompleteDataIds) => {
if(allCompleteDataIds != null){ if(allCompleteDataIds != null){
$P.dmndControl.dataset.select(allCompleteDataIds,true); $P.ctrl.dataset.select(allCompleteDataIds,true);
} else { } else {
var cur = $P.dmndControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["INDIV_ID"]; var curKey = cur["INDIV_ID"];
$P.dmndControl.dataset.select(curKey,true); $P.ctrl.dataset.select(curKey,true);
} }
var selected = $P.dmndControl.dataset.getKeys("selected"); var selected = $P.ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -338,7 +338,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.dmndControl.urls.remove, url : $P.ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.removeCallback(selected, resp); $P.removeCallback(selected, resp);
@ -356,12 +356,12 @@ $(document).ready(function(){
} }
$P.fnRemoveAllCompleteData = () => { $P.fnRemoveAllCompleteData = () => {
var cur = $P.dmndControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var ds = $P.dmndControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var indivIds = ds.filter(function(item){ var indivIds = ds.filter(function(item){
if(item['STTS_CD'] == '9' || item['STTS_CD'] == 'B'){ if(item['STTS_CD'] == '9' || item['STTS_CD'] == 'B'){
@ -416,7 +416,7 @@ $(document).ready(function(){
info.taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val(); info.taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.dmndControl.urls.create, url : $P.ctrl.urls.create,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -425,7 +425,7 @@ $(document).ready(function(){
$("#toastText--${pageName}").html("등록 되었습니다."); $("#toastText--${pageName}").html("등록 되었습니다.");
$P.toast.show(); $P.toast.show();
if(!$P.dmndControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
sleep(1000).then(() => $P.refreshDmndList()); sleep(1000).then(() => $P.refreshDmndList());
} }
} }

@ -137,7 +137,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.warningWordsControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], dataGetter : obj => obj["List"],
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : "", keymapper : info => info ? info.LEVY_EXCL_RSN_CD : "",
urls : {}, urls : {},
@ -148,16 +148,16 @@ $(document).ready(function(){
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.warningWordsControl.urls = {}; $P.ctrl.urls = {};
$P.warningWordsControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do");
$P.warningWordsControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do"); $P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do");
$P.fnReset(); $P.fnReset();
} }
$P.fnReset = () => { $P.fnReset = () => {
$P.warningWordsControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
$P.renderWarningWordsList(0); $P.renderWarningWordsList(0);
$("#frmEditWarningWords--${pageName}").find("input, textarea").val(""); $("#frmEditWarningWords--${pageName}").find("input, textarea").val("");
@ -174,16 +174,16 @@ $(document).ready(function(){
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.load, url : $P.ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.warningWordsControl.dataset.setData(resp.List); $P.ctrl.dataset.setData(resp.List);
$P.renderWarningWordsList(resp.List.length); $P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){ if(resp.List.length > 0){
var current = $P.warningWordsControl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current); $P.clickWarningWordsList(current);
} }
} }
@ -192,7 +192,7 @@ $(document).ready(function(){
$P.renderWarningWordsList = (total) => { $P.renderWarningWordsList = (total) => {
var warningWordsDS = $P.warningWordsControl.dataset; var warningWordsDS = $P.ctrl.dataset;
var empty = warningWordsDS.empty; var empty = warningWordsDS.empty;
var notFound = [document.getElementById("warningWordsNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("warningWordsNotFound--${pageName}").innerHTML];
var found = document.getElementById("warningWordsRow--${pageName}").innerHTML; var found = document.getElementById("warningWordsRow--${pageName}").innerHTML;
@ -207,7 +207,7 @@ $(document).ready(function(){
$P.radioClickWarningWordsList = (dataKey, gridType) => { $P.radioClickWarningWordsList = (dataKey, gridType) => {
$P.warningWordsControl.dataset.setCurrent(dataKey); $P.ctrl.dataset.setCurrent(dataKey);
$("#warningWordsTbody--${pageName}").setCurrentRow(dataKey); $("#warningWordsTbody--${pageName}").setCurrentRow(dataKey);
@ -225,7 +225,7 @@ $(document).ready(function(){
$P.changeTextarea = () => { $P.changeTextarea = () => {
var curData = $P.warningWordsControl.dataset.getCurrent(); var curData = $P.ctrl.dataset.getCurrent();
if(curData == null){ if(curData == null){
$("#ansRsnCd--${pageName}").val(""); $("#ansRsnCd--${pageName}").val("");
@ -243,20 +243,20 @@ $(document).ready(function(){
$P.refreshWarningWordsInfo = () => { $P.refreshWarningWordsInfo = () => {
var cursor = $P.warningWordsControl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.load, url : $P.ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.warningWordsControl.dataset.setData(resp.List); $P.ctrl.dataset.setData(resp.List);
$P.renderWarningWordsList(resp.List.length); $P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){ if(resp.List.length > 0){
$P.warningWordsControl.dataset.setCurrent(cursor); $P.ctrl.dataset.setCurrent(cursor);
var current = $P.warningWordsControl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current,'warning'); $P.clickWarningWordsList(current,'warning');
} }
@ -281,7 +281,7 @@ $(document).ready(function(){
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){

@ -123,7 +123,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.ntcControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.NTC_ID : "", keymapper : info => info ? info.NTC_ID : "",
urls : { urls : {
@ -135,27 +135,27 @@ $(document).ready(function(){
MDFCN_DT : datetimeFormat MDFCN_DT : datetimeFormat
} }
}); });
$P.ntcControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.ntcControl.query = { pageNum : 1, fetchSize : $P.ntcControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ntcControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.ntcControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ntcControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderNtcList(obj["Total"], $P.ntcControl.dataset.length, trs, option); $P.renderNtcList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ntcControl.dataset, obj, "ntcPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "ntcPaging--${pageName}");
}; };
$P.ntcControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ntcControl.dataset, dataItem, $("#ntcTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#ntcTbody--${pageName}")[0]);
} }
$P.ntcControl.dataset.onSelectionChange = (selectedArr) => { $P.ctrl.dataset.onSelectionChange = (selectedArr) => {
}; };
@ -171,32 +171,32 @@ $(document).ready(function(){
searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd); searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd);
$P.ntcControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ntcControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchNtcList = () => { $P.searchNtcList = () => {
$P.ntcControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.ntcControl.load(1); $P.ctrl.load(1);
} }
$P.scrollNtcList = () => { $P.scrollNtcList = () => {
$P.ntcControl.load($P.ntcControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshNtcList = () => { $P.refreshNtcList = () => {
if($P.ntcControl.query.pageNum == null){ if($P.ctrl.query.pageNum == null){
return; return;
} }
$P.ntcControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -216,7 +216,7 @@ $(document).ready(function(){
$P.renderNtcList = (total, listLength, trs, option) => { $P.renderNtcList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.ntcControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -234,7 +234,7 @@ $(document).ready(function(){
$("#ntcTbody--${pageName}").setCurrentRow(dataKey); $("#ntcTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.ntcControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickNtcList = (dataKey) => { $P.dblclickNtcList = (dataKey) => {
@ -252,7 +252,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ntcControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {

@ -85,7 +85,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.ntcControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.NTC_ID : "", keymapper : info => info ? info.NTC_ID : "",
urls : { urls : {
@ -101,11 +101,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.ntcControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
return; return;
} }
$P.formFields.set($P.ntcControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -117,10 +117,10 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
var create = $P.ntcControl.dataset.empty; var create = $P.ctrl.dataset.empty;
ajax.post({ ajax.post({
url : create ? $P.ntcControl.urls.create : $P.ntcControl.urls.update, url : create ? $P.ctrl.urls.create : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -139,7 +139,7 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
ajax.post({ ajax.post({
url : $P.ntcControl.urls.remove, url : $P.ctrl.urls.remove,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -165,10 +165,10 @@ $(document).ready(function(){
var ntcInfo = ${ntcInfo}; var ntcInfo = ${ntcInfo};
if(ntcInfo == null){ if(ntcInfo == null){
$P.ntcControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
$("#btnRemove--${pageName}").attr("hidden","hidden"); $("#btnRemove--${pageName}").attr("hidden","hidden");
} else { } else {
$P.ntcControl.dataset.setData([ntcInfo]); $P.ctrl.dataset.setData([ntcInfo]);
$("#sggCd--${pageName}").attr("disabled","disabled"); $("#sggCd--${pageName}").attr("disabled","disabled");
if(MY_INFO.institute != "ADMIN00"){ if(MY_INFO.institute != "ADMIN00"){

@ -80,7 +80,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.schdlControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : false, dataGetter : obj => obj["List"], appendData : false,
keymapper : info => info ? info.SCHDL_ID : "", keymapper : info => info ? info.SCHDL_ID : "",
urls : { urls : {
@ -96,11 +96,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.schdlControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
return; return;
} }
$P.formFields.set($P.schdlControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -120,7 +120,7 @@ $(document).ready(function(){
var create = ($("#schdlId--${pageName}").val() == ""); var create = ($("#schdlId--${pageName}").val() == "");
if(create){ if(create){
ajax.post({ ajax.post({
url : $P.schdlControl.urls.create, url : $P.ctrl.urls.create,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -141,7 +141,7 @@ $(document).ready(function(){
}); });
} else { } else {
ajax.post({ ajax.post({
url : $P.schdlControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -168,7 +168,7 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
ajax.post({ ajax.post({
url : $P.schdlControl.urls.remove, url : $P.ctrl.urls.remove,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -201,10 +201,10 @@ $(document).ready(function(){
var schdlInfo = ${schdlInfo}; var schdlInfo = ${schdlInfo};
if(schdlInfo != null){ if(schdlInfo != null){
$P.schdlControl.dataset.setData([schdlInfo]); $P.ctrl.dataset.setData([schdlInfo]);
} else { } else {
$P.schdlControl.dataset.setData([{ SCHDL_BGNG_YMD : "${schdlBgngYmd}", SCHDL_END_YMD : "${schdlEndYmd}" }]); $P.ctrl.dataset.setData([{ SCHDL_BGNG_YMD : "${schdlBgngYmd}", SCHDL_END_YMD : "${schdlEndYmd}" }]);
$("#btnRemove--${pageName}").attr("hidden","hidden"); $("#btnRemove--${pageName}").attr("hidden","hidden");
} }

@ -74,7 +74,7 @@
<th style="width: 80px;" class="cmn">No.</th> <th style="width: 80px;" class="cmn">No.</th>
<th class="cmn" style="width: 56px;"> <th class="cmn" style="width: 56px;">
<input type="checkbox" class="form-check-input" <input type="checkbox" class="form-check-input"
onchange="pageObject['${pageName}'].deptControl.dataset.select(this.checked);" /> onchange="pageObject['${pageName}'].ctrl.dataset.select(this.checked);" />
</th> </th>
<th style="width: 200px;">시군구명</th> <th style="width: 200px;">시군구명</th>
<th style="width: 200px;">시군구코드</th> <th style="width: 200px;">시군구코드</th>
@ -93,7 +93,7 @@
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
<td class="text-center"> <td class="text-center">
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="{DEPT_CD}" <input type="checkbox" class="form-check-input" name="gridCheckbox" value="{DEPT_CD}"
onchange="pageObject['${pageName}'].deptControl.dataset.select('{DEPT_CD}', this.checked);"> onchange="pageObject['${pageName}'].ctrl.dataset.select('{DEPT_CD}', this.checked);">
</td> </td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{SGG_NM}</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-center">{SGG_CD}</td>
@ -153,7 +153,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.deptControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.DEPT_CD : "", keymapper : info => info ? info.DEPT_CD : "",
urls : { urls : {
@ -165,28 +165,28 @@ $(document).ready(function(){
MDFCN_DT : datetimeFormat MDFCN_DT : datetimeFormat
} }
}); });
$P.deptControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.deptControl.query = { pageNum : 1, fetchSize : $P.deptControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.deptControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.deptControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.deptControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderDeptList(obj["Total"], $P.deptControl.dataset.length, trs, option); $P.renderDeptList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.deptControl.dataset, obj, "deptPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "deptPaging--${pageName}");
}; };
$P.deptControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.deptControl.dataset, dataItem, $("#deptTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#deptTbody--${pageName}")[0]);
} }
$P.deptControl.dataset.onSelectionChange = (selectedArr) => { $P.ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.deptControl.dataset, document.getElementById("deptTbody--${pageName}"), 1, selectedArr); Apply.fromDataset.gridCheckbox($P.ctrl.dataset, document.getElementById("deptTbody--${pageName}"), 1, selectedArr);
}; };
@ -202,32 +202,32 @@ $(document).ready(function(){
searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd); searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd);
$P.deptControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.deptControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchDeptList = () => { $P.searchDeptList = () => {
$P.deptControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.deptControl.load(1); $P.ctrl.load(1);
} }
$P.scrollDeptList = () => { $P.scrollDeptList = () => {
$P.deptControl.load($P.deptControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshDeptList = () => { $P.refreshDeptList = () => {
if($P.deptControl.query.pageNum == null){ if($P.ctrl.query.pageNum == null){
return; return;
} }
$P.deptControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -247,7 +247,7 @@ $(document).ready(function(){
$P.renderDeptList = (total, listLength, trs, option) => { $P.renderDeptList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.deptControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -265,7 +265,7 @@ $(document).ready(function(){
$("#deptTbody--${pageName}").setCurrentRow(dataKey); $("#deptTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.deptControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickDeptList = (dataKey) => { $P.dblclickDeptList = (dataKey) => {
@ -279,7 +279,7 @@ $(document).ready(function(){
params.deptCd = deptCd; params.deptCd = deptCd;
ajax.get({ ajax.get({
url : $P.deptControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {

@ -283,7 +283,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.deptControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.DEPT_CD : "", keymapper : info => info ? info.DEPT_CD : "",
urls : { urls : {
@ -297,11 +297,11 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.deptControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
return; return;
} }
$P.formFields.set($P.deptControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -317,10 +317,10 @@ $(document).ready(function(){
return; return;
} }
var create = $P.deptControl.dataset.empty; var create = $P.ctrl.dataset.empty;
ajax.post({ ajax.post({
url : create ? $P.deptControl.urls.create : $P.deptControl.urls.update, url : create ? $P.ctrl.urls.create : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -351,7 +351,7 @@ $(document).ready(function(){
var deptInfo = ${deptInfo}; var deptInfo = ${deptInfo};
$("#deptID--${pageName}").attr("disabled","disabled"); $("#deptID--${pageName}").attr("disabled","disabled");
$("#name--${pageName}").attr("disabled","disabled"); $("#name--${pageName}").attr("disabled","disabled");
$P.deptControl.dataset.setData([deptInfo]); $P.ctrl.dataset.setData([deptInfo]);
if(deptInfo.USE_YN == "N"){ if(deptInfo.USE_YN == "N"){
$("#btnSave--${pageName}").attr("disabled","disabled"); $("#btnSave--${pageName}").attr("disabled","disabled");
} }

@ -186,7 +186,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* datasetControl * datasetControl
**************************************************************************/ **************************************************************************/
$P.detailGridControl = new DatasetControl({ $P.alt = new DatasetControl({
dataGetter : obj => Array.isArray(obj) ? obj : [], appendData:false, dataGetter : obj => Array.isArray(obj) ? obj : [], appendData:false,
keymapper : info => info ? info.DATA_ID : "", keymapper : info => info ? info.DATA_ID : "",
urls : { }, urls : { },
@ -210,9 +210,9 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.detailGridControl.dataset.onDatasetChange = (obj, option) => { $P.alt.dataset.onDatasetChange = (obj, option) => {
var DS = $P.detailGridControl.dataset; var DS = $P.alt.dataset;
var empty = DS.empty; var empty = DS.empty;
var notFound = [""]; var notFound = [""];
var found = document.getElementById("detailGridTbodyTemplate--${pageName}").innerHTML; var found = document.getElementById("detailGridTbodyTemplate--${pageName}").innerHTML;
@ -584,7 +584,7 @@ $(document).ready(function(){
$P.dblClickMasterGrid = (obj) => { $P.dblClickMasterGrid = (obj) => {
var dataKey = obj.dataset.key; var dataKey = obj.dataset.key;
$P.detailGridControl.dataset.setData(refListMap[dataKey]); $P.alt.dataset.setData(refListMap[dataKey]);
var offset = $('#masterArea--${pageName}').offset(); var offset = $('#masterArea--${pageName}').offset();
$('#statWrapper--${pageName}').animate({scrollTop : offset.top}, 400); $('#statWrapper--${pageName}').animate({scrollTop : offset.top}, 400);

Loading…
Cancel
Save