소스 정리

main
이범준 3 months ago
parent 81804c1787
commit 6bdb41447a

@ -132,9 +132,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -146,29 +146,27 @@ $(document).ready(function(){
MDFCN_DT : datetimeFormat MDFCN_DT : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
/**************************************************************************
* Dataset.on ctrl.dataset.onDatasetChange = (obj, option) => {
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderLayoutList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderLayoutList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("layoutPaging"), $P.findn("layoutPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("layoutPaging"), $P.findn("layoutPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("layoutTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("layoutTbody"));
} }
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do"); ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do");
$P.fnReset(); $P.fnReset();
} }
@ -180,32 +178,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.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchLayoutList = () => { $P.searchLayoutList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollLayoutList = () => { $P.scrollLayoutList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshLayoutList = () => { $P.refreshLayoutList = () => {
if($P.ctrl.query.pageNum == null){ if(ctrl.query.pageNum == null){
return; return;
} }
$P.ctrl.reload({all : true}); ctrl.reload({all : true});
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -225,7 +223,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -242,7 +240,7 @@ $(document).ready(function(){
$P.$findn("layoutTbody").setCurrentRow(dataKey); $P.$findn("layoutTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickLayoutList = (dataKey) => { $P.dblclickLayoutList = (dataKey) => {
@ -260,7 +258,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {

@ -264,11 +264,11 @@ $(document).ready(function(){
} }
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -281,14 +281,11 @@ $(document).ready(function(){
} }
}); });
/************************************************************************** ctrl.dataset.onCurrentChange = (dataItem) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
return; return;
} }
$P.formFields.set($P.ctrl, dataItem); $P.formFields.set(ctrl, dataItem);
} }
/************************************************************************** /**************************************************************************
@ -300,10 +297,10 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
var create = $P.ctrl.dataset.empty; var create = ctrl.dataset.empty;
ajax.post({ ajax.post({
url : create ? $P.ctrl.urls.create : $P.ctrl.urls.update, url : create ? ctrl.urls.create : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -326,7 +323,7 @@ $(document).ready(function(){
var info = $P.formFields.get(); var info = $P.formFields.get();
ajax.post({ ajax.post({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : { data : {
fileLayoutId : info.fileLayoutId fileLayoutId : info.fileLayoutId
}, },
@ -358,9 +355,9 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
var layoutInfo = ${layoutInfo}; var layoutInfo = ${layoutInfo};
if(layoutInfo != null){ if(layoutInfo != null){
$P.ctrl.dataset.setData([layoutInfo]); ctrl.dataset.setData([layoutInfo]);
} else { } else {
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
$P.$findn("sggCd").val(MY_INFO.info.sggCd); $P.$findn("sggCd").val(MY_INFO.info.sggCd);
$P.$findn("instCd").val(MY_INFO.info.instCd); $P.$findn("instCd").val(MY_INFO.info.instCd);

@ -393,16 +393,16 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
//단속사진검사 datasetControl 인스턴스 //단속사진검사 datasetControl 인스턴스
$P.ctrl = newCrdn02010Control(); var ctrl = $P.ctrl = newCrdn02010Control();
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
$P.ctrl.getNext = (key) => { ctrl.getNext = (key) => {
var ds = $P.ctrl.dataset.getDataset(); var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == key); var index = ds.findIndex(item => item.CRDN_ID == key);
if(ds.length > index+1){ if(ds.length > index+1){
@ -411,40 +411,28 @@ $(document).ready(function(){
return null; return null;
} }
} }
ctrl.dataset.onDatasetChange = (obj, option) => {
//동일차량검사 datasetControl 인스턴스
$P.alt = newCrdn02010Alt();
$P.alt.defaultFetchSize = FETCH_XS;
$P.alt.query = { pageNum : 1, fetchSize : $P.alt.defaultFetchSize };
$P.alt.beforeCurrent = null;
$P.shift = new newCrdn02010Shift();
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("photoInspection"); var t = $P.getGridTemplate("photoInspection");
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.ctrl.dataset.length, trs, "photoInspection", option); $P.renderInspectionDataList(obj["Total"], ctrl.dataset.length, trs, "photoInspection", option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, Apply.fromDataset.paging(ctrl.dataset, obj,
$P.findn("photoInspectionPaging"), $P.findn("photoInspectionPagingInfo") $P.findn("photoInspectionPaging"), $P.findn("photoInspectionPagingInfo")
); );
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("photoInspectionTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("photoInspectionTbody"));
var dataKey = ""; var dataKey = "";
var curDataVhrno = ""; var curDataVhrno = "";
var nextDataKey = ""; var nextDataKey = "";
var nextDataVhrno = ""; var nextDataVhrno = "";
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
dataKey = $P.ctrl.dataset.getKey(dataItem); dataKey = ctrl.dataset.getKey(dataItem);
curDataVhrno = $P.ctrl.dataset.getData(dataKey)["VHRNO"]; curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.ctrl.getNext(dataKey); var nextData = ctrl.getNext(dataKey);
nextDataKey = nextData != null ? nextData.CRDN_ID : ""; nextDataKey = nextData != null ? nextData.CRDN_ID : "";
nextDataVhrno = nextData != null ? nextData.VHRNO : ""; nextDataVhrno = nextData != null ? nextData.VHRNO : "";
} }
@ -452,19 +440,25 @@ $(document).ready(function(){
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno); $P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
} }
$P.alt.dataset.onDatasetChange = (obj, option) => { //동일차량검사 datasetControl 인스턴스
var alt = $P.alt = newCrdn02010Alt();
alt.defaultFetchSize = FETCH_XS;
alt.query = { pageNum : 1, fetchSize : alt.defaultFetchSize };
alt.beforeCurrent = null;
alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionMain"); var t = $P.getGridTemplate("sameVehicleInspectionMain");
var trs = Apply.fromDataset.getTbody($P.alt.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(alt.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.alt.dataset.length, trs, "sameVehicleInspectionMain", option); $P.renderInspectionDataList(obj["Total"], alt.dataset.length, trs, "sameVehicleInspectionMain", option);
Apply.fromDataset.paging($P.alt.dataset, obj, Apply.fromDataset.paging(alt.dataset, obj,
$P.findn("sameVehicleInspectionMainPaging"), $P.findn("sameVehicleInspectionMainPagingInfo") $P.findn("sameVehicleInspectionMainPaging"), $P.findn("sameVehicleInspectionMainPagingInfo")
); );
}; };
$P.alt.dataset.onCurrentChange = (dataItem) => { alt.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.alt.dataset, dataItem, $P.findn("sameVehicleInspectionMainTbody")); Apply.fromDataset.currentRow(alt.dataset, dataItem, $P.findn("sameVehicleInspectionMainTbody"));
if(dataItem){ if(dataItem){
$P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]); $P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]);
} else { } else {
@ -472,16 +466,19 @@ $(document).ready(function(){
} }
} }
$P.shift.dataset.onDatasetChange = (obj, option) => { var shift = $P.shift = new newCrdn02010Shift();
shift.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionSub"); var t = $P.getGridTemplate("sameVehicleInspectionSub");
var trs = Apply.fromDataset.getTbody($P.shift.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(shift.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.shift.dataset.length, trs, "sameVehicleInspectionSub", option); $P.renderInspectionDataList(obj["Total"], shift.dataset.length, trs, "sameVehicleInspectionSub", option);
}; };
$P.shift.dataset.onCurrentChange = (dataItem) => { shift.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.shift.dataset, dataItem, $P.findn("sameVehicleInspectionSubTbody")); Apply.fromDataset.currentRow(shift.dataset, dataItem, $P.findn("sameVehicleInspectionSubTbody"));
}; };
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -497,15 +494,15 @@ $(document).ready(function(){
$P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름 $P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-7)); $P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-7));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY()); $P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
$P.alt.dataset.setData([]); alt.dataset.setData([]);
}; };
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.alt.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); alt.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.shift.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); shift.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
var clsForTask = taskSeCd.toLowerCase(); var clsForTask = taskSeCd.toLowerCase();
//업무별 조회조건 //업무별 조회조건
@ -524,9 +521,9 @@ $(document).ready(function(){
var data = formFields.get(); var data = formFields.get();
if($P.currentDisplay == "photoInspection"){ if($P.currentDisplay == "photoInspection"){
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
} else if($P.currentDisplay == "sameVehicleInspection"){ } else if($P.currentDisplay == "sameVehicleInspection"){
data.fetchSize = $P.alt.defaultFetchSize; data.fetchSize = alt.defaultFetchSize;
} }
return data; return data;
@ -535,34 +532,34 @@ $(document).ready(function(){
$P.searchInspectionList = () => { $P.searchInspectionList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.query.inspectionDataType = "photo"; ctrl.query.inspectionDataType = "photo";
$P.ctrl.load(1); ctrl.load(1);
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.alt.query = $P.getParams(); alt.query = $P.getParams();
$P.alt.query.inspectionDataType = "sameVehicleMain"; alt.query.inspectionDataType = "sameVehicleMain";
$P.alt.load(1); alt.load(1);
break; break;
default: break; default: break;
} }
} }
$P.searchDetailInspectionDataList = (dataKey) => { $P.searchDetailInspectionDataList = (dataKey) => {
$P.shift.query = {}; shift.query = {};
$P.shift.query.inspectionDataType = "sameVehicleSub"; shift.query.inspectionDataType = "sameVehicleSub";
$P.shift.query.crdnIds = dataKey; shift.query.crdnIds = dataKey;
$P.shift.query.taskSeCd = $P.alt.query.taskSeCd; shift.query.taskSeCd = alt.query.taskSeCd;
$P.shift.load(0); shift.load(0);
} }
$P.scrollInspectionDataList = () => { $P.scrollInspectionDataList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.alt.load($P.alt.query.pageNum + 1); alt.load(alt.query.pageNum + 1);
break; break;
default: break; default: break;
} }
@ -571,35 +568,35 @@ $(document).ready(function(){
$P.refreshInspectionList = () => { $P.refreshInspectionList = () => {
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
$P.ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"], key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1 index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){ if(ctrl.beforeCurrent != null){
let beforeCurrentKey = $P.ctrl.beforeCurrent.key; let beforeCurrentKey = ctrl.beforeCurrent.key;
let beforeCurrentIndex = $P.ctrl.beforeCurrent.index; let beforeCurrentIndex = ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey); var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey, true); ctrl.dataset.setCurrent(beforeCurrentKey, true);
} else { } else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){ if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1]; info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else { } else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex]; info = ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.ctrl.dataset.setCurrent(info["CRDN_ID"], true); ctrl.dataset.setCurrent(info["CRDN_ID"], true);
} }
} }
@ -607,34 +604,34 @@ $(document).ready(function(){
}); });
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.alt.beforeCurrent = { alt.beforeCurrent = {
key : $P.alt.dataset.getCurrent()["CRDN_ID_LIST"], key : alt.dataset.getCurrent()["CRDN_ID_LIST"],
index : $P.alt.dataset.getCurrent()["ROW_NUM"] - 1 index : alt.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.alt).then((resp)=>{ Apply.fromDatasetControl.reload(alt).then((resp)=>{
Apply.toDataset.set($P.alt.dataset, resp); Apply.toDataset.set(alt.dataset, resp);
$P.alt.dataset.onDatasetChange(resp, {reloaded : true}); alt.dataset.onDatasetChange(resp, {reloaded : true});
if($P.alt.beforeCurrent != null){ if(alt.beforeCurrent != null){
var beforeCurrentKey = $P.alt.beforeCurrent.key; var beforeCurrentKey = alt.beforeCurrent.key;
var beforeCurrentIndex = $P.alt.beforeCurrent.index; var beforeCurrentIndex = alt.beforeCurrent.index;
$P.alt.beforeCurrent = null; alt.beforeCurrent = null;
if(!$P.alt.dataset.empty){ if(!alt.dataset.empty){
var info = $P.alt.dataset.getData(beforeCurrentKey); var info = alt.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.alt.dataset.setCurrent(beforeCurrentKey,true); alt.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.alt.dataset.length - 1)){ if(beforeCurrentIndex > (alt.dataset.length - 1)){
info = $P.alt.dataset.getDataset()[$P.alt.dataset.length - 1]; info = alt.dataset.getDataset()[alt.dataset.length - 1];
} else { } else {
info = $P.alt.dataset.getDataset()[beforeCurrentIndex]; info = alt.dataset.getDataset()[beforeCurrentIndex];
} }
$P.alt.dataset.setCurrent(info["CRDN_ID_LIST"],true); alt.dataset.setCurrent(info["CRDN_ID_LIST"],true);
} }
} }
@ -649,7 +646,7 @@ $(document).ready(function(){
$P.fnExcelDown = async() => { $P.fnExcelDown = async() => {
if($P.currentDisplay == "photoInspection"){ if($P.currentDisplay == "photoInspection"){
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -658,13 +655,13 @@ $(document).ready(function(){
$P.$findn("photoInspection_Table_0").find("thead th").not(".dummy-th").not(":eq(0)"), $P.$findn("photoInspection_Table_0").find("thead th").not(".dummy-th").not(":eq(0)"),
$($P.findn("photoInspectionRow").content).find("td").not(".dummy-td").not(":eq(0)") $($P.findn("photoInspectionRow").content).find("td").not(".dummy-td").not(":eq(0)")
); );
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} else { } else {
if($P.alt.dataset.empty){ if(alt.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -678,9 +675,9 @@ $(document).ready(function(){
$P.$findn("sameVehicleInspectionMain_Table_0").find("thead th").not(".dummy-th"), $P.$findn("sameVehicleInspectionMain_Table_0").find("thead th").not(".dummy-th"),
$($P.findn("sameVehicleInspectionMainRow").content).find("td").not(".dummy-td") $($P.findn("sameVehicleInspectionMainRow").content).find("td").not(".dummy-td")
); );
$P.alt.query.cellDefs = cellDefs; alt.query.cellDefs = cellDefs;
$P.alt.download(); alt.download();
} else if(excelTarget == "sub"){ } else if(excelTarget == "sub"){
var cellDefs = AppSupport.getCellDefs( var cellDefs = AppSupport.getCellDefs(
@ -688,9 +685,9 @@ $(document).ready(function(){
$($P.findn("sameVehicleInspectionSubRow").content).find("td").not(".dummy-td"), $($P.findn("sameVehicleInspectionSubRow").content).find("td").not(".dummy-td"),
FimsSupport.getCellDefsForPrivacyCell FimsSupport.getCellDefsForPrivacyCell
); );
$P.shift.query.cellDefs = cellDefs; shift.query.cellDefs = cellDefs;
$P.shift.download(); shift.download();
} }
} }
@ -740,7 +737,7 @@ $(document).ready(function(){
switch (renderDataType) { switch (renderDataType) {
case "photoInspection": case "photoInspection":
var initScroll = ($P.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -749,7 +746,7 @@ $(document).ready(function(){
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
var initScroll = ($P.alt.query.pageNum < 2); var initScroll = (alt.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -775,11 +772,11 @@ $(document).ready(function(){
if(dataKey != ""){ if(dataKey != ""){
$P.$findn("photoInspectionTbody").setCurrentRow(dataKey); $P.$findn("photoInspectionTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
var curDataVhrno = $P.ctrl.dataset.getData(dataKey)["VHRNO"]; var curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.ctrl.getNext(dataKey); var nextData = ctrl.getNext(dataKey);
var nextDataKey = nextData != null ? nextData.CRDN_ID : ""; var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
var nextDataVhrno = nextData != null ? nextData.VHRNO : ""; var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno); $P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
@ -790,7 +787,7 @@ $(document).ready(function(){
} }
$P.$findn("sameVehicleInspectionMainTbody").setCurrentRow(dataKey); $P.$findn("sameVehicleInspectionMainTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.alt.dataset, dataKey); Apply.toDataset.current(alt.dataset, dataKey);
$P.searchDetailInspectionDataList(dataKey); $P.searchDetailInspectionDataList(dataKey);
@ -801,7 +798,7 @@ $(document).ready(function(){
} }
$P.$findn("sameVehicleInspectionSubTbody").setCurrentRow(dataKey); $P.$findn("sameVehicleInspectionSubTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.shift.dataset, dataKey); Apply.toDataset.current(shift.dataset, dataKey);
break; break;
} }
} }
@ -885,9 +882,9 @@ $(document).ready(function(){
var info = ""; var info = "";
if ($P.currentDisplay == "photoInspection") { if ($P.currentDisplay == "photoInspection") {
info = $P.ctrl.dataset.getCurrent("item"); info = ctrl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") { } else if ($P.currentDisplay == "sameVehicleInspection") {
info = $P.shift.dataset.getCurrent("item"); info = shift.dataset.getCurrent("item");
} else { } else {
return; return;
} }
@ -945,7 +942,7 @@ $(document).ready(function(){
return; return;
} }
var info = $P.ctrl.dataset.getCurrent("item"); var info = ctrl.dataset.getCurrent("item");
if (info == undefined || info == "") { if (info == undefined || info == "") {
return; return;

@ -45,12 +45,13 @@ pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -59,16 +60,10 @@ $(document).ready(function(){
formats: {} formats: {}
}); });
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(ctrl,dataItem);
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -110,7 +105,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -138,7 +133,7 @@ $(document).ready(function(){
info.chgAmtSe = "0"; info.chgAmtSe = "0";
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -163,16 +158,18 @@ $(document).ready(function(){
} }
} }
}; };
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$P.$findn("btnSave").on("click", () => $P.fnSave() ); $P.$findn("btnSave").on("click", () => $P.fnSave() );
$P.$findn("btnRestore").on("click", () => $P.fnRestore() ); $P.$findn("btnRestore").on("click", () => $P.fnRestore() );
/************************************************************************** /**************************************************************************
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/
var crdnInfo = ${crdnInfo}; var crdnInfo = ${crdnInfo};
$P.ctrl.dataset.setData([crdnInfo]); ctrl.dataset.setData([crdnInfo]);
}); });

@ -134,9 +134,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl= $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 : {
@ -150,24 +150,21 @@ $(document).ready(function(){
BLNC : numberFormat BLNC : numberFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
}; };
/************************************************************************** /**************************************************************************
@ -184,57 +181,57 @@ $(document).ready(function(){
$P.$findn("byOutput").val("동적 검색"); $P.$findn("byOutput").val("동적 검색");
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475)); $P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY()); $P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.taskSeCd = "DPV"; data.taskSeCd = "DPV";
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"], key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1 index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){ if(ctrl.beforeCurrent != null){
let beforeCurrentKey = $P.ctrl.beforeCurrent.key; let beforeCurrentKey = ctrl.beforeCurrent.key;
let beforeCurrentIndex = $P.ctrl.beforeCurrent.index; let beforeCurrentIndex = ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey); var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true); ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){ if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1]; info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else { } else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex]; info = ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true); ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -244,16 +241,16 @@ $(document).ready(function(){
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnTheadTr").find("th").not(".dummy-th").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("crdnTheadTr").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)")); $($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -274,7 +271,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -291,7 +288,7 @@ $(document).ready(function(){
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
@ -302,7 +299,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -324,7 +321,7 @@ $(document).ready(function(){
} }
$P.save = () => { $P.save = () => {
if(!$P.ctrl.dataset.getCurrent()) { if(!ctrl.dataset.getCurrent()) {
dialog.alert({ dialog.alert({
content : "선택된 자료가 없습니다.", content : "선택된 자료가 없습니다.",
init : function(){ init : function(){
@ -340,9 +337,9 @@ $(document).ready(function(){
AppSupport.focusOK(); AppSupport.focusOK();
}, },
onOK : () => { onOK : () => {
var info = { 'crdnId' : $P.ctrl.dataset.getCurrent()["CRDN_ID"] }; var info = { 'crdnId' : ctrl.dataset.getCurrent()["CRDN_ID"] };
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);

@ -119,9 +119,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -131,27 +131,25 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
$P.ctrl.urls.newInfoByFile = ""; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.urls.newInfoByHand = ""; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/************************************************************************** ctrl.urls.newInfoByFile = "";
* Dataset.on ctrl.urls.newInfoByHand = "";
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => { ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
} }
/************************************************************************** /**************************************************************************
@ -159,14 +157,14 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$P.fnReset = () => { $P.fnReset = () => {
$P.$findn("regDt").datepicker('setDate', TODAY()); $P.$findn("regDt").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do");
$P.ctrl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do"); ctrl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do");
$P.ctrl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do"); ctrl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do");
switch(taskSeCd){ switch(taskSeCd){
case "PVS" : case "PVS" :
@ -186,21 +184,21 @@ $(document).ready(function(){
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.reload({all : true}); ctrl.reload({all : true});
} }
@ -221,7 +219,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -240,13 +238,13 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.newInfo = (type) => { $P.newInfo = (type) => {
var url = ""; var url = "";
if(type == "file") url = $P.ctrl.urls.newInfoByFile; if(type == "file") url = ctrl.urls.newInfoByFile;
if(type == "hand") url = $P.ctrl.urls.newInfoByHand; if(type == "hand") url = ctrl.urls.newInfoByHand;
let dialogName = ""; let dialogName = "";
if(type == "file") dialogName = "fileDialog"; if(type == "file") dialogName = "fileDialog";

@ -173,9 +173,9 @@ $(document).ready(function(){
$P.tempGroup = {}; $P.tempGroup = {};
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : { },
@ -187,19 +187,16 @@ $(document).ready(function(){
} }
}); });
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderParsedInfoList(obj["Total"], $P.ctrl.dataset.length, trs); $P.renderParsedInfoList(obj["Total"], ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("parsedInfoPaging"), $P.findn("parsedInfoPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("parsedInfoPaging"), $P.findn("parsedInfoPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
$P.$findn("imageArea").html(""); $P.$findn("imageArea").html("");
if(dataItem && dataItem.data){ if(dataItem && dataItem.data){
@ -297,7 +294,7 @@ $(document).ready(function(){
//서버에 등록된 파일 조회 //서버에 등록된 파일 조회
$P.searchFileList = () => { $P.searchFileList = () => {
$P.ctrl.dataset.setData([]); 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"),
@ -305,7 +302,7 @@ $(document).ready(function(){
taskSeCd : $P.$findn("taskSeCd").val() taskSeCd : $P.$findn("taskSeCd").val()
}, },
success : (resp) => { success : (resp) => {
$P.ctrl.dataset.setData(resp); ctrl.dataset.setData(resp);
} }
}); });
} }
@ -322,6 +319,7 @@ $(document).ready(function(){
replacer : replacer replacer : replacer
}; };
} }
//테이블 렌더링 //테이블 렌더링
$P.renderParsedInfoList = (total, listLength, trs) => { $P.renderParsedInfoList = (total, listLength, trs) => {
@ -369,7 +367,7 @@ $(document).ready(function(){
return; return;
} }
$P.ctrl.dataset.setCurrent(dataKey); ctrl.dataset.setCurrent(dataKey);
}; };
$P.createCrdn = () => { $P.createCrdn = () => {
@ -425,7 +423,7 @@ $(document).ready(function(){
}; };
$P.deleteFile = () => { $P.deleteFile = () => {
var current = $P.ctrl.dataset.getCurrent(); var current = ctrl.dataset.getCurrent();
if(current == null) return; if(current == null) return;
var fileName = current.FILE_NAME; var fileName = current.FILE_NAME;
@ -447,7 +445,7 @@ $(document).ready(function(){
} }
$P.removeCallback = (removedFileName) => { $P.removeCallback = (removedFileName) => {
$P.ctrl.dataset.remove(removedFileName); ctrl.dataset.remove(removedFileName);
$P.removeTableRow(removedFileName); $P.removeTableRow(removedFileName);
} }
@ -479,7 +477,7 @@ $(document).ready(function(){
$P.$findn("btnFileUpload").on("click", function(){ $P.uploadLocalFile(); }); $P.$findn("btnFileUpload").on("click", function(){ $P.uploadLocalFile(); });
$P.$findn("btnInsertCrdn").on("click", function(){ $P.$findn("btnInsertCrdn").on("click", function(){
$P.tempGroup = Object.groupBy($P.ctrl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID); $P.tempGroup = Object.groupBy(ctrl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID);
if($.isEmptyObject($P.tempGroup)){ if($.isEmptyObject($P.tempGroup)){
alert("처리할 자료가 없습니다."); alert("처리할 자료가 없습니다.");
@ -504,7 +502,7 @@ $(document).ready(function(){
} }
}); });
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
}); });
</script> </script>

@ -366,7 +366,7 @@
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
@ -376,13 +376,13 @@ $(document).ready(function(){
$P.localUploadArr = []; $P.localUploadArr = [];
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.uploadSet = uploadSupport($P.selectorn("inputUploadSet")); $P.uploadSet = uploadSupport($P.selectorn("inputUploadSet"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -393,9 +393,6 @@ $(document).ready(function(){
} }
}); });
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.uploadSet.onDatasetChange = () => { $P.uploadSet.onDatasetChange = () => {
var files = $P.uploadSet.getDataset(); var files = $P.uploadSet.getDataset();
files.forEach(item => $P.localUploadArr.push(item)); files.forEach(item => $P.localUploadArr.push(item));
@ -479,7 +476,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.ctrl.urls.create, url : 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);
@ -736,7 +733,7 @@ $(document).ready(function(){
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.ctrl.dataset.append({}); ctrl.dataset.append({});
}); });
</script> </script>

@ -279,8 +279,11 @@
</div> </div>
<div class="content-backdrop fade"></div> <div class="content-backdrop fade"></div>
<span name="ctrl"></span>
</div> </div>
<script> <script>
/************************************************************************** /**************************************************************************
@ -295,14 +298,15 @@ var FIM034 = new CommonCodes(${FIM034});
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -319,28 +323,28 @@ $(document).ready(function(){
LEVY_EXCL_YMD : dateFormat LEVY_EXCL_YMD : dateFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
/************************************************************************** ctrl.defaultFetchSize = FETCH_XS;
* Dataset.on ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
**************************************************************************/ ctrl.beforeCurrent = null;
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
} }
$P.ctrl.dataset.onSelectionChange = (selectedArr) => { ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr); Apply.fromDataset.gridCheckbox(ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnSendCrdn"), selectedArr); Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnSendCrdn"), selectedArr);
}; };
/************************************************************************** /**************************************************************************
@ -358,13 +362,13 @@ $(document).ready(function(){
$P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름 $P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365)); $P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY()); $P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
var clsForTask = taskSeCd.toLowerCase(); var clsForTask = taskSeCd.toLowerCase();
@ -396,43 +400,43 @@ $(document).ready(function(){
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.reload({all : true}); ctrl.reload({all : true});
} }
$P.fnExcelDown = (forApproval) => { $P.fnExcelDown = (forApproval) => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)")); $($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
if(forApproval){ if(forApproval){
$P.ctrl.query.includePhoto = "Y"; ctrl.query.includePhoto = "Y";
} else { } else {
$P.ctrl.query.includePhoto = "N"; ctrl.query.includePhoto = "N";
} }
$P.ctrl.download(); ctrl.download();
$P.ctrl.query.includePhoto = null; ctrl.query.includePhoto = null;
}; };
$P.checkCrdnList = (element, bool) => { $P.checkCrdnList = (element, bool) => {
@ -441,7 +445,7 @@ $(document).ready(function(){
var atLeastOne = GRID.checkbox.countChecked(element) > 0; var atLeastOne = GRID.checkbox.countChecked(element) > 0;
$P.$findn("btnSendCrdn").prop("disabled", !atLeastOne); $P.$findn("btnSendCrdn").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.ctrl.dataset, element, bool); Apply.toDataset.selection(ctrl.dataset, element, bool);
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -469,7 +473,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -486,7 +490,7 @@ $(document).ready(function(){
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -496,7 +500,7 @@ $(document).ready(function(){
}; };
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
let dialogName = "totalInfoMainDialog"; let dialogName = "totalInfoMainDialog";
@ -517,10 +521,10 @@ $(document).ready(function(){
} }
$P.fnSendCrdn = () => { $P.fnSendCrdn = () => {
var datas = $P.ctrl.dataset.getDataset("selected"); var datas = ctrl.dataset.getDataset("selected");
var taskSeCd = datas[0].TASK_SE_CD; var taskSeCd = datas[0].TASK_SE_CD;
var keys = $P.ctrl.dataset.getKeys("selected"); var keys = 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";

@ -215,51 +215,50 @@
<!-- / inner page html <div class="content-pop"> --> <!-- / inner page html <div class="content-pop"> -->
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
// pageObject // pageObject
let $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}"; $P.callPurpose = "${callPurpose}";
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.control = new DatasetControl({
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
var ctrl = $P.ctrl = new DatasetControl({
prefix: "crdn" prefix: "crdn"
, prefixName: "단속" , prefixName: "단속"
, keymapper: info => info ? info.CRDN_ID : "" , keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.crdnInfo , dataGetter: obj => obj.crdnInfo
}); });
/************************************************************************** ctrl.onCurrentChange = (item) => {
* DatasetControl 이벤트
**************************************************************************/
$P.control.onCurrentChange = (item) => {
if (!item) return; if (!item) return;
// 1. 업무별 입력 항목 // 1. 업무별 입력 항목
$P.fnRenderTask(item.data.TASK_SE_CD); $P.fnRenderTask(item.data.TASK_SE_CD);
// 2. Dataset 셋팅 // 2. Dataset 셋팅
$P.formFields.set($P.control, item); $P.formFields.set(ctrl, item);
// 3. 업무구분에 따른 URL 변경 // 3. 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD); $P.fnSetURL(item.data.TASK_SE_CD);
} }
// 저장 callback // 저장 callback
$P.control.onSave = (resp) => { ctrl.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html(); let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
@ -277,13 +276,13 @@
} }
// 저장 // 저장
$P.control.save = (info) => { ctrl.save = (info) => {
if (!info) return; if (!info) return;
ajax.post({ ajax.post({
url: $P.control.urls.update url: ctrl.urls.update
, data: info || {} , data: info || {}
, success: resp => $P.control.onSave(resp) , success: resp => ctrl.onSave(resp)
}); });
} }
@ -301,7 +300,7 @@
// 업무구분에 따른 URL 설정 // 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => { $P.fnSetURL = (taskSeCd) => {
$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/update.do"); // 수정 ctrl.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/update.do"); // 수정
} }
// 차적 조회 // 차적 조회
@ -409,17 +408,17 @@
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return; if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
// 단속 ID // 단속 ID
let crdnId = $P.control.dataset.getValue("CRDN_ID"); let crdnId = ctrl.dataset.getValue("CRDN_ID");
// 단속 ID 가 없다면.. return // 단속 ID 가 없다면.. return
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return; if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
dialog.alert({ dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" content: "현재 " + ctrl.prefixName + " 정보를 저장하시겠습니까?"
, init: function() { , init: function() {
AppSupport.setDialogZindex(); AppSupport.setDialogZindex();
AppSupport.focusOK(); AppSupport.focusOK();
}, onOK: () => { }, onOK: () => {
$P.control.save($P.formFields.get()); // formFields ctrl.save($P.formFields.get()); // formFields
} }
}); });
} }
@ -481,7 +480,7 @@
$P.initForm(); $P.initForm();
// 3. Dataset 설정 // 3. Dataset 설정
$P.control.setData([${crdnInfo}]); ctrl.setData([${crdnInfo}]);
}); });
</script> </script>

@ -57,49 +57,47 @@
<!-- / inner page html <div class="content-pop"> --> <!-- / inner page html <div class="content-pop"> -->
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
// pageObject // pageObject
let $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}"; $P.callPurpose = "${callPurpose}";
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.control = new DatasetControl({ // FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
var ctrl = $P.ctrl = new DatasetControl({
prefix: "crdnSttsCd" prefix: "crdnSttsCd"
, prefixName: "단속처리상태" , prefixName: "단속처리상태"
, keymapper: info => info ? info.CRDN_ID : "" , keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.${infoPrefix}Info , dataGetter: obj => obj.${infoPrefix}Info
}); });
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => { ctrl.onCurrentChange = (item) => {
if (!item) return; if (!item) return;
// Dataset 셋팅 // Dataset 셋팅
$P.formFields.set($P.control, item); $P.formFields.set(ctrl, item);
// 업무구분에 따른 URL 변경 // 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD); $P.fnSetURL(item.data.TASK_SE_CD);
} }
// 저장 callback // 저장 callback
$P.control.onSave = (resp) => { ctrl.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html(); let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
@ -117,13 +115,13 @@
} }
// 저장 // 저장
$P.control.save = (info) => { ctrl.save = (info) => {
if (!info) return; if (!info) return;
ajax.post({ ajax.post({
url: $P.control.urls.update url: ctrl.urls.update
, data: info || {} , data: info || {}
, success: resp => $P.control.onSave(resp) , success: resp => ctrl.onSave(resp)
}); });
} }
@ -132,7 +130,7 @@
**************************************************************************/ **************************************************************************/
// 업무구분에 따른 URL 설정 // 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => { $P.fnSetURL = (taskSeCd) => {
$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/030/update.do"); // 수정 ctrl.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/030/update.do"); // 수정
} }
/************************************************************************** /**************************************************************************
@ -144,12 +142,12 @@
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return; if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
dialog.alert({ dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" content: "현재 " + ctrl.prefixName + " 정보를 저장하시겠습니까?"
, init: function() { , init: function() {
AppSupport.focusOK(); AppSupport.focusOK();
} }
, onOK: () => { , onOK: () => {
$P.control.save($P.formFields.get()); // formFields ctrl.save($P.formFields.get()); // formFields
} }
}); });
} }
@ -178,7 +176,7 @@
$P.initForm(); $P.initForm();
// 3. Dataset 설정 // 3. Dataset 설정
$P.control.setData([${crdnSttsCdInfo}]); ctrl.setData([${crdnSttsCdInfo}]);
}); });
</script> </script>

@ -241,10 +241,10 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
var FIM071 = new CommonCodes(${FIM071}); var FIM071 = new CommonCodes(${FIM071});
var FIM002 = new CommonCodes(${FIM002}); var FIM002 = new CommonCodes(${FIM002});
@ -253,10 +253,10 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
//사용중인 팀 //사용중인 팀
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -270,39 +270,17 @@ $(document).ready(function(){
DEL_DT : datetimeFormat DEL_DT : datetimeFormat
} }
}); });
//삭제된 팀
$P.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "",
urls : { },
formats: {
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("useTeam"); var t = $P.getGridTemplate("useTeam");
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderUseTeamList(obj["Total"], $P.ctrl.dataset.length, trs); $P.renderUseTeamList(obj["Total"], ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("useTeamPaging"), $P.findn("useTeamPagingInfo"));
};
$P.alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody($P.alt.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], $P.alt.dataset.length, trs);
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("useTeamPaging"), $P.findn("useTeamPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){ if(!dataItem){
$P.$findn("teamNm").val(""); $P.$findn("teamNm").val("");
$P.$findn("crdnSeCd").val(""); $P.$findn("crdnSeCd").val("");
@ -314,7 +292,7 @@ $(document).ready(function(){
return; return;
} }
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("useTeamTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("useTeamTbody"));
$P.$findn("teamNm").val(dataItem.data.TEAM_NM); $P.$findn("teamNm").val(dataItem.data.TEAM_NM);
$P.$findn("crdnSeCd").val(dataItem.data.CRDN_SE_CD); $P.$findn("crdnSeCd").val(dataItem.data.CRDN_SE_CD);
@ -328,30 +306,48 @@ $(document).ready(function(){
} }
//삭제된 팀
var alt = $P.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "",
urls : { },
formats: {
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody(alt.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], alt.dataset.length, trs);
};
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnReset = () => { $P.fnReset = () => {
var searchForm = $P.$findn("frmSearch"); var searchForm = $P.$findn("frmSearch");
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.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
var editForm = $P.$findn("frmEdit"); var editForm = $P.$findn("frmEdit");
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.alt.dataset.setData([]); alt.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do"); ctrl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do");
$P.ctrl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do"); ctrl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do");
} }
$P.getParams = () => { $P.getParams = () => {
@ -363,16 +359,16 @@ $(document).ready(function(){
$P.searchUseTeamList = () => { $P.searchUseTeamList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.refreshUseTeamList = () => { $P.refreshUseTeamList = () => {
if($P.ctrl.query.pageNum == null){ if(ctrl.query.pageNum == null){
$P.ctrl.query.pageNum = 1; ctrl.query.pageNum = 1;
} }
$P.ctrl.load(1); ctrl.load(1);
} }
$P.getGridTemplate = (gridType) => { $P.getGridTemplate = (gridType) => {
@ -410,7 +406,7 @@ $(document).ready(function(){
} }
$P.clickUseTeamList = (dataKey) => { $P.clickUseTeamList = (dataKey) => {
$P.ctrl.dataset.setCurrent(dataKey); ctrl.dataset.setCurrent(dataKey);
} }
$P.fnSave = () => { $P.fnSave = () => {
@ -420,7 +416,7 @@ $(document).ready(function(){
data.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); data.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.save, url : ctrl.urls.save,
data : data, data : data,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -431,9 +427,9 @@ $(document).ready(function(){
} }
$P.fnRemove = () => { $P.fnRemove = () => {
var dataKey = $P.ctrl.dataset.getCurrent()["TEAM_ID"]; var dataKey = ctrl.dataset.getCurrent()["TEAM_ID"];
ajax.get({ ajax.get({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : { data : {
"teamId" : dataKey "teamId" : dataKey
}, },
@ -459,7 +455,7 @@ $(document).ready(function(){
}, },
success:(resp) => { success:(resp) => {
$P.alt.dataset.setData(resp); alt.dataset.setData(resp);
} }
}); });

@ -124,19 +124,19 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
*
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -153,23 +153,21 @@ $(document).ready(function(){
DEL_DT : datetimeFormat DEL_DT : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on ctrl.dataset.onDatasetChange = (obj, option) => {
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderExmptnVhclList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("exmptnVhclPaging"), $P.findn("exmptnVhclPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("exmptnVhclPaging"), $P.findn("exmptnVhclPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("exmptnVhclTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("exmptnVhclTbody"));
} }
/************************************************************************** /**************************************************************************
@ -180,44 +178,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.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.taskSeCd = "BPV"; data.taskSeCd = "BPV";
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchExmptnVhclList = () => { $P.searchExmptnVhclList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollExmptnVhclList = () => { $P.scrollExmptnVhclList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshExmptnVhclList = () => { $P.refreshExmptnVhclList = () => {
if($P.ctrl.query.pageNum == null){ if(ctrl.query.pageNum == null){
$P.ctrl.query.pageNum = 1; ctrl.query.pageNum = 1;
} }
$P.ctrl.reload({all : true}); ctrl.reload({all : true});
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("exmptnVhclTheadTr").find("th").not(".dummy-th").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("exmptnVhclTheadTr").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("exmptnVhclRow").content).find("td").not(".dummy-td").not(":eq(0)")); $($P.findn("exmptnVhclRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -237,7 +235,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -255,7 +253,7 @@ $(document).ready(function(){
return; return;
} }
if($P.ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){ if(ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){
$P.$findn("btnOpenDelRsn").prop("disabled", false); $P.$findn("btnOpenDelRsn").prop("disabled", false);
} else { } else {
$P.$findn("btnOpenDelRsn").prop("disabled", true); $P.$findn("btnOpenDelRsn").prop("disabled", true);
@ -264,14 +262,14 @@ $(document).ready(function(){
$P.$findn("exmptnVhclTbody").setCurrentRow(dataKey); $P.$findn("exmptnVhclTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickExmptnVhclList = (dataKey) => { $P.dblclickExmptnVhclList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
var data = $P.ctrl.dataset.getData(dataKey); var data = ctrl.dataset.getData(dataKey);
if(data.DEL_YN == "Y"){ if(data.DEL_YN == "Y"){
dialog.alert({ dialog.alert({
content : "삭제된 자료입니다.", content : "삭제된 자료입니다.",
@ -286,7 +284,7 @@ $(document).ready(function(){
$P.getInfo = (param) => { $P.getInfo = (param) => {
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data: param, data: param,
success:(resp) => { success:(resp) => {
let dialogName = "exmptnvhclDialog"; let dialogName = "exmptnvhclDialog";
@ -321,7 +319,7 @@ $(document).ready(function(){
$P.newInfo = () => { $P.newInfo = () => {
ajax.get({ ajax.get({
url : $P.ctrl.urls.newInfo, url : ctrl.urls.newInfo,
data: {}, data: {},
success:(resp) => { success:(resp) => {
let dialogName = "exmptnvhclDialog"; let dialogName = "exmptnvhclDialog";
@ -382,9 +380,9 @@ $(document).ready(function(){
} }
$P.fnRemove = (reason) => { $P.fnRemove = (reason) => {
var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"]; var dataKey = ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({ ajax.get({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : { data : {
"exmptnVhclId" : dataKey, "exmptnVhclId" : dataKey,
"delRsn" : reason "delRsn" : reason
@ -398,7 +396,7 @@ $(document).ready(function(){
}; };
$P.fnOpenHistory = () => { $P.fnOpenHistory = () => {
var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"]; var dataKey = 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"),

@ -68,10 +68,10 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"].provided = {}; pageObject["${pageName}"].provided = {};
pageObject.childReq = []; pageObject.childReq = [];
@ -90,11 +90,11 @@ $(document).ready(function(){
} }
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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.ctrl, item); $P.formFields.set(ctrl, item);
var create = isEmpty(item.EXMPTN_VHCL_ID); var create = isEmpty(item.EXMPTN_VHCL_ID);
$P.$findn("vhrno").prop("readonly", !create); $P.$findn("vhrno").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.ctrl.urls.update : $P.ctrl.urls.create, url : !create ? ctrl.urls.update : ctrl.urls.create,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);

@ -73,9 +73,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : { },
@ -89,14 +89,10 @@ $(document).ready(function(){
} }
}); });
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs); $P.renderExmptnVhclList(obj["Total"], ctrl.dataset.length, trs);
} }
/************************************************************************** /**************************************************************************
@ -124,6 +120,6 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
} }
$P.ctrl.dataset.setData(list); ctrl.dataset.setData(list);
}); });
</script> </script>

@ -223,8 +223,8 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
var FIM026 = new CommonCodes(${FIM026}); var FIM026 = new CommonCodes(${FIM026});
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
@ -241,9 +241,9 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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,21 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
if(!dataItem){ if(!dataItem){
$P.$findn("bottomCrdnPlc").val(""); $P.$findn("bottomCrdnPlc").val("");
@ -317,20 +314,20 @@ $(document).ready(function(){
searchForm.find("[name='schCvlcptRcptYmdFrom']").datepicker('setDate', DateSupport.getAddDay(-5475)); searchForm.find("[name='schCvlcptRcptYmdFrom']").datepicker('setDate', DateSupport.getAddDay(-5475));
searchForm.find("[name='schCvlcptRcptYmdTo']").datepicker('setDate', TODAY()); searchForm.find("[name='schCvlcptRcptYmdTo']").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do"); ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
@ -341,45 +338,45 @@ $(document).ready(function(){
$P.$findn("btnDelete").show(); $P.$findn("btnDelete").show();
$P.$findn("btnDeleteSameRcptYmd").show(); $P.$findn("btnDeleteSameRcptYmd").show();
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"], key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1 index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){ if(ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key; var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index; var beforeCurrentIndex = ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey); var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true); ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){ if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1]; info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else { } else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex]; info = ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true); ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -395,16 +392,16 @@ $(document).ready(function(){
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)")); $($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -424,7 +421,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -448,7 +445,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
$P.$findn("bottomCrdnPlc").val($P.ctrl.dataset.getData(dataKey)["CRDN_PLC"]); $P.$findn("bottomCrdnPlc").val(ctrl.dataset.getData(dataKey)["CRDN_PLC"]);
if($P.holdList.includes(dataKey)){ if($P.holdList.includes(dataKey)){
$P.$findn("btnOpenCvlcptOrgnl").hide(); $P.$findn("btnOpenCvlcptOrgnl").hide();
@ -460,7 +457,7 @@ $(document).ready(function(){
$P.$findn("btnDeleteSameRcptYmd").show(); $P.$findn("btnDeleteSameRcptYmd").show();
} }
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -470,7 +467,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : { data : {
"crdnId" : dataKey "crdnId" : dataKey
}, },
@ -514,7 +511,7 @@ $(document).ready(function(){
$P.fnHold = () => { $P.fnHold = () => {
var curKey = $P.ctrl.dataset.getCurrent()["CRDN_ID"]; var curKey = ctrl.dataset.getCurrent()["CRDN_ID"];
if($P.holdList.includes(curKey)){ if($P.holdList.includes(curKey)){
return; return;
} }
@ -529,7 +526,7 @@ $(document).ready(function(){
$P.fnRemove = (rcptYmd) => { $P.fnRemove = (rcptYmd) => {
if(rcptYmd != null){ if(rcptYmd != null){
var ds = $P.ctrl.dataset.getDataset(); var ds = ctrl.dataset.getDataset();
var crdnIds = []; var crdnIds = [];
@ -544,18 +541,18 @@ $(document).ready(function(){
crdnIds.push(filtered[i].CRDN_ID); crdnIds.push(filtered[i].CRDN_ID);
} }
$P.ctrl.dataset.select(crdnIds,true); ctrl.dataset.select(crdnIds,true);
} else { } else {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["CRDN_ID"]; var curKey = cur["CRDN_ID"];
$P.ctrl.dataset.select(curKey,true); ctrl.dataset.select(curKey,true);
} }
var selected = $P.ctrl.dataset.getKeys("selected"); var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -565,7 +562,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.removeCallback(resp); $P.removeCallback(resp);
@ -581,7 +578,7 @@ $(document).ready(function(){
}; };
$P.fnRemoveSameRcptYmd = () => { $P.fnRemoveSameRcptYmd = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -599,7 +596,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -643,12 +640,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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.ctrl.dataset.getDataset(); var ds = 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"])){
@ -661,7 +658,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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"])){
@ -683,7 +680,7 @@ $(document).ready(function(){
$P.refreshCrdnList(); $P.refreshCrdnList();
}, },
"hasData" : function(key){ "hasData" : function(key){
if($P.ctrl.dataset.getData(key) == null){ if(ctrl.dataset.getData(key) == null){
return false; return false;
} else { } else {
return true; return true;

@ -387,11 +387,10 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"].provided = {}; pageObject["${pageName}"].provided = {};
pageObject.childReq = []; pageObject.childReq = [];
@ -418,11 +417,11 @@ $(document).ready(function(){
} }
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -436,12 +435,8 @@ $(document).ready(function(){
} }
}); });
ctrl.dataset.onCurrentChange = (dataItem) => {
/************************************************************************** $P.formFields.set(ctrl,dataItem);
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
} }
@ -515,7 +510,7 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -586,7 +581,7 @@ $(document).ready(function(){
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.ctrl.urls.getInfo, url: ctrl.urls.getInfo,
data: { "crdnId" : crdnId }, data: { "crdnId" : crdnId },
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
@ -594,7 +589,7 @@ $(document).ready(function(){
success : (resp) => { success : (resp) => {
var crdnInfo = resp.crdnInfo; var crdnInfo = resp.crdnInfo;
crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN); crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([crdnInfo]); ctrl.dataset.setData([crdnInfo]);
$P.$findn("btnViewCrdnList").attr("hidden","hidden"); $P.$findn("btnViewCrdnList").attr("hidden","hidden");
$P.$findn("btnViewCvlcptDscsnList").attr("hidden","hidden"); $P.$findn("btnViewCvlcptDscsnList").attr("hidden","hidden");
@ -623,7 +618,7 @@ $(document).ready(function(){
if(await confirm2("현 자료의 복사본을 생성하시겠습니까?")){ if(await confirm2("현 자료의 복사본을 생성하시겠습니까?")){
ajax.get({ ajax.get({
url : $P.ctrl.urls.create, url : ctrl.urls.create,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : (resp) => { success : (resp) => {
if (resp.saved) { if (resp.saved) {
@ -837,7 +832,7 @@ $(document).ready(function(){
var crdnId = $P.$findn("crdnId").val(); var crdnId = $P.$findn("crdnId").val();
ajax.post({ ajax.post({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -1211,7 +1206,7 @@ $(document).ready(function(){
var crdnInfo = ${crdnInfo}; var crdnInfo = ${crdnInfo};
crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN); crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([crdnInfo]); ctrl.dataset.setData([crdnInfo]);
if($P.$findn("taskSeCd").val() == "DPV" && $P.$findn("vltnCd").val() == "01"){ if($P.$findn("taskSeCd").val() == "DPV" && $P.$findn("vltnCd").val() == "01"){
$P.$findn("dstrbncYn").show(); $P.$findn("dstrbncYn").show();

@ -114,11 +114,11 @@ $(document).ready(function() {
} }
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -133,8 +133,8 @@ $(document).ready(function() {
/************************************************************************** /**************************************************************************
* Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem); $P.formFields.set(ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
@ -157,7 +157,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.ctrl.urls.getInfo, url: ctrl.urls.getInfo,
data: { "crdnId" : crdnId }, data: { "crdnId" : crdnId },
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
@ -165,7 +165,7 @@ $(document).ready(function() {
success : (resp) => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]); ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($P.$findn("crdnId").val()); var cs = $P.provided.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs); $P.$findn("countStauts").val(cs);
@ -193,7 +193,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
var cvlcptInfo = ${cvlcptInfo}; var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]); ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($P.$findn("crdnId").val()); var cs = $P.provided.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs); $P.$findn("countStauts").val(cs);
}); });

@ -247,9 +247,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -263,31 +263,28 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
} }
$P.ctrl.dataset.onSelectionChange = (selectedArr) => { ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr); Apply.fromDataset.gridCheckbox(ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnExecuteAnswer"), selectedArr); Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnExecuteAnswer"), selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnAnswerComplete"), selectedArr); Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnAnswerComplete"), selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnExecuteDisabledTagInfoInquire"), selectedArr); Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnExecuteDisabledTagInfoInquire"), selectedArr);
}; };
/************************************************************************** /**************************************************************************
@ -305,7 +302,7 @@ $(document).ready(function(){
$P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-31)); $P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-31));
$P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY()); $P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = taskSeCd => { $P.fnResetAndChangeBiz = taskSeCd => {
@ -317,53 +314,53 @@ $(document).ready(function(){
$P.$findn("btnExecuteDisabledTagInfoInquire").on("click", () => $P.fnExecuteDisabledTagInfoInquire()); $P.$findn("btnExecuteDisabledTagInfoInquire").on("click", () => $P.fnExecuteDisabledTagInfoInquire());
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do"); ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.reload({all : true}); ctrl.reload({all : true});
} }
$P.fnExcelDown = (forApproval) => { $P.fnExcelDown = (forApproval) => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)")); $($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
if(forApproval){ if(forApproval){
$P.ctrl.query.includePhoto = "Y"; ctrl.query.includePhoto = "Y";
} else { } else {
$P.ctrl.query.includePhoto = "N"; ctrl.query.includePhoto = "N";
} }
$P.ctrl.download(); ctrl.download();
$P.ctrl.query.includePhoto = null; ctrl.query.includePhoto = null;
}; };
@ -384,7 +381,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -398,7 +395,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").find("tr[data-key]").each(function(item){ $P.$findn("crdnTbody").find("tr[data-key]").each(function(item){
var crdnId = this.dataset.key; var crdnId = this.dataset.key;
var data = $P.ctrl.dataset.getData(crdnId); var data = ctrl.dataset.getData(crdnId);
if(data.COPY_EXIST_YN == "Y"){ if(data.COPY_EXIST_YN == "Y"){
$(this).addClass("text-red"); $(this).addClass("text-red");
@ -418,7 +415,7 @@ $(document).ready(function(){
$P.$findn("btnAnswerComplete").prop("disabled", !atLeastOne); $P.$findn("btnAnswerComplete").prop("disabled", !atLeastOne);
$P.$findn("btnExecuteDisabledTagInfoInquire").prop("disabled", !atLeastOne); $P.$findn("btnExecuteDisabledTagInfoInquire").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.ctrl.dataset, element, bool); Apply.toDataset.selection(ctrl.dataset, element, bool);
} }
$P.clickCrdnList = (dataKey) => { $P.clickCrdnList = (dataKey) => {
@ -427,7 +424,7 @@ $(document).ready(function(){
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -437,7 +434,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
let dialogName = "totalInfoMainDialog"; let dialogName = "totalInfoMainDialog";
@ -458,7 +455,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -501,7 +498,7 @@ $(document).ready(function(){
} }
$P.fnOpenAnswerPreview = () => { $P.fnOpenAnswerPreview = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -545,7 +542,7 @@ $(document).ready(function(){
$P.fnExecuteAnswer = () => { $P.fnExecuteAnswer = () => {
var count = $P.ctrl.dataset.getKeys("selected").length; var count = ctrl.dataset.getKeys("selected").length;
dialog.alert({ dialog.alert({
content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?", content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?",
@ -560,7 +557,7 @@ $(document).ready(function(){
$P.fnAnswerComplete = () => { $P.fnAnswerComplete = () => {
var count = $P.ctrl.dataset.getKeys("selected").length; var count = ctrl.dataset.getKeys("selected").length;
dialog.alert({ dialog.alert({
content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?", content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?",
@ -577,10 +574,10 @@ $(document).ready(function(){
$P.save = (processType) => { $P.save = (processType) => {
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : { data : {
"processType" : processType, "processType" : processType,
"crdnIds" : $P.ctrl.dataset.getKeys("selected").join(",") "crdnIds" : ctrl.dataset.getKeys("selected").join(",")
}, },
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -601,7 +598,7 @@ $(document).ready(function(){
var keys = []; var keys = [];
var selected = $P.ctrl.dataset.getDataset("selected"); var selected = 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"){
@ -655,12 +652,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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.ctrl.dataset.getDataset(); var ds = 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"];
@ -669,7 +666,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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"];

@ -82,11 +82,11 @@ $(document).ready(function() {
} }
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit")); $P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -99,18 +99,13 @@ $(document).ready(function() {
} }
}); });
ctrl.dataset.onCurrentChange = (dataItem) => {
/************************************************************************** $P.formFields.set(ctrl,dataItem);
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
} }
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnPrev = () => { $P.fnPrev = () => {
var prevKey = $P.parentRes.getPrevKey($P.$findn("crdnId").val()); var prevKey = $P.parentRes.getPrevKey($P.$findn("crdnId").val());
if(prevKey != ""){ if(prevKey != ""){
@ -127,7 +122,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => { $P.fnGo = (crdnId) => {
ajax.get({ ajax.get({
url: $P.ctrl.urls.getInfo, url: 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 +130,7 @@ $(document).ready(function() {
success : (resp) => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]); ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val()); var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs); $P.$findn("countStauts").val(cs);
@ -156,7 +151,7 @@ $(document).ready(function() {
} }
ajax.post({ ajax.post({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
$P.saveCallback(resp); $P.saveCallback(resp);
@ -191,7 +186,7 @@ $(document).ready(function() {
**************************************************************************/ **************************************************************************/
var cvlcptInfo = ${cvlcptInfo}; var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]); ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val()); var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs); $P.$findn("countStauts").val(cs);

@ -219,8 +219,8 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
var FIM022 = new CommonCodes(${FIM022}); var FIM022 = new CommonCodes(${FIM022});
var FIM026 = new CommonCodes(${FIM026}); var FIM026 = new CommonCodes(${FIM026});
@ -237,9 +237,9 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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,21 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
} }
@ -290,64 +286,64 @@ $(document).ready(function(){
$P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365)); $P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365));
$P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY()); $P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do"); ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollCrdnList = () => { $P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"], key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1 index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){ if(ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key; var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index; var beforeCurrentIndex = ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey); var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true); ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){ if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1]; info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else { } else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex]; info = ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true); ctrl.dataset.setCurrent(info["CRDN_ID"],true);
} }
} }
} }
@ -356,16 +352,16 @@ $(document).ready(function(){
} }
$P.fnExcelDown = () => { $P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){ if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"), var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)")); $($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} }
$P.getGridTemplate = () => { $P.getGridTemplate = () => {
@ -386,7 +382,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -405,7 +401,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -415,7 +411,7 @@ $(document).ready(function(){
} }
ajax.get({ ajax.get({
url : $P.ctrl.urls.getInfo, url : ctrl.urls.getInfo,
data : params, data : params,
success : (resp) => { success : (resp) => {
@ -437,15 +433,15 @@ $(document).ready(function(){
$P.fnRemove = () => { $P.fnRemove = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["CRDN_ID"]; var curKey = cur["CRDN_ID"];
$P.ctrl.dataset.select(curKey,true); ctrl.dataset.select(curKey,true);
var selected = $P.ctrl.dataset.getKeys("selected"); var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -455,7 +451,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.saveCallback(selected, resp); $P.saveCallback(selected, resp);
@ -471,7 +467,7 @@ $(document).ready(function(){
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
@ -515,12 +511,12 @@ $(document).ready(function(){
$P.provide = { $P.provide = {
"getCountStatus" : function(currentKey){ "getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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.ctrl.dataset.getDataset(); var ds = 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"];
@ -529,7 +525,7 @@ $(document).ready(function(){
} }
}, },
"getPrevKey" : function(currentKey){ "getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset(); var ds = 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"];
@ -544,7 +540,7 @@ $(document).ready(function(){
$P.refreshCrdnList(); $P.refreshCrdnList();
}, },
"hasData" : function(key){ "hasData" : function(key){
if($P.ctrl.dataset.getData(key) == null){ if(ctrl.dataset.getData(key) == null){
return false; return false;
} else { } else {
return true; return true;

@ -159,10 +159,10 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
var FIM063 = new CommonCodes(${FIM063}); var FIM063 = new CommonCodes(${FIM063});
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
@ -175,9 +175,9 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {
@ -191,23 +191,20 @@ $(document).ready(function(){
RSPNS_DT : datetimeFormat RSPNS_DT : datetimeFormat
} }
}); });
$P.ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
/************************************************************************** ctrl.dataset.onDatasetChange = (obj, option) => {
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer); var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderDmndList(obj["Total"], $P.ctrl.dataset.length, trs, option); $P.renderDmndList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("dmndPaging"), $P.findn("dmndPagingInfo")); Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("dmndPaging"), $P.findn("dmndPagingInfo"));
}; };
$P.ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("dmndTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("dmndTbody"));
} }
/************************************************************************** /**************************************************************************
@ -217,65 +214,65 @@ $(document).ready(function(){
$P.$findn("schDmndYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475)); $P.$findn("schDmndYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475));
$P.$findn("schDmndYmdTo").datepicker('setDate', TODAY()); $P.$findn("schDmndYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
} }
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
$P.ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do"); ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do"); ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
} }
$P.getParams = () => { $P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch")); var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get(); var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize; data.fetchSize = ctrl.defaultFetchSize;
return data; return data;
} }
$P.searchDmndList = () => { $P.searchDmndList = () => {
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
$P.ctrl.load(1); ctrl.load(1);
} }
$P.scrollDmndList = () => { $P.scrollDmndList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1); ctrl.load(ctrl.query.pageNum + 1);
} }
$P.refreshDmndList = () => { $P.refreshDmndList = () => {
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
$P.ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["INDIV_ID"], key : ctrl.dataset.getCurrent()["INDIV_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1 index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
} }
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){ if(ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key; var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index; var beforeCurrentIndex = ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey); var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){ if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true); ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){ if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1]; info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else { } else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex]; info = ctrl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.ctrl.dataset.setCurrent(info["INDIV_ID"],true); ctrl.dataset.setCurrent(info["INDIV_ID"],true);
} }
} }
} }
@ -299,7 +296,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.ctrl.query.pageNum < 2); var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
@ -313,24 +310,24 @@ $(document).ready(function(){
} }
$P.$findn("dmndTbody").setCurrentRow(dataKey); $P.$findn("dmndTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataKey);
} }
$P.fnRemove = (allCompleteDataIds) => { $P.fnRemove = (allCompleteDataIds) => {
if(allCompleteDataIds != null){ if(allCompleteDataIds != null){
$P.ctrl.dataset.select(allCompleteDataIds,true); ctrl.dataset.select(allCompleteDataIds,true);
} else { } else {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var curKey = cur["INDIV_ID"]; var curKey = cur["INDIV_ID"];
$P.ctrl.dataset.select(curKey,true); ctrl.dataset.select(curKey,true);
} }
var selected = $P.ctrl.dataset.getKeys("selected"); var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) { if (selected.length < 1) {
return; return;
} }
@ -340,7 +337,7 @@ $(document).ready(function(){
}; };
ajax.post({ ajax.post({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : params, data : params,
success : (resp) => { success : (resp) => {
$P.removeCallback(selected, resp); $P.removeCallback(selected, resp);
@ -358,12 +355,12 @@ $(document).ready(function(){
} }
$P.fnRemoveAllCompleteData = () => { $P.fnRemoveAllCompleteData = () => {
var cur = $P.ctrl.dataset.getCurrent(); var cur = ctrl.dataset.getCurrent();
if(cur == null){ if(cur == null){
return; return;
} }
var ds = $P.ctrl.dataset.getDataset(); var ds = 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'){
@ -427,7 +424,7 @@ $(document).ready(function(){
info.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); info.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.create, url : ctrl.urls.create,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -436,7 +433,7 @@ $(document).ready(function(){
$P.$findn("toastText").html("등록 되었습니다."); $P.$findn("toastText").html("등록 되었습니다.");
$P.toast.show(); $P.toast.show();
if(!$P.ctrl.dataset.empty){ if(!ctrl.dataset.empty){
AppSupport.sleep(1000).then(() => $P.refreshDmndList()); AppSupport.sleep(1000).then(() => $P.refreshDmndList());
} }
} }

@ -299,9 +299,9 @@
<script> <script>
LoadScript("cvlc05010Script","/resources/js/fims/cvlc/cvlc05010.js?ver=${ver}"); LoadScript("cvlc05010Script","/resources/js/fims/cvlc/cvlc05010.js?ver=${ver}");
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
@ -314,27 +314,27 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = newCvlc05010Control(); var ctrl = $P.ctrl = newCvlc05010Control();
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls = {}; ctrl.urls = {};
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do"); ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do"); ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do");
$P.fnReset(); $P.fnReset();
} }
$P.fnReset = () => { $P.fnReset = () => {
$P.$findn("btnAnsBasicTab").trigger("click"); $P.$findn("btnAnsBasicTab").trigger("click");
$P.ctrl.levy.setData([]); ctrl.levy.setData([]);
$P.ctrl.warning.setData([]); ctrl.warning.setData([]);
$P.ctrl.nonlevy.setData([]); ctrl.nonlevy.setData([]);
$P.renderAnsBodyList(0,'levy'); $P.renderAnsBodyList(0,'levy');
$P.renderAnsBodyList(0,'warning'); $P.renderAnsBodyList(0,'warning');
@ -356,31 +356,31 @@ $(document).ready(function(){
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.load, url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.$findn("headerCn").val(resp.headerCn); $P.$findn("headerCn").val(resp.headerCn);
$P.$findn("footerCn").val(resp.footerCn); $P.$findn("footerCn").val(resp.footerCn);
$P.ctrl.levy.setData(resp.levyCaseList); ctrl.levy.setData(resp.levyCaseList);
$P.ctrl.warning.setData(resp.warningCaseList); ctrl.warning.setData(resp.warningCaseList);
$P.ctrl.nonlevy.setData(resp.nonlevyCaseList); ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy'); $P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning'); $P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy'); $P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){ if(resp.levyCaseList.length > 0){
var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"]; var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy'); $P.clickAnsBodyList(current,'levy');
} }
if(resp.warningCaseList.length > 0){ if(resp.warningCaseList.length > 0){
var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning'); $P.clickAnsBodyList(current,'warning');
} }
if(resp.nonlevyCaseList.length > 0){ if(resp.nonlevyCaseList.length > 0){
var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy'); $P.clickAnsBodyList(current,'nonlevy');
} }
} }
@ -408,7 +408,7 @@ $(document).ready(function(){
return; return;
} }
var ansBodyDS = $P.ctrl[renderDataType].dataset; var ansBodyDS = ctrl[renderDataType].dataset;
var empty = ansBodyDS.empty; var empty = ansBodyDS.empty;
var notFound = [$P.findn(notFoundName).innerHTML]; var notFound = [$P.findn(notFoundName).innerHTML];
var found = $P.findn(foundName).innerHTML; var found = $P.findn(foundName).innerHTML;
@ -434,7 +434,7 @@ $(document).ready(function(){
$P.radioClickAnsBodyList = (dataKey, gridType) => { $P.radioClickAnsBodyList = (dataKey, gridType) => {
$P.ctrl[gridType].setCurrent(dataKey); ctrl[gridType].setCurrent(dataKey);
var tbodyName = ""; var tbodyName = "";
if(gridType == "levy"){ if(gridType == "levy"){
@ -488,11 +488,11 @@ $(document).ready(function(){
var dstrbncYn = ""; var dstrbncYn = "";
if($P.currentDisplay == "levyAnsBody"){ if($P.currentDisplay == "levyAnsBody"){
curData = $P.ctrl.levy.getCurrent(); curData = ctrl.levy.getCurrent();
} else if($P.currentDisplay == "warningAnsBody"){ } else if($P.currentDisplay == "warningAnsBody"){
curData = $P.ctrl.warning.getCurrent(); curData = ctrl.warning.getCurrent();
} else if($P.currentDisplay == "nonlevyAnsBody"){ } else if($P.currentDisplay == "nonlevyAnsBody"){
curData = $P.ctrl.nonlevy.getCurrent(); curData = ctrl.nonlevy.getCurrent();
} }
if(curData == null){ if(curData == null){
@ -530,41 +530,41 @@ $(document).ready(function(){
} }
$P.refreshAnsWordsInfo = () => { $P.refreshAnsWordsInfo = () => {
var cursor1 = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"]; var cursor1 = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var cursor2 = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor2 = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor3 = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor3 = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.load, url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.$findn("headerCn").val(resp.headerCn); $P.$findn("headerCn").val(resp.headerCn);
$P.$findn("footerCn").val(resp.footerCn); $P.$findn("footerCn").val(resp.footerCn);
$P.ctrl.levy.setData(resp.levyCaseList); ctrl.levy.setData(resp.levyCaseList);
$P.ctrl.warning.setData(resp.warningCaseList); ctrl.warning.setData(resp.warningCaseList);
$P.ctrl.nonlevy.setData(resp.nonlevyCaseList); ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy'); $P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning'); $P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy'); $P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){ if(resp.levyCaseList.length > 0){
$P.ctrl.levy.setCurrent(cursor1); ctrl.levy.setCurrent(cursor1);
var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"]; var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy'); $P.clickAnsBodyList(current,'levy');
} }
if(resp.warningCaseList.length > 0){ if(resp.warningCaseList.length > 0){
$P.ctrl.warning.setCurrent(cursor2); ctrl.warning.setCurrent(cursor2);
var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning'); $P.clickAnsBodyList(current,'warning');
} }
if(resp.nonlevyCaseList.length > 0){ if(resp.nonlevyCaseList.length > 0){
$P.ctrl.nonlevy.setCurrent(cursor3); ctrl.nonlevy.setCurrent(cursor3);
var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy'); $P.clickAnsBodyList(current,'nonlevy');
} }
} }
@ -603,7 +603,7 @@ $(document).ready(function(){
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -629,7 +629,7 @@ $(document).ready(function(){
}, },
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.ctrl.urls.remove, url : ctrl.urls.remove,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -773,6 +773,7 @@ $(document).ready(function(){
if(macroTarget == ""){ return; } if(macroTarget == ""){ return; }
fnMacroStringInsert(macroTarget, MACRO_STRING.MACRO_PIC_NM); fnMacroStringInsert(macroTarget, MACRO_STRING.MACRO_PIC_NM);
}); });
/************************************************************************** /**************************************************************************
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/

@ -119,8 +119,8 @@
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}"); pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){ $(document).ready(function(){
@ -134,9 +134,9 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = new DatasetControl({ var ctrl = $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 : {},
@ -147,16 +147,16 @@ $(document).ready(function(){
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls = {}; ctrl.urls = {};
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do"); ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do"); ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do");
$P.fnReset(); $P.fnReset();
} }
$P.fnReset = () => { $P.fnReset = () => {
$P.ctrl.dataset.setData([]); ctrl.dataset.setData([]);
$P.renderWarningWordsList(0); $P.renderWarningWordsList(0);
$P.$findn("frmEditWarningWords").find("input, textarea").val(""); $P.$findn("frmEditWarningWords").find("input, textarea").val("");
@ -173,16 +173,16 @@ $(document).ready(function(){
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.load, url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.ctrl.dataset.setData(resp.List); 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.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current); $P.clickWarningWordsList(current);
} }
} }
@ -191,7 +191,7 @@ $(document).ready(function(){
$P.renderWarningWordsList = (total) => { $P.renderWarningWordsList = (total) => {
var warningWordsDS = $P.ctrl.dataset; var warningWordsDS = ctrl.dataset;
var empty = warningWordsDS.empty; var empty = warningWordsDS.empty;
var notFound = [$P.findn("warningWordsNotFound").innerHTML]; var notFound = [$P.findn("warningWordsNotFound").innerHTML];
var found = $P.findn("warningWordsRow").innerHTML; var found = $P.findn("warningWordsRow").innerHTML;
@ -206,7 +206,7 @@ $(document).ready(function(){
$P.radioClickWarningWordsList = (dataKey, gridType) => { $P.radioClickWarningWordsList = (dataKey, gridType) => {
$P.ctrl.dataset.setCurrent(dataKey); ctrl.dataset.setCurrent(dataKey);
$P.$findn("warningWordsTbody").setCurrentRow(dataKey); $P.$findn("warningWordsTbody").setCurrentRow(dataKey);
@ -224,7 +224,7 @@ $(document).ready(function(){
$P.changeTextarea = () => { $P.changeTextarea = () => {
var curData = $P.ctrl.dataset.getCurrent(); var curData = ctrl.dataset.getCurrent();
if(curData == null){ if(curData == null){
$P.$findn("ansRsnCd").val(""); $P.$findn("ansRsnCd").val("");
@ -242,20 +242,20 @@ $(document).ready(function(){
$P.refreshWarningWordsInfo = () => { $P.refreshWarningWordsInfo = () => {
var cursor = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ctrl.urls.load, url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$P.ctrl.dataset.setData(resp.List); 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.ctrl.dataset.setCurrent(cursor); ctrl.dataset.setCurrent(cursor);
var current = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current,'warning'); $P.clickWarningWordsList(current,'warning');
} }
@ -280,7 +280,7 @@ $(document).ready(function(){
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.ctrl.urls.update, url : ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){

@ -47,41 +47,37 @@ $(document).ready(function() {
$P.integrationSearch = {}; $P.integrationSearch = {};
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl, DatasetSupport, FormFields
**************************************************************************/ **************************************************************************/
$P.ctrl = newSprt01010Control(); var ctrl = $P.ctrl = newSprt01010Control();
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.ctrl.upDataset.onDatasetChange = (obj, option) => { ctrl.upDataset.onDatasetChange = (obj, option) => {
var upActiveTab = $P.$findn("upGridTabs").find("button.active").text().trim(); var upActiveTab = $P.$findn("upGridTabs").find("button.active").text().trim();
$P.renderList("up", upActiveTab); $P.renderList("up", upActiveTab);
}; };
$P.ctrl.downDataset.onDatasetChange = (obj, option) => { ctrl.downDataset.onDatasetChange = (obj, option) => {
var downActiveTab = $P.$findn("downGridTabs").find("button.active").text().trim(); var downActiveTab = $P.$findn("downGridTabs").find("button.active").text().trim();
$P.renderList("down", downActiveTab); $P.renderList("down", downActiveTab);
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.ctrl.upDataset.onCurrentChange = (DI) => { ctrl.upDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$P.$findn("upTbody").setCurrentRow(key); $P.$findn("upTbody").setCurrentRow(key);
}; };
$P.ctrl.downDataset.onCurrentChange = (DI) => { ctrl.downDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$P.$findn("downTbody").setCurrentRow(key); $P.$findn("downTbody").setCurrentRow(key);
}; };
// 선택(체크) 변경 이벤트 // 선택(체크) 변경 이벤트
$P.ctrl.upDataset.onSelectionChange = (selectedArr) => { ctrl.upDataset.onSelectionChange = (selectedArr) => {
var DS = $P.ctrl.upDataset; var DS = ctrl.upDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$P.$findn("upTbody").find("input[type='checkbox']").each(function() { $P.$findn("upTbody").find("input[type='checkbox']").each(function() {
@ -100,8 +96,8 @@ $(document).ready(function() {
}; };
$P.ctrl.downDataset.onSelectionChange = (selectedArr) => { ctrl.downDataset.onSelectionChange = (selectedArr) => {
var DS = $P.ctrl.downDataset; var DS = ctrl.downDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$P.$findn("downTbody").find("input[type='checkbox']").each(function() { $P.$findn("downTbody").find("input[type='checkbox']").each(function() {
@ -119,22 +115,25 @@ $(document).ready(function() {
} }
}; };
//그리드 체크박스 //그리드 체크박스
$P.selectCheckbox = (obj, arg1, arg2) => { $P.selectCheckbox = (obj, arg1, arg2) => {
let table = $(obj).parent().parent().parent().parent(); let table = $(obj).parent().parent().parent().parent();
let id = table[0].id; let id = table.attr("name");
if(id.startsWith("up")){ if(id.startsWith("up")){
if(arg2 != null){ if(arg2 != null){
pageObject['${pageName}'].ctrl.upDataset.select(arg1, arg2); ctrl.upDataset.select(arg1, arg2);
} else { } else {
pageObject['${pageName}'].ctrl.upDataset.select(arg1); ctrl.upDataset.select(arg1);
} }
} else if(id.startsWith("down")){ } else if(id.startsWith("down")){
if(arg2 != null){ if(arg2 != null){
pageObject['${pageName}'].ctrl.downDataset.select(arg1, arg2); ctrl.downDataset.select(arg1, arg2);
} else { } else {
pageObject['${pageName}'].ctrl.downDataset.select(arg1); ctrl.downDataset.select(arg1);
} }
} }
} }
@ -176,8 +175,8 @@ $(document).ready(function() {
} }
$P.fnReset = () => { $P.fnReset = () => {
$P.ctrl.upDataset.clear(); ctrl.upDataset.clear();
$P.ctrl.downDataset.clear(); ctrl.downDataset.clear();
} }
// 검색 조건 파라미터 가져오기 // 검색 조건 파라미터 가져오기
@ -192,9 +191,9 @@ $(document).ready(function() {
$P.fnSearchList = () => { $P.fnSearchList = () => {
// 검색조건 // 검색조건
$P.ctrl.query = $P.getParams(); ctrl.query = $P.getParams();
var query = $P.ctrl.query; var query = ctrl.query;
var minKeyword = false; var minKeyword = false;
var keys = Object.keys(query); var keys = Object.keys(query);
for(var i=0; i < keys.length; i++){ for(var i=0; i < keys.length; i++){
@ -228,10 +227,10 @@ $(document).ready(function() {
$P.$findn("upGridTabs").find("button").eq(0).addClass("active"); $P.$findn("upGridTabs").find("button").eq(0).addClass("active");
$P.$findn("downGridTabs").find("button").not(":eq(0)").removeClass("active"); $P.$findn("downGridTabs").find("button").not(":eq(0)").removeClass("active");
$P.$findn("downGridTabs").find("button").eq(0).addClass("active"); $P.$findn("downGridTabs").find("button").eq(0).addClass("active");
$P.ctrl.upDataset.clear(); ctrl.upDataset.clear();
$P.ctrl.downDataset.clear(); ctrl.downDataset.clear();
$P.ctrl.load(); ctrl.load();
} }
@ -241,7 +240,7 @@ $(document).ready(function() {
var cellDefs; var cellDefs;
if(updown == "up"){ if(updown == "up"){
if($P.ctrl.upDataset.empty){ if(ctrl.upDataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -252,9 +251,9 @@ $(document).ready(function() {
FimsSupport.getCellDefsForPrivacyCell FimsSupport.getCellDefsForPrivacyCell
); );
$P.ctrl.query.gridType = "up"; ctrl.query.gridType = "up";
} else { } else {
if($P.ctrl.downDataset.empty){ if(ctrl.downDataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -265,12 +264,12 @@ $(document).ready(function() {
FimsSupport.getCellDefsForPrivacyCell FimsSupport.getCellDefsForPrivacyCell
); );
$P.ctrl.query.gridType = "down"; ctrl.query.gridType = "down";
} }
$P.ctrl.query.cellDefs = cellDefs; ctrl.query.cellDefs = cellDefs;
$P.ctrl.download(); ctrl.download();
} }
@ -283,9 +282,9 @@ $(document).ready(function() {
var DS; var DS;
if(updown == "up"){ if(updown == "up"){
DS = $P.ctrl.upDataset; DS = ctrl.upDataset;
} else { } else {
DS = $P.ctrl.downDataset; DS = ctrl.downDataset;
} }
var replacer; var replacer;
@ -371,9 +370,9 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.ctrl.upDataset.getCurrent(); cur = ctrl.upDataset.getCurrent();
} else { } else {
cur = $P.ctrl.downDataset.getCurrent(); cur = ctrl.downDataset.getCurrent();
} }
if(cur != null){ if(cur != null){
@ -390,9 +389,9 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.ctrl.upDataset.getCurrent(); cur = ctrl.upDataset.getCurrent();
} else { } else {
cur = $P.ctrl.downDataset.getCurrent(); cur = ctrl.downDataset.getCurrent();
} }
if(cur.length <= 0){ if(cur.length <= 0){
@ -407,10 +406,10 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.ctrl.upDataset; cur = ctrl.upDataset;
} else { } else {
cur = $P.ctrl.downDataset; cur = ctrl.downDataset;
} }
@ -456,8 +455,8 @@ $(document).ready(function() {
//단속내역서,단속확인서 //단속내역서,단속확인서
$P.fnPrintCrdn = () => { $P.fnPrintCrdn = () => {
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
var downDataset = $P.ctrl.downDataset; var downDataset = ctrl.downDataset;
if((upDataset.length <= 0) && (downDataset.length <= 0)){ if((upDataset.length <= 0) && (downDataset.length <= 0)){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -504,7 +503,7 @@ $(document).ready(function() {
//교부청구서,채권신고서 //교부청구서,채권신고서
$P.fnPrintBill = () => { $P.fnPrintBill = () => {
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -562,7 +561,7 @@ $(document).ready(function() {
//납부확인서 //납부확인서
$P.fnPrintRcvmtConfirm = () => { $P.fnPrintRcvmtConfirm = () => {
var downDataset = $P.ctrl.downDataset; var downDataset = ctrl.downDataset;
if(downDataset.length <= 0){ if(downDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -584,7 +583,7 @@ $(document).ready(function() {
//사전통지서 //사전통지서
$P.fnPrintAdvntce = () => { $P.fnPrintAdvntce = () => {
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -642,7 +641,7 @@ $(document).ready(function() {
//고지서 //고지서
$P.fnPrintNht = () => { $P.fnPrintNht = () => {
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -703,20 +702,20 @@ $(document).ready(function() {
return; return;
} }
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
var downDataset = $P.ctrl.downDataset; var downDataset = ctrl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); var info = upDataset.getData(crdnId);
if(info != null){ if(info != null){
$P.ctrl.flag = "up"; ctrl.flag = "up";
} }
} }
if(downDataset.length > 0){ if(downDataset.length > 0){
var info = downDataset.getData(crdnId); var info = downDataset.getData(crdnId);
if(info != null){ if(info != null){
$P.ctrl.flag = "down"; ctrl.flag = "down";
} }
} }
@ -755,8 +754,8 @@ $(document).ready(function() {
$P.provide = { $P.provide = {
"getInfo" : function(crdnId){ "getInfo" : function(crdnId){
var upDataset = $P.ctrl.upDataset; var upDataset = ctrl.upDataset;
var downDataset = $P.ctrl.downDataset; var downDataset = ctrl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); var info = upDataset.getData(crdnId);
@ -776,8 +775,8 @@ $(document).ready(function() {
}, },
"isAllSameTask" : function(crdnIdArr){ "isAllSameTask" : function(crdnIdArr){
var upArr = $P.ctrl.upDataset.getDataset(); var upArr = ctrl.upDataset.getDataset();
var downArr = $P.ctrl.downDataset.getDataset(); var downArr = ctrl.downDataset.getDataset();
var unionArr = [...upArr, ...downArr]; var unionArr = [...upArr, ...downArr];
var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID)); var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID));

Loading…
Cancel
Save