refactor : DatasetControl 이름 수정

main
이범준 4 months ago
parent 97b2685625
commit af80e5aae5

@ -47,7 +47,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj.crdnInfo, dataGetter : obj => obj.crdnInfo,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -61,8 +61,8 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.crdnControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
@ -106,7 +106,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.crdnControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -134,7 +134,7 @@ $(document).ready(function(){
info.chgAmtSe = "0"; info.chgAmtSe = "0";
ajax.post({ ajax.post({
url : $P.crdnControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -168,7 +168,7 @@ $(document).ready(function(){
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/
var crdnInfo = ${crdnInfo}; var crdnInfo = ${crdnInfo};
$P.crdnControl.dataset.setData([crdnInfo]); $P.ctrl.dataset.setData([crdnInfo]);
}); });

@ -138,7 +138,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -154,24 +154,24 @@ $(document).ready(function(){
BLNC : numberFormat BLNC : numberFormat
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
}; };
/************************************************************************** /**************************************************************************
@ -188,57 +188,57 @@ $(document).ready(function(){
$("#byOutput--${pageName}").val("동적 검색"); $("#byOutput--${pageName}").val("동적 검색");
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date); $('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schCrdnYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.crdnControl.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 = "DPV"; data.taskSeCd = "DPV";
data.fetchSize = $P.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.beforeCurrent = { $P.ctrl.beforeCurrent = {
key : $P.crdnControl.dataset.getCurrent()["CRDN_ID"], key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.crdnControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.crdnControl).then((resp)=>{ Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.crdnControl.dataset, resp); Apply.toDataset.set($P.ctrl.dataset, resp);
$P.crdnControl.dataset.onDatasetChange(resp, {reloaded : true}); $P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.crdnControl.beforeCurrent != null){ if($P.ctrl.beforeCurrent != null){
let beforeCurrentKey = $P.crdnControl.beforeCurrent.key; let beforeCurrentKey = $P.ctrl.beforeCurrent.key;
let beforeCurrentIndex = $P.crdnControl.beforeCurrent.index; let beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
if(!$P.crdnControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
var info = $P.crdnControl.dataset.getData(beforeCurrentKey); var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.crdnControl.dataset.setCurrent(beforeCurrentKey,true); $P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){ if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1]; info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
} else { } else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex]; info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true); $P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -248,16 +248,16 @@ $(document).ready(function(){
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -278,7 +278,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -295,18 +295,18 @@ $(document).ready(function(){
} }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
let params = { let params = {
callControlName : "pageObject['${pageName}'].crdnControl" callControlName : "pageObject['${pageName}'].ctrl"
, crdnId : dataKey , crdnId : dataKey
} }
ajax.get({ ajax.get({
url : $P.crdnControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -322,7 +322,7 @@ $(document).ready(function(){
} }
$P.save = () => { $P.save = () => {
if(!$P.crdnControl.dataset.getCurrent()) { if(!$P.ctrl.dataset.getCurrent()) {
dialog.alert({ dialog.alert({
content : "선택된 자료가 없습니다.", content : "선택된 자료가 없습니다.",
init : function(){ init : function(){
@ -338,9 +338,9 @@ $(document).ready(function(){
focusOK(); focusOK();
}, },
onOK : () => { onOK : () => {
var info = { 'crdnId' : $P.crdnControl.dataset.getCurrent()["CRDN_ID"] }; var info = { 'crdnId' : $P.ctrl.dataset.getCurrent()["CRDN_ID"] };
ajax.post({ ajax.post({
url : $P.crdnControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);

@ -122,7 +122,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -134,27 +134,27 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
$P.crdnControl.urls.newInfoByFile = ""; $P.ctrl.urls.newInfoByFile = "";
$P.crdnControl.urls.newInfoByHand = ""; $P.ctrl.urls.newInfoByHand = "";
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
} }
/************************************************************************** /**************************************************************************
@ -162,14 +162,14 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.fnReset = () => { $P.fnReset = () => {
$("#regDt--${pageName}").datepicker('setDate', TODAY()); $("#regDt--${pageName}").datepicker('setDate', TODAY());
$P.crdnControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do");
$P.crdnControl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do"); $P.ctrl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do");
$P.crdnControl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do"); $P.ctrl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do");
switch(taskSeCd){ switch(taskSeCd){
case "PVS" : case "PVS" :
@ -189,21 +189,21 @@ $(document).ready(function(){
$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.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
@ -224,7 +224,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.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,14 +242,14 @@ $(document).ready(function(){
} }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
$P.crdnControl.dataset.setCurrent(dataKey); $P.ctrl.dataset.setCurrent(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.newInfo = (type) => { $P.newInfo = (type) => {
var url = ""; var url = "";
if(type == "file") url = $P.crdnControl.urls.newInfoByFile; if(type == "file") url = $P.ctrl.urls.newInfoByFile;
if(type == "hand") url = $P.crdnControl.urls.newInfoByHand; if(type == "hand") url = $P.ctrl.urls.newInfoByHand;
var dialogId = ""; var dialogId = "";
if(type == "file") dialogId = "fileDialog"; if(type == "file") dialogId = "fileDialog";

@ -382,7 +382,7 @@ $(document).ready(function(){
$P.uploadSet = uploadSupport("#inputUploadSet--${pageName}"); $P.uploadSet = uploadSupport("#inputUploadSet--${pageName}");
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -479,7 +479,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.crdnControl.urls.create, url : $P.ctrl.urls.create,
data : formData, contentType : false, processData : false, data : formData, contentType : false, processData : false,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -735,7 +735,7 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.crdnControl.dataset.append({}); $P.ctrl.dataset.append({});
}); });
</script> </script>

@ -304,7 +304,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -329,28 +329,28 @@ $(document).ready(function(){
PRK_PSBLTY_RSLT_CD : FIM034 PRK_PSBLTY_RSLT_CD : FIM034
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
} }
$P.crdnControl.dataset.onSelectionChange = (selectedArr) => { $P.ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.crdnControl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr); Apply.fromDataset.gridCheckbox($P.ctrl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr);
Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnSendCrdn--${pageName}")[0], selectedArr); Apply.fromDataset.gridButton($P.ctrl.dataset, $("#btnSendCrdn--${pageName}")[0], selectedArr);
}; };
/************************************************************************** /**************************************************************************
@ -368,13 +368,13 @@ $(document).ready(function(){
$("#schRgtrNm--${pageName}").prop("readonly", true); // 사용자 이름 $("#schRgtrNm--${pageName}").prop("readonly", true); // 사용자 이름
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-365).date); $('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-365).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schCrdnYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.crdnControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do");
$P.crdnControl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); $P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
var clsForTask = taskSeCd.toLowerCase(); var clsForTask = taskSeCd.toLowerCase();
@ -406,43 +406,43 @@ $(document).ready(function(){
$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.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.fnExcelDown = (forApproval) => { $P.fnExcelDown = (forApproval) => {
if($P.crdnControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
if(forApproval){ if(forApproval){
$P.crdnControl.query.includePhoto = "Y"; $P.ctrl.query.includePhoto = "Y";
} else { } else {
$P.crdnControl.query.includePhoto = "N"; $P.ctrl.query.includePhoto = "N";
} }
$P.crdnControl.download(); $P.ctrl.download();
$P.crdnControl.query.includePhoto = null; $P.ctrl.query.includePhoto = null;
}; };
$P.checkCrdnList = (element, bool) => { $P.checkCrdnList = (element, bool) => {
@ -451,7 +451,7 @@ $(document).ready(function(){
var atLeastOne = GRID.checkbox.countChecked(element) > 0; var atLeastOne = GRID.checkbox.countChecked(element) > 0;
$("#btnSendCrdn--${pageName}").prop("disabled", !atLeastOne); $("#btnSendCrdn--${pageName}").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.crdnControl.dataset, element, bool); Apply.toDataset.selection($P.ctrl.dataset, element, bool);
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -479,7 +479,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -496,17 +496,17 @@ $(document).ready(function(){
} }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
var params = { var params = {
callControlName : "pageObject['${pageName}'].crdnControl", callControlName : "pageObject['${pageName}'].ctrl",
crdnId : dataKey crdnId : dataKey
}; };
ajax.get({ ajax.get({
url : $P.crdnControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -522,10 +522,10 @@ $(document).ready(function(){
} }
$P.fnSendCrdn = () => { $P.fnSendCrdn = () => {
var datas = $P.crdnControl.dataset.getDataset("selected"); var datas = $P.ctrl.dataset.getDataset("selected");
var taskSeCd = datas[0].TASK_SE_CD; var taskSeCd = datas[0].TASK_SE_CD;
var keys = $P.crdnControl.dataset.getKeys("selected"); var keys = $P.ctrl.dataset.getKeys("selected");
var url = ""; var url = "";
if(taskSeCd == "PVS"){ if(taskSeCd == "PVS"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do"; url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do";

@ -242,7 +242,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -257,24 +257,24 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
if(!dataItem){ if(!dataItem){
$("#bottomCrdnPlc--${pageName}").val(""); $("#bottomCrdnPlc--${pageName}").val("");
@ -318,20 +318,20 @@ $(document).ready(function(){
$('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date); $('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.crdnControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do");
$P.crdnControl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do"); $P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do");
$P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); $P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/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.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
@ -342,44 +342,44 @@ $(document).ready(function(){
$("#btnDelete--${pageName}").show(); $("#btnDelete--${pageName}").show();
$("#btnDeleteSameRcptYmd--${pageName}").show(); $("#btnDeleteSameRcptYmd--${pageName}").show();
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.beforeCurrent = { $P.ctrl.beforeCurrent = {
key : $P.crdnControl.dataset.getCurrent()["CRDN_ID"], key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.crdnControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.crdnControl).then((resp)=>{ Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.crdnControl.dataset, resp); Apply.toDataset.set($P.ctrl.dataset, resp);
$P.crdnControl.dataset.onDatasetChange(resp, {reloaded : true}); $P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.crdnControl.beforeCurrent != null){ if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.crdnControl.beforeCurrent.key; var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index; var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
if(!$P.crdnControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
var info = $P.crdnControl.dataset.getData(beforeCurrentKey); var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.crdnControl.dataset.setCurrent(beforeCurrentKey,true); $P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){ if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1]; info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
} else { } else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex]; info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true); $P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -390,16 +390,16 @@ $(document).ready(function(){
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -419,7 +419,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -443,7 +443,7 @@ $(document).ready(function(){
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
$("#bottomCrdnPlc--${pageName}").val($P.crdnControl.dataset.getData(dataKey)["CRDN_PLC"]); $("#bottomCrdnPlc--${pageName}").val($P.ctrl.dataset.getData(dataKey)["CRDN_PLC"]);
if($P.holdList.includes(dataKey)){ if($P.holdList.includes(dataKey)){
$("#btnOpenCvlcptOrgnl--${pageName}").hide(); $("#btnOpenCvlcptOrgnl--${pageName}").hide();
@ -455,7 +455,7 @@ $(document).ready(function(){
$("#btnDeleteSameRcptYmd--${pageName}").show(); $("#btnDeleteSameRcptYmd--${pageName}").show();
} }
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -467,7 +467,7 @@ $(document).ready(function(){
var dialogId = "cvlcptInitialDataEditDialog--${pageName}"; var dialogId = "cvlcptInitialDataEditDialog--${pageName}";
ajax.get({ ajax.get({
url : $P.crdnControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : { data : {
"crdnId" : dataKey, "crdnId" : dataKey,
"openerPageName" : "${pageName}" "openerPageName" : "${pageName}"
@ -501,7 +501,7 @@ $(document).ready(function(){
$P.fnHold = () => { $P.fnHold = () => {
var curKey = $P.crdnControl.dataset.getCurrent()["CRDN_ID"]; var curKey = $P.ctrl.dataset.getCurrent()["CRDN_ID"];
if($P.holdList.includes(curKey)){ if($P.holdList.includes(curKey)){
return; return;
} }
@ -516,7 +516,7 @@ $(document).ready(function(){
$P.fnRemove = (rcptYmd) => { $P.fnRemove = (rcptYmd) => {
if(rcptYmd != null){ if(rcptYmd != null){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var crdnIds = []; var crdnIds = [];
@ -531,18 +531,18 @@ $(document).ready(function(){
crdnIds.push(filtered[i].CRDN_ID); crdnIds.push(filtered[i].CRDN_ID);
} }
$P.crdnControl.dataset.select(crdnIds,true); $P.ctrl.dataset.select(crdnIds,true);
} else { } else {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["CRDN_ID"]; var curKey = cur["CRDN_ID"];
$P.crdnControl.dataset.select(curKey,true); $P.ctrl.dataset.select(curKey,true);
} }
var selected = $P.crdnControl.dataset.getKeys("selected"); var selected = $P.ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -552,7 +552,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.crdnControl.urls.remove, url : $P.ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.removeCallback(resp); $P.removeCallback(resp);
@ -568,7 +568,7 @@ $(document).ready(function(){
}; };
$P.fnRemoveSameRcptYmd = () => { $P.fnRemoveSameRcptYmd = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -586,7 +586,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -624,12 +624,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length; return (index+1) + " of " + ds.length;
}, },
"getNextKey" : function(currentKey){ "getNextKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){ if(ds.length > index+1){
if($P.holdList.includes(ds[index+1]["CRDN_ID"])){ if($P.holdList.includes(ds[index+1]["CRDN_ID"])){
@ -642,7 +642,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){ if(index != 0 && ds.length > 1){
if($P.holdList.includes(ds[index-1]["CRDN_ID"])){ if($P.holdList.includes(ds[index-1]["CRDN_ID"])){
@ -664,7 +664,7 @@ $(document).ready(function(){
$P.refreshCrdnList(); $P.refreshCrdnList();
}, },
"hasData" : function(key){ "hasData" : function(key){
if($P.crdnControl.dataset.getData(key) == null){ if($P.ctrl.dataset.getData(key) == null){
return false; return false;
} else { } else {
return true; return true;

@ -421,7 +421,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter:obj => obj.crdnInfo, dataGetter:obj => obj.crdnInfo,
keymapper:info => info ? info.CRDN_ID : "", keymapper:info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -439,8 +439,8 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.crdnControl,dataItem); $P.formFields.set($P.ctrl,dataItem);
} }
@ -509,7 +509,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.crdnControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -580,7 +580,7 @@ $(document).ready(function(){
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.crdnControl.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"
@ -588,7 +588,7 @@ $(document).ready(function(){
success : (resp) => { success : (resp) => {
var crdnInfo = resp.crdnInfo; var crdnInfo = resp.crdnInfo;
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN); crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.crdnControl.dataset.setData([crdnInfo]); $P.ctrl.dataset.setData([crdnInfo]);
$("#btnViewCrdnList--${pageName}").attr("hidden","hidden"); $("#btnViewCrdnList--${pageName}").attr("hidden","hidden");
$("#btnViewCvlcptDscsnList--${pageName}").attr("hidden","hidden"); $("#btnViewCvlcptDscsnList--${pageName}").attr("hidden","hidden");
@ -617,7 +617,7 @@ $(document).ready(function(){
if(await confirm2("현 자료의 복사본을 생성하시겠습니까?")){ if(await confirm2("현 자료의 복사본을 생성하시겠습니까?")){
ajax.get({ ajax.get({
url : $P.crdnControl.urls.create, url : $P.ctrl.urls.create,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : (resp) => { success : (resp) => {
if (resp.saved) { if (resp.saved) {
@ -817,7 +817,7 @@ $(document).ready(function(){
var crdnId = $("#crdnId--${pageName}").val(); var crdnId = $("#crdnId--${pageName}").val();
ajax.post({ ajax.post({
url : $P.crdnControl.urls.remove, url : $P.ctrl.urls.remove,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -1173,7 +1173,7 @@ $(document).ready(function(){
var crdnInfo = ${crdnInfo}; var crdnInfo = ${crdnInfo};
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN); crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.crdnControl.dataset.setData([crdnInfo]); $P.ctrl.dataset.setData([crdnInfo]);
if($("#taskSeCd--${pageName}").val() == "DPV" && $("#vltnCd--${pageName}").val() == "01"){ if($("#taskSeCd--${pageName}").val() == "DPV" && $("#vltnCd--${pageName}").val() == "01"){
$("label[for='dstrbncYn--${pageName}']").show(); $("label[for='dstrbncYn--${pageName}']").show();

@ -248,7 +248,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -264,31 +264,31 @@ $(document).ready(function(){
LEVY_EXCL_RSN_CD : FIM022 LEVY_EXCL_RSN_CD : FIM022
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
} }
$P.crdnControl.dataset.onSelectionChange = (selectedArr) => { $P.ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.crdnControl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr); Apply.fromDataset.gridCheckbox($P.ctrl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr);
Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnExecuteAnswer--${pageName}")[0], selectedArr); Apply.fromDataset.gridButton($P.ctrl.dataset, $("#btnExecuteAnswer--${pageName}")[0], selectedArr);
Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnAnswerComplete--${pageName}")[0], selectedArr); Apply.fromDataset.gridButton($P.ctrl.dataset, $("#btnAnswerComplete--${pageName}")[0], selectedArr);
Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnExecuteDisabledTagInfoInquire--${pageName}")[0], selectedArr); Apply.fromDataset.gridButton($P.ctrl.dataset, $("#btnExecuteDisabledTagInfoInquire--${pageName}")[0], selectedArr);
}; };
/************************************************************************** /**************************************************************************
@ -306,7 +306,7 @@ $(document).ready(function(){
$('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-31).date); $('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-31).date);
$('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.crdnControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = taskSeCd => { $P.fnResetAndChangeBiz = taskSeCd => {
@ -318,53 +318,53 @@ $(document).ready(function(){
$("#btnExecuteDisabledTagInfoInquire--${pageName}").on("click", () => $P.fnExecuteDisabledTagInfoInquire()); $("#btnExecuteDisabledTagInfoInquire--${pageName}").on("click", () => $P.fnExecuteDisabledTagInfoInquire());
$P.fnReset(); $P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do");
$P.crdnControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do"); $P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do");
$P.crdnControl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); $P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.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.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.reload({all : true}); $P.ctrl.reload({all : true});
} }
$P.fnExcelDown = (forApproval) => { $P.fnExcelDown = (forApproval) => {
if($P.crdnControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
if(forApproval){ if(forApproval){
$P.crdnControl.query.includePhoto = "Y"; $P.ctrl.query.includePhoto = "Y";
} else { } else {
$P.crdnControl.query.includePhoto = "N"; $P.ctrl.query.includePhoto = "N";
} }
$P.crdnControl.download(); $P.ctrl.download();
$P.crdnControl.query.includePhoto = null; $P.ctrl.query.includePhoto = null;
}; };
@ -385,7 +385,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -399,7 +399,7 @@ $(document).ready(function(){
$("#crdnTbody--${pageName}").find("tr[data-key]").each(function(item){ $("#crdnTbody--${pageName}").find("tr[data-key]").each(function(item){
var crdnId = this.dataset.key; var crdnId = this.dataset.key;
var data = $P.crdnControl.dataset.getData(crdnId); var data = $P.ctrl.dataset.getData(crdnId);
if(data.COPY_EXIST_YN == "Y"){ if(data.COPY_EXIST_YN == "Y"){
$(this).addClass("text-red"); $(this).addClass("text-red");
@ -419,7 +419,7 @@ $(document).ready(function(){
$("#btnAnswerComplete--${pageName}").prop("disabled", !atLeastOne); $("#btnAnswerComplete--${pageName}").prop("disabled", !atLeastOne);
$("#btnExecuteDisabledTagInfoInquire--${pageName}").prop("disabled", !atLeastOne); $("#btnExecuteDisabledTagInfoInquire--${pageName}").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.crdnControl.dataset, element, bool); Apply.toDataset.selection($P.ctrl.dataset, element, bool);
} }
$P.clickCrdnList = (dataKey) => { $P.clickCrdnList = (dataKey) => {
@ -428,17 +428,17 @@ $(document).ready(function(){
} }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
let params = { let params = {
callControlName : "pageObject['${pageName}'].crdnControl" callControlName : "pageObject['${pageName}'].ctrl"
, crdnId : dataKey , crdnId : dataKey
} }
ajax.get({ ajax.get({
url : $P.crdnControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -454,7 +454,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -491,7 +491,7 @@ $(document).ready(function(){
} }
$P.fnOpenAnswerPreview = () => { $P.fnOpenAnswerPreview = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -529,7 +529,7 @@ $(document).ready(function(){
$P.fnExecuteAnswer = () => { $P.fnExecuteAnswer = () => {
var count = $P.crdnControl.dataset.getKeys("selected").length; var count = $P.ctrl.dataset.getKeys("selected").length;
dialog.alert({ dialog.alert({
content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?", content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?",
@ -544,7 +544,7 @@ $(document).ready(function(){
$P.fnAnswerComplete = () => { $P.fnAnswerComplete = () => {
var count = $P.crdnControl.dataset.getKeys("selected").length; var count = $P.ctrl.dataset.getKeys("selected").length;
dialog.alert({ dialog.alert({
content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?", content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?",
@ -561,10 +561,10 @@ $(document).ready(function(){
$P.save = (processType) => { $P.save = (processType) => {
ajax.post({ ajax.post({
url : $P.crdnControl.urls.update, url : $P.ctrl.urls.update,
data : { data : {
"processType" : processType, "processType" : processType,
"crdnIds" : $P.crdnControl.dataset.getKeys("selected").join(",") "crdnIds" : $P.ctrl.dataset.getKeys("selected").join(",")
}, },
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -585,7 +585,7 @@ $(document).ready(function(){
var keys = []; var keys = [];
var selected = $P.crdnControl.dataset.getDataset("selected"); var selected = $P.ctrl.dataset.getDataset("selected");
for(var i=0; i < selected.length; i++){ for(var i=0; i < selected.length; i++){
if(selected[i].CVLCPT_PRCS_CD == "02"){ if(selected[i].CVLCPT_PRCS_CD == "02"){
@ -639,12 +639,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length; return (index+1) + " of " + ds.length;
}, },
"getNextKey" : function(currentKey){ "getNextKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){ if(ds.length > index+1){
return ds[index+1]["CRDN_ID"]; return ds[index+1]["CRDN_ID"];
@ -653,7 +653,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){ if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"]; return ds[index-1]["CRDN_ID"];

@ -238,7 +238,7 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
urls : { urls : {
@ -253,25 +253,25 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.ctrl.defaultFetchSize = FETCH_XS;
$P.crdnControl.query = { pageNum : 1, fetchSize : $P.crdnControl.defaultFetchSize }; $P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.dataset.onDatasetChange = (obj, option) => { $P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}"); Apply.fromDataset.paging($P.ctrl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.dataset.onCurrentChange = (dataItem) => { $P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]); Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
} }
@ -290,64 +290,64 @@ $(document).ready(function(){
$('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-365).date); $('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-365).date);
$('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY()); $('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.crdnControl.dataset.setData([]); $P.ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do");
$P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); $P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
$P.crdnControl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); $P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.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.crdnControl.defaultFetchSize; data.fetchSize = $P.ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
$P.crdnControl.load(1); $P.ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.ctrl.load($P.ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.crdnControl.beforeCurrent = { $P.ctrl.beforeCurrent = {
key : $P.crdnControl.dataset.getCurrent()["CRDN_ID"], key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.crdnControl.dataset.getCurrent()["ROW_NUM"] - 1 index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.crdnControl).then((resp)=>{ Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.crdnControl.dataset, resp); Apply.toDataset.set($P.ctrl.dataset, resp);
$P.crdnControl.dataset.onDatasetChange(resp, {reloaded : true}); $P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.crdnControl.beforeCurrent != null){ if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.crdnControl.beforeCurrent.key; var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index; var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.crdnControl.beforeCurrent = null; $P.ctrl.beforeCurrent = null;
if(!$P.crdnControl.dataset.empty){ if(!$P.ctrl.dataset.empty){
var info = $P.crdnControl.dataset.getData(beforeCurrentKey); var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.crdnControl.dataset.setCurrent(beforeCurrentKey,true); $P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){ if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1]; info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
} else { } else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex]; info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true); $P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -357,16 +357,16 @@ $(document).ready(function(){
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){ if($P.ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -387,7 +387,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => { $P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total); let noMore = (listLength >= total);
var initScroll = ($P.crdnControl.query.pageNum < 2); var initScroll = ($P.ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -406,17 +406,17 @@ $(document).ready(function(){
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey); Apply.toDataset.current($P.ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
let params = { let params = {
callControlName : "pageObject['${pageName}'].crdnControl" callControlName : "pageObject['${pageName}'].ctrl"
, crdnId : dataKey , crdnId : dataKey
} }
ajax.get({ ajax.get({
url : $P.crdnControl.urls.getInfo, url : $P.ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -432,15 +432,15 @@ $(document).ready(function(){
$P.fnRemove = () => { $P.fnRemove = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["CRDN_ID"]; var curKey = cur["CRDN_ID"];
$P.crdnControl.dataset.select(curKey,true); $P.ctrl.dataset.select(curKey,true);
var selected = $P.crdnControl.dataset.getKeys("selected"); var selected = $P.ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -450,7 +450,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.crdnControl.urls.remove, url : $P.ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.saveCallback(selected, resp); $P.saveCallback(selected, resp);
@ -466,7 +466,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.crdnControl.dataset.getCurrent(); var cur = $P.ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -504,12 +504,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length; return (index+1) + " of " + ds.length;
}, },
"getNextKey" : function(currentKey){ "getNextKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){ if(ds.length > index+1){
return ds[index+1]["CRDN_ID"]; return ds[index+1]["CRDN_ID"];
@ -518,7 +518,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset(); var ds = $P.ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey); var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){ if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"]; return ds[index-1]["CRDN_ID"];
@ -533,7 +533,7 @@ $(document).ready(function(){
$P.refreshCrdnList(); $P.refreshCrdnList();
}, },
"hasData" : function(key){ "hasData" : function(key){
if($P.crdnControl.dataset.getData(key) == null){ if($P.ctrl.dataset.getData(key) == null){
return false; return false;
} else { } else {
return true; return true;

Loading…
Cancel
Save