diff --git a/src/main/webapp/WEB-INF/jsp/fims/admin-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/admin-main.jsp
index ef70f3f6..0714c489 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/admin-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/admin-main.jsp
@@ -77,7 +77,7 @@ function executeBatch(batch){
ajax.get({
url : wctx.url("/admin/executeBatch.do"),
data : { batch : batch},
- success : resp => {
+ success : (resp) => {
dialog.alert("실행되었습니다.");
}
});
@@ -100,7 +100,7 @@ function exceuteAlert(alertName){
alertName : alertName,
interfaceKey : interfaceKey
},
- success : resp => {
+ success : (resp) => {
dialog.alert("실행되었습니다.");
}
});
@@ -131,7 +131,7 @@ function customContextMenu(node){
data : {
directories : pathArray
},
- success : resp => {
+ success : (resp) => {
if(resp.saved){
getFileTree();
} else {
@@ -166,7 +166,7 @@ function customContextMenu(node){
data : {
directories : pathArray
},
- success : resp => {
+ success : (resp) => {
$("#viewCn").val(resp.fileCn);
}
});
@@ -220,7 +220,7 @@ function getFileTree(){
url : wctx.url("/admin/getFileTree.do"),
data : {},
headers: { Accept: "application/json; charset=utf-8" },
- success : resp => {
+ success : (resp) => {
$('#fileTree').jstree(true).settings.core.data = resp.tree;
$('#fileTree').jstree(true).refresh();
@@ -246,7 +246,7 @@ function fnImportFile(obj){
data : form,
processData : false,
contentType : false,
- success : resp => {
+ success : (resp) => {
if(resp.saved){
getFileTree();
} else {
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
index 01c1ee59..04eaef64 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02010-main.jsp
@@ -406,17 +406,23 @@ $(document).ready(function(){
$P.photoInspectionControl.defaultFetchSize = FETCH_XS;
$P.photoInspectionControl.untilPageNum = 0;
$P.photoInspectionControl.beforeCurrent = null;
- $P.photoInspectionControl.tableRenderComplete = false;
//동일차량검사 datasetControl 인스턴스
- $P.sameVehicleControl = new InspectionControl({
+ $P.sameVehicleMainControl = new DatasetControl({
urls : { load : "", getInfo : "" },
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID_LIST : "",
- formats: { CRDN_CNT : numberFormat, FFNLG_CRDN_AMT : numberFormat }
- },
- {
+ formats: {
+ CRDN_CNT : numberFormat,
+ FFNLG_CRDN_AMT : numberFormat
+ }
+ });
+ $P.sameVehicleMainControl.defaultFetchSize = FETCH_XS;
+ $P.sameVehicleMainControl.untilPageNum = 0;
+ $P.sameVehicleMainControl.beforeCurrent = null;
+
+ $P.sameVehicleSubControl = new DatasetControl({
urls : { load : "", getInfo : "" },
dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "",
@@ -426,14 +432,8 @@ $(document).ready(function(){
CRDN_STTS_CD : FIM010,
FFNLG_CRDN_AMT : numberFormat
}
- }
- );
- $P.sameVehicleControl.defaultFetchSize = FETCH_XS;
- $P.sameVehicleControl.untilPageNum = 0;
- $P.sameVehicleControl.main.beforeCurrent = null;
- $P.sameVehicleControl.main.tableRenderComplete = false;
- $P.sameVehicleControl.sub.tableRenderComplete = false;
-
+ });
+
$P.photoInspectionControl.getNext = (key) => {
var ds = $P.photoInspectionControl.dataset.getDataset();
@@ -446,126 +446,61 @@ $(document).ready(function(){
}
}
/**************************************************************************
- * DatasetControl.on
+ * Dataset.on
**************************************************************************/
- $P.photoInspectionControl.onDatasetChange = (obj) => {
-
- $P.renderInspectionDataList(obj["Total"], "photoInspection");
+ $P.photoInspectionControl.dataset.onDatasetChange = (obj) => {
- $("#photoInspectionPaging--${pageName}").setPagingInfo({
- list : $P.photoInspectionControl.dataset,
- prefix : "photoInspectionPaging--${pageName}",
- totalSize : obj["Total"]
- });
-
- $P.photoInspectionControl.tableRenderComplete = true;
+ var t = $P.getGridTemplate("photoInspection");
+ var trs = Apply.fromDataset.getTbody($P.photoInspectionControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderInspectionDataList(obj["Total"], $P.photoInspectionControl.dataset.length, trs, "photoInspection");
+
+ Apply.fromDataset.paging($P.photoInspectionControl.dataset, obj, "photoInspectionPaging--${pageName}");
};
- $P.photoInspectionControl.onCurrentChange = (DI) => {
-
- if(!$P.photoInspectionControl.tableRenderComplete){
- return;
- }
-
- if($P.photoInspectionControl.beforeCurrent != null){
- var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
- var beforeCurrentIndex = $P.photoInspectionControl.beforeCurrent.index;
- $P.photoInspectionControl.beforeCurrent = null;
-
- if(!$P.photoInspectionControl.dataset.empty){
- var info = $P.photoInspectionControl.dataset.getData(beforeCurrentKey);
-
- if(info != null){
- $P.photoInspectionControl.dataset.setCurrent(beforeCurrentKey, true);
- return;
- }
-
- if(beforeCurrentIndex > ($P.photoInspectionControl.dataset.length - 1)){
- info = $P.photoInspectionControl.dataset.getDataset()[$P.photoInspectionControl.dataset.length - 1];
- } else {
- info = $P.photoInspectionControl.dataset.getDataset()[beforeCurrentIndex];
- }
-
- $P.photoInspectionControl.dataset.setCurrent(info["CRDN_ID"], true);
- return;
- }
- }
-
- $P.photoInspectionControl.tableRenderComplete = false;
- if(!DI){
- $P.clickInspectionDataList("","photoInspection", true);
- } else {
- $P.clickInspectionDataList($P.photoInspectionControl.getCurrent()["CRDN_ID"],"photoInspection", true);
+ $P.photoInspectionControl.dataset.onCurrentChange = (dataItem) => {
+ Apply.fromDataset.currentRow($P.photoInspectionControl.dataset, dataItem, $("#photoInspectionTbody--${pageName}")[0]);
+
+ var dataKey = "";
+ var curDataVhrno = "";
+ var nextDataKey = "";
+ var nextDataVhrno = "";
+ if(!$P.photoInspectionControl.dataset.empty){
+ dataKey = $P.photoInspectionControl.dataset.getKey(dataItem);
+ curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
+ var nextData = $P.photoInspectionControl.getNext(dataKey);
+ nextDataKey = nextData != null ? nextData.CRDN_ID : "";
+ nextDataVhrno = nextData != null ? nextData.VHRNO : "";
}
+
+ $P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
}
- $P.sameVehicleControl.main.onDatasetChange = (obj) => {
+ $P.sameVehicleMainControl.dataset.onDatasetChange = (obj) => {
- $P.renderInspectionDataList(obj["Total"], "sameVehicleInspectionMain");
-
- $("#sameVehicleInspectionMainPaging--${pageName}").setPagingInfo({
- list : $P.sameVehicleControl.main.dataset,
- prefix : "sameVehicleInspectionMainPaging--${pageName}",
- totalSize : obj["Total"]
- });
-
-
- $P.sameVehicleControl.main.tableRenderComplete = true;
+ var t = $P.getGridTemplate("sameVehicleInspectionMain");
+ var trs = Apply.fromDataset.getTbody($P.sameVehicleMainControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderInspectionDataList(obj["Total"], $P.sameVehicleMainControl.dataset.length, trs, "sameVehicleInspectionMain");
+
+ Apply.fromDataset.paging($P.sameVehicleMainControl.dataset, obj, "sameVehicleInspectionMainPaging--${pageName}");
};
- $P.sameVehicleControl.main.onCurrentChange = (DI) => {
- if(!$P.sameVehicleControl.main.tableRenderComplete){
- return;
- }
-
- if($P.sameVehicleControl.main.beforeCurrent != null){
- var beforeCurrentKey = $P.sameVehicleControl.main.beforeCurrent.key;
- var beforeCurrentIndex = $P.sameVehicleControl.main.beforeCurrent.index;
- $P.sameVehicleControl.main.beforeCurrent = null;
-
- if(!$P.sameVehicleControl.main.dataset.empty){
- var info = $P.sameVehicleControl.main.dataset.getData(beforeCurrentKey);
-
- if(info != null){
- $P.sameVehicleControl.main.dataset.setCurrent(beforeCurrentKey,true);
- return;
- }
-
- if(beforeCurrentIndex > ($P.sameVehicleControl.main.dataset.length - 1)){
- info = $P.sameVehicleControl.main.dataset.getDataset()[$P.sameVehicleControl.main.dataset.length - 1];
- } else {
- info = $P.sameVehicleControl.main.dataset.getDataset()[beforeCurrentIndex];
- }
-
- $P.sameVehicleControl.main.dataset.setCurrent(info["CRDN_ID_LIST"],true);
- return;
- }
- }
-
- $P.sameVehicleControl.main.tableRenderComplete = false;
- if(!DI){
- $P.clickInspectionDataList("","sameVehicleInspectionMain", true);
+ $P.sameVehicleMainControl.dataset.onCurrentChange = (dataItem) => {
+ Apply.fromDataset.currentRow($P.sameVehicleMainControl.dataset, dataItem, $("#sameVehicleInspectionMainTbody--${pageName}")[0]);
+ if(dataItem){
+ $P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]);
} else {
- $P.clickInspectionDataList($P.sameVehicleControl.main.getCurrent()["CRDN_ID_LIST"],"sameVehicleInspectionMain", true);
+ $("#sameVehicleInspectionSubTbody--${pageName}").html("");
}
}
- $P.sameVehicleControl.sub.onDatasetChange = (obj) => {
- $P.renderInspectionDataList(obj["Total"], "sameVehicleInspectionSub");
- $P.sameVehicleControl.sub.tableRenderComplete = true;
+ $P.sameVehicleSubControl.dataset.onDatasetChange = (obj) => {
+ var t = $P.getGridTemplate("sameVehicleInspectionSub");
+ var trs = Apply.fromDataset.getTbody($P.sameVehicleSubControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderInspectionDataList(obj["Total"], $P.sameVehicleSubControl.dataset.length, trs, "sameVehicleInspectionSub");
};
- $P.sameVehicleControl.sub.onCurrentChange = (DI) => {
- if(!$P.sameVehicleControl.sub.tableRenderComplete){
- return;
- }
-
- $P.sameVehicleControl.sub.tableRenderComplete = false;
- if(!DI){
- $P.clickInspectionDataList("","sameVehicleInspectionSub", true);
- } else {
- $P.clickInspectionDataList($P.sameVehicleControl.sub.getCurrent()["CRDN_ID"],"sameVehicleInspectionSub", true);
- }
+ $P.sameVehicleSubControl.dataset.onCurrentChange = (dataItem) => {
+ Apply.fromDataset.currentRow($P.sameVehicleSubControl.dataset, dataItem, $("#sameVehicleInspectionSubTbody--${pageName}")[0]);
};
/**************************************************************************
@@ -583,17 +518,17 @@ $(document).ready(function(){
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-7).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
$P.photoInspectionControl.setData([]);
- $P.sameVehicleControl.main.setData([]);
+ $P.sameVehicleMainControl.setData([]);
};
-
+
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.photoInspectionControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.photoInspectionControl.urls.getInfo = "";
- $P.sameVehicleControl.main.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
- $P.sameVehicleControl.main.urls.getInfo = "";
- $P.sameVehicleControl.sub.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
- $P.sameVehicleControl.sub.urls.getInfo = "";
+ $P.sameVehicleMainControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
+ $P.sameVehicleMainControl.urls.getInfo = "";
+ $P.sameVehicleSubControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
+ $P.sameVehicleSubControl.urls.getInfo = "";
var clsForTask = taskSeCd.toLowerCase();
//업무별 조회조건
@@ -607,31 +542,19 @@ $(document).ready(function(){
$('#btnPhotoInspection--${pageName}').trigger("click");
}
+ $P.getParams = () => {
+ var formFields = new FimsFormFields("#frmSearch--${pageName}");
+ var data = formFields.get();
- $P.refreshInspectionList = () => {
- switch ($P.currentDisplay) {
- case "photoInspection":
- $P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum;
- $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum;
- $P.photoInspectionControl.beforeCurrent = {
- key : $P.photoInspectionControl.getCurrent()["CRDN_ID"],
- index : $P.photoInspectionControl.getCurrent()["ROW_NUM"] - 1
- };
- $P.photoInspectionControl.load(1);
- break;
- case "sameVehicleInspection":
- $P.sameVehicleControl.untilPageNum = $P.sameVehicleControl.main.query.pageNum;
- $P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize * $P.sameVehicleControl.main.query.pageNum;
- $P.sameVehicleControl.main.beforeCurrent = {
- key : $P.sameVehicleControl.main.getCurrent()["CRDN_ID_LIST"],
- index : $P.sameVehicleControl.main.getCurrent()["ROW_NUM"] - 1
- };
- $P.sameVehicleControl.main.load(1);
- break;
- default: break;
+ if($P.currentDisplay == "photoInspection"){
+ data.fetchSize = $P.photoInspectionControl.defaultFetchSize;
+ } else if($P.currentDisplay == "sameVehicleInspection"){
+ data.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
}
- }
+ return data;
+ }
+
$P.searchInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
@@ -640,19 +563,20 @@ $(document).ready(function(){
$P.photoInspectionControl.load(1);
break;
case "sameVehicleInspection":
- $P.sameVehicleControl.main.query = $P.getParams();
- $P.sameVehicleControl.main.query.inspectionDataType = "sameVehicleMain";
- $P.sameVehicleControl.main.load(1);
+ $P.sameVehicleMainControl.query = $P.getParams();
+ $P.sameVehicleMainControl.query.inspectionDataType = "sameVehicleMain";
+ $P.sameVehicleMainControl.load(1);
break;
default: break;
}
}
+
$P.searchDetailInspectionDataList = (dataKey) => {
- $P.sameVehicleControl.sub.query = {};
- $P.sameVehicleControl.sub.query.inspectionDataType = "sameVehicleSub";
- $P.sameVehicleControl.sub.query.crdnIDs = dataKey;
- $P.sameVehicleControl.sub.query.taskSeCd = $P.sameVehicleControl.main.query.taskSeCd;
- $P.sameVehicleControl.sub.load(0);
+ $P.sameVehicleSubControl.query = {};
+ $P.sameVehicleSubControl.query.inspectionDataType = "sameVehicleSub";
+ $P.sameVehicleSubControl.query.crdnIDs = dataKey;
+ $P.sameVehicleSubControl.query.taskSeCd = $P.sameVehicleMainControl.query.taskSeCd;
+ $P.sameVehicleSubControl.load(0);
}
$P.scrollInspectionDataList = () => {
@@ -661,91 +585,252 @@ $(document).ready(function(){
$P.photoInspectionControl.load($P.photoInspectionControl.query.pageNum + 1);
break;
case "sameVehicleInspection":
- $P.sameVehicleControl.main.load($P.sameVehicleControl.main.query.pageNum + 1);
+ $P.sameVehicleMainControl.load($P.sameVehicleMainControl.query.pageNum + 1);
break;
default: break;
}
}
- $P.clickInspectionDataList = (dataKey, gridType, auto) => {
- switch (gridType) {
+
+ $P.refreshInspectionList = () => {
+ switch ($P.currentDisplay) {
case "photoInspection":
+ $P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum;
+ $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum;
+ $P.photoInspectionControl.beforeCurrent = {
+ key : $P.photoInspectionControl.getCurrent()["CRDN_ID"],
+ index : $P.photoInspectionControl.getCurrent()["ROW_NUM"] - 1
+ };
+
+ Apply.fromDatasetControl.load($P.photoInspectionControl, 1).then((resp)=>{
+ Apply.toDataset.set($P.photoInspectionControl.dataset, resp);
+ $P.photoInspectionControl.dataset.onDatasetChange(resp);
+
+ if($P.photoInspectionControl.untilPageNum != 0){
+ $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
+ $P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum;
+ $P.photoInspectionControl.untilPageNum = 0;
+ }
+
+ if($P.photoInspectionControl.beforeCurrent != null){
+ var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
+ var beforeCurrentIndex = $P.photoInspectionControl.beforeCurrent.index;
+ $P.photoInspectionControl.beforeCurrent = null;
+
+ if(!$P.photoInspectionControl.dataset.empty){
+ var info = $P.photoInspectionControl.dataset.getData(beforeCurrentKey);
- if(dataKey == ""){
- $("#curDataVhrno--${pageName}").html("");
- $("#nextDataVhrno--${pageName}").html("");
- $("#curDataFiles--${pageName}").html("");
- $("#nextDataFiles--${pageName}").html("");
- return;
- }
+ if(info != null){
+ $P.photoInspectionControl.dataset.setCurrent(beforeCurrentKey, true);
- $("#photoInspectionTbody--${pageName}").setCurrentRow(dataKey);
+ } else {
- var curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
- var nextData = $P.photoInspectionControl.getNext(dataKey);
- var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
- var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
-
- $("#curDataVhrno--${pageName}").html(curDataVhrno);
- $("#nextDataVhrno--${pageName}").html(nextDataVhrno);
-
- ajax.get({
- url:"file/list.do",
- data: {
- infoType : "100",
- infoKeys : [dataKey, nextDataKey],
- fetchSize : 0
- },
- success : resp => {
+ if(beforeCurrentIndex > ($P.photoInspectionControl.dataset.length - 1)){
+ info = $P.photoInspectionControl.dataset.getDataset()[$P.photoInspectionControl.dataset.length - 1];
+ } else {
+ info = $P.photoInspectionControl.dataset.getDataset()[beforeCurrentIndex];
+ }
+
+ $P.photoInspectionControl.dataset.setCurrent(info["CRDN_ID"], true);
+
+ }
+ }
+ }
+ });
+ break;
+ case "sameVehicleInspection":
+ $P.sameVehicleMainControl.untilPageNum = $P.sameVehicleMainControl.query.pageNum;
+ $P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize * $P.sameVehicleMainControl.query.pageNum;
+ $P.sameVehicleMainControl.beforeCurrent = {
+ key : $P.sameVehicleMainControl.getCurrent()["CRDN_ID_LIST"],
+ index : $P.sameVehicleMainControl.getCurrent()["ROW_NUM"] - 1
+ };
+
+ Apply.fromDatasetControl.load($P.sameVehicleMainControl, 1).then((resp)=>{
+ Apply.toDataset.set($P.sameVehicleMainControl.dataset, resp);
+ $P.sameVehicleMainControl.dataset.onDatasetChange(resp);
+
+ if($P.sameVehicleMainControl.untilPageNum != 0){
+ $P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
+ $P.sameVehicleMainControl.query.pageNum = $P.sameVehicleMainControl.untilPageNum;
+ $P.sameVehicleMainControl.untilPageNum = 0;
+ }
+
+ if($P.sameVehicleMainControl.beforeCurrent != null){
+ var beforeCurrentKey = $P.sameVehicleMainControl.beforeCurrent.key;
+ var beforeCurrentIndex = $P.sameVehicleMainControl.beforeCurrent.index;
+ $P.sameVehicleMainControl.beforeCurrent = null;
- var fileList = resp.fileList;
+ if(!$P.sameVehicleMainControl.dataset.empty){
+ var info = $P.sameVehicleMainControl.dataset.getData(beforeCurrentKey);
- var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey);
- var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey);
+ if(info != null){
+ $P.sameVehicleMainControl.dataset.setCurrent(beforeCurrentKey,true);
- $("#curDataFiles--${pageName}").html("");
- $("#nextDataFiles--${pageName}").html("");
+ } else {
+ if(beforeCurrentIndex > ($P.sameVehicleMainControl.dataset.length - 1)){
+ info = $P.sameVehicleMainControl.dataset.getDataset()[$P.sameVehicleMainControl.dataset.length - 1];
+ } else {
+ info = $P.sameVehicleMainControl.dataset.getDataset()[beforeCurrentIndex];
+ }
- currentDataFileList.forEach(function(item, index, array){
- var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC);
- $("#curDataFiles--${pageName}").append(output);
- });
- nextDataFileList.forEach(function(item, index, array){
- var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC);
- $("#nextDataFiles--${pageName}").append(output);
- });
+ $P.sameVehicleMainControl.dataset.setCurrent(info["CRDN_ID_LIST"],true);
+ }
+ }
}
+
});
+
+ break;
+ default: break;
+ }
+ }
+
+ $P.fnExcelDown = () => {
+ if($P.currentDisplay == "photoInspection"){
+ if($P.photoInspectionControl.dataset.empty){
+ alert("조회된 자료가 없습니다.");
+ return;
+ }
- if(!auto){
- $P.photoInspectionControl.setCurrent(dataKey);
- }
+ var cellDefs = getCellDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
+ $($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
+ $P.photoInspectionControl.query.cellDefs = cellDefs;
+
+ $P.photoInspectionControl.download();
+
+ } else {
+
+ if($P.sameVehicleMainControl.dataset.empty){
+ alert("조회된 자료가 없습니다.");
+ return;
+ }
+
+ if(confirm("단속건수 엑셀저장은 확인버튼, 상세내역 엑셀저장시 취소버튼을 누르세요.")){
+
+ var cellDefs = getCellDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
+ $($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td"));
+ $P.sameVehicleMainControl.query.cellDefs = cellDefs;
+
+ $P.sameVehicleMainControl.download();
+ } else {
+
+ var cellDefs = getCellDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"),
+ $($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask"));
+ $P.sameVehicleSubControl.query.cellDefs = cellDefs;
+
+ $P.sameVehicleSubControl.download();
+ }
+
+ }
+ }
+
+ $P.getGridTemplate = (gridType) => {
+ var notFound;
+ var found;
+ var replacer;
+
+ switch (gridType) {
+ case "photoInspection":
+ notFound = [document.getElementById("photoInspectionNotFound--${pageName}").innerHTML]
+ found = document.getElementById("photoInspectionRow--${pageName}").innerHTML;
+ replacer = (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
+ .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
+
+ break;
+ case "sameVehicleInspectionMain":
+ notFound = [document.getElementById("sameVehicleInspectionMainNotFound--${pageName}").innerHTML];
+ found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
+ replacer = (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
+
+ break;
+ case "sameVehicleInspectionSub":
+ notFound = [document.getElementById("sameVehicleInspectionSubNotFound--${pageName}").innerHTML]
+ found = document.getElementById("sameVehicleInspectionSubRow--${pageName}").innerHTML;
+ replacer = (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');")
+ .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');");
+
+ break;
+ }
+
+ return {
+ found : found,
+ notFound : notFound,
+ replacer : replacer
+ };
+ }
+
+ $P.renderInspectionDataList = (total, listLength, trs, renderDataType) => {
+
+ switch (renderDataType) {
+ case "photoInspection":
+ var noMore = (total == listLength);
+ var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0);
+
+ $("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
+ break;
+ case "sameVehicleInspectionMain":
+
+ var noMore = (total == listLength);
+ var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2) && ($P.sameVehicleMainControl.untilPageNum == 0);
+
+ $("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
+
+ break;
+ case "sameVehicleInspectionSub":
+
+ $("#sameVehicleInspectionSubTbody--${pageName}").html(trs);
+ break;
+ default: break;
+ }
+
+ //보안모드
+ fn_securityModeToggle($("#securityMode--top").is(":checked"));
+ }
+
+ $P.clickInspectionDataList = (dataKey, gridType) => {
+
+ switch (gridType) {
+ case "photoInspection":
+
+ if(dataKey != ""){
+ $("#photoInspectionTbody--${pageName}").setCurrentRow(dataKey);
+ Apply.toDataset.current($P.photoInspectionControl.dataset, dataKey);
+ }
+
+ var curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
+ var nextData = $P.photoInspectionControl.getNext(dataKey);
+ var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
+ var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
+ $P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
break;
case "sameVehicleInspectionMain":
if(dataKey == ""){
- $P.sameVehicleControl.sub.setData([]);
return;
}
$("#sameVehicleInspectionMainTbody--${pageName}").setCurrentRow(dataKey);
+
+ Apply.toDataset.current($P.sameVehicleMainControl.dataset, dataKey);
+
$P.searchDetailInspectionDataList(dataKey);
- if(!auto){
- $P.sameVehicleControl.main.setCurrent(dataKey);
- }
+
break;
case "sameVehicleInspectionSub":
if(dataKey == ""){
return;
}
$("#sameVehicleInspectionSubTbody--${pageName}").setCurrentRow(dataKey);
- if(!auto){
- $P.sameVehicleControl.sub.setCurrent(dataKey);
- }
+
+ Apply.toDataset.current($P.sameVehicleSubControl.dataset, dataKey);
break;
}
}
- $P.dblclickInspectionDataList = (dataKey, gridType) => {
+ $P.dblclickInspectionDataList = (dataKey) => {
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
@@ -759,7 +844,7 @@ $(document).ready(function(){
ajax.get({
url : dialogUrl,
data : params,
- success : resp => {
+ success : (resp) => {
dialog.open({
id : "totalInfoMainDialog",
@@ -771,13 +856,56 @@ $(document).ready(function(){
});
}
+ $P.showPhoto = (dataKey, nextDataKey, curDataVhrno, nextDataVhrno) => {
+
+ if(dataKey == ""){
+ $("#curDataVhrno--${pageName}").html("");
+ $("#nextDataVhrno--${pageName}").html("");
+ $("#curDataFiles--${pageName}").html("");
+ $("#nextDataFiles--${pageName}").html("");
+ return;
+ }
+
+ $("#curDataVhrno--${pageName}").html(curDataVhrno);
+ $("#nextDataVhrno--${pageName}").html(nextDataVhrno);
+
+ ajax.get({
+ url:"file/list.do",
+ data: {
+ infoType : "100",
+ infoKeys : [dataKey, nextDataKey],
+ fetchSize : 0
+ },
+ success : (resp) => {
+
+ var fileList = resp.fileList;
+
+ var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey);
+ var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey);
+
+ $("#curDataFiles--${pageName}").html("");
+ $("#nextDataFiles--${pageName}").html("");
+
+ currentDataFileList.forEach(function(item, index, array){
+ var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC);
+ $("#curDataFiles--${pageName}").append(output);
+ });
+ nextDataFileList.forEach(function(item, index, array){
+ var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC);
+ $("#nextDataFiles--${pageName}").append(output);
+ });
+
+ }
+ });
+ }
+
$P.openLevyExclPop = (levyExclSeCd) => {
var info = "";
if ($P.currentDisplay == "photoInspection") {
info = $P.photoInspectionControl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") {
- info = $P.sameVehicleControl.sub.dataset.getCurrent("item");
+ info = $P.sameVehicleSubControl.dataset.getCurrent("item");
} else {
return;
}
@@ -798,7 +926,7 @@ $(document).ready(function(){
ajax.get({
url : wctx.url(taskSeCd + "/excl/excl01/020/info.do"),
data : params,
- success : resp => {
+ success : (resp) => {
if((typeof resp) != "string"){
dialog.alert({
@@ -844,7 +972,7 @@ $(document).ready(function(){
ajax.get({
url : wctx.url("/PVS/crdn/crdn02/050/info.do"),
data : params,
- success : resp => {
+ success : (resp) => {
if((typeof resp) != "string"){
dialog.alert({
@@ -874,81 +1002,6 @@ $(document).ready(function(){
}
}
- $P.renderInspectionDataList = (total, renderDataType) => {
-
- switch (renderDataType) {
- case "photoInspection":
- var DS = $P.photoInspectionControl.dataset;
- var empty = DS.empty;
- var notFound = [document.getElementById("photoInspectionNotFound--${pageName}").innerHTML]
- var found = document.getElementById("photoInspectionRow--${pageName}").innerHTML;
- var replacer = (str, dataItem) => str
- .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
- .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
-
- var trs = empty ? notFound : DS.inStrings(found, replacer);
- var noMore = (total == DS.length);
- var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0);
-
- $("#photoInspection-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
-
- if($P.photoInspectionControl.untilPageNum != 0){
- $P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
- $P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum;
- $P.photoInspectionControl.untilPageNum = 0;
- }
- break;
- case "sameVehicleInspectionMain":
- var DS = $P.sameVehicleControl.main.dataset;
- var empty = DS.empty;
- var notFound = [document.getElementById("sameVehicleInspectionMainNotFound--${pageName}").innerHTML];
- var found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
- var replacer = (str, dataItem) => str
- .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
-
- var trs = empty ? notFound : DS.inStrings(found, replacer);
- var noMore = (total == DS.length);
- var initScroll = ($P.sameVehicleControl.main.query.pageNum < 2) && ($P.sameVehicleControl.untilPageNum == 0);
-
- $("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
-
-
- if($P.sameVehicleControl.untilPageNum != 0){
- $P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize;
- $P.sameVehicleControl.main.query.pageNum = $P.sameVehicleControl.untilPageNum;
- $P.sameVehicleControl.untilPageNum = 0;
- }
- break;
- case "sameVehicleInspectionSub":
- var DS = $P.sameVehicleControl.sub.dataset;
- var empty = DS.empty;
- var notFound = [document.getElementById("sameVehicleInspectionSubNotFound--${pageName}").innerHTML]
- var found = document.getElementById("sameVehicleInspectionSubRow--${pageName}").innerHTML;
- var replacer = (str, dataItem) => str
- .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');")
- .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');");
- var trs = empty ? notFound : DS.inStrings(found, replacer);
- $("#sameVehicleInspectionSubTbody--${pageName}").html(trs.join());
- break;
- default: break;
- }
-
- //보안모드
- fn_securityModeToggle($("#securityMode--top").is(":checked"));
- }
-
- $P.getParams = () => {
- var formFields = new FimsFormFields("#frmSearch--${pageName}");
- var data = formFields.get();
-
- if($P.currentDisplay == "photoInspection"){
- data.fetchSize = $P.photoInspectionControl.defaultFetchSize;
- } else if($P.currentDisplay == "sameVehicleInspection"){
- data.fetchSize = $P.sameVehicleControl.defaultFetchSize;
- }
-
- return data;
- }
/**************************************************************************
* element.on
@@ -974,48 +1027,7 @@ $(document).ready(function(){
});
$('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼
- $('#btnExcel--${pageName}').on('click', function(){
-
- if($P.currentDisplay == "photoInspection"){
- if($P.photoInspectionControl.dataset.empty){
- alert("조회된 자료가 없습니다.");
- return;
- }
-
- var cellDefs = getCellDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
- $($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
- $P.photoInspectionControl.query.cellDefs = cellDefs;
-
- $P.photoInspectionControl.download();
-
- } else {
-
- if($P.sameVehicleControl.main.dataset.empty){
- alert("조회된 자료가 없습니다.");
- return;
- }
-
- if(confirm("단속건수 엑셀저장은 확인버튼, 상세내역 엑셀저장시 취소버튼을 누르세요.")){
-
- var cellDefs = getCellDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
- $($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td"));
- $P.sameVehicleControl.main.query.cellDefs = cellDefs;
-
- $P.sameVehicleControl.main.download();
- } else {
-
- var cellDefs = getCellDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"),
- $($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask"));
- $P.sameVehicleControl.sub.query.cellDefs = cellDefs;
-
- $P.sameVehicleControl.sub.download();
- }
-
- }
-
-
-
- });
+ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
$("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1"));
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02050-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02050-info.jsp
index eb8f533a..fd43bafa 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02050-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn02050-info.jsp
@@ -48,45 +48,24 @@ $(document).ready(function(){
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.crdnControl = new DatasetControl({
- urls : { update : wctx.url("/PVS/crdn/crdn02/050/update.do") },
+ urls : {
+ update : wctx.url("/PVS/crdn/crdn02/050/update.do")
+ },
keymapper : info => info ? info.CRDN_ID : "",
dataGetter : obj => obj.crdnInfo,
formats: {}
});
- $P.crdnControl.save = (info) => {
- if (!info) return;
- ajax.post({
- url : $P.crdnControl.urls.update,
- data : info,
- success : resp => { $P.crdnControl.onSave(resp); }
- });
- };
/**************************************************************************
- * DatasetControl.on, Dataset.on
+ * Dataset.on
**************************************************************************/
- $P.crdnControl.onCurrentChange = (DI) => {
- $P.formFields.set(DI);
+ $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
+ $P.formFields.set(dataItem);
}
- $P.crdnControl.onSave = (resp) => {
- if (resp.saved) {
- dialog.alert({
- content : "저장됐습니다.",
- init : function(){
- setDialogZindex();
- focusClose();
- }
- });
- dialog.close("overTimeProcessDialog--${openerPageName}");
-
- if ("${savedCallbackFuncName}" != "") {
- ${savedCallbackFuncName}(resp.saved);
- }
- }
- };
+
/**************************************************************************
* pageObject.function
**************************************************************************/
@@ -121,7 +100,19 @@ $(document).ready(function(){
}
if(confirm(alertMessage)){
- $P.crdnControl.save($P.formFields.get());
+ var info = $P.formFields.get();
+ if (!info) {
+ return;
+ }
+
+ ajax.post({
+ url : $P.crdnControl.urls.update,
+ data : info,
+ success : (resp) => {
+ $P.saveCallback(resp);
+ }
+ });
+
}
}
@@ -141,10 +132,33 @@ $(document).ready(function(){
if(confirm("원금 복원하시겠습니까?")){
var info = $P.formFields.get();
info.chgAmtSe = "0";
- $P.crdnControl.save(info);
+
+ ajax.post({
+ url : $P.crdnControl.urls.update,
+ data : info,
+ success : (resp) => {
+ $P.saveCallback(resp);
+ }
+ });
}
}
+ $P.saveCallback = (resp) => {
+ if (resp.saved) {
+ dialog.alert({
+ content : "저장됐습니다.",
+ init : function(){
+ setDialogZindex();
+ focusClose();
+ }
+ });
+ dialog.close("overTimeProcessDialog--${openerPageName}");
+
+ if ("${savedCallbackFuncName}" != "") {
+ ${savedCallbackFuncName}(resp.saved);
+ }
+ }
+ };
/**************************************************************************
* element.on
**************************************************************************/
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp
index 3d2b3ece..883d4f70 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn03010-main.jsp
@@ -158,48 +158,50 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null;
- $P.crdnControl.tableRenderComplete = false;
/**************************************************************************
- * DatasetControl.on
+ * Dataset.on
**************************************************************************/
- $P.crdnControl.onDatasetChange = (obj) => {
-
- $P.renderCrdnList(obj["Total"]);
-
- $("#crdnPaging--${pageName}").setPagingInfo({
- list : $P.crdnControl.dataset,
- prefix : "crdnPaging--${pageName}",
- totalSize : obj["Total"]
- });
-
- $P.crdnControl.tableRenderComplete = true;
+ $P.crdnControl.dataset.onDatasetChange = (obj) => {
+
+ var t = $P.getGridTemplate();
+ var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
+
+ Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
};
- $P.crdnControl.onCurrentChange = (DI) => {
-
- if(!$P.crdnControl.tableRenderComplete){
- return;
- }
-
- $P.crdnControl.tableRenderComplete = false;
- if(!DI){
- $P.clickCrdnList("", true);
- } else {
- $P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
- }
+ $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
+ Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
- $P.refreshCrdnList = () => {
- $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
- $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
- $P.crdnControl.load(1);
+ $P.fnReset = () => {
+ var searchForm = $("#frmSearch--${pageName}");
+ searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
+ searchForm.find("input[type='checkbox']").prop("checked", false);
+ searchForm.find("input[type='text']").val("");
+ searchForm.find("input[type='hidden']").val("");
+ searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
+
+ $("#byOutput--${pageName}").val("동적 검색");
+ $('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
+ $('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
+ $P.crdnControl.setData([]);
}
+
+ $P.getParams = () => {
+ var formFields = new FimsFormFields("#frmSearch--${pageName}");
+ var data = formFields.get();
+ data.taskSeCd = "DPV";
+ data.fetchSize = $P.crdnControl.defaultFetchSize;
- $P.searchCrdnList = () => {
+ return data;
+ }
+
+ $P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams();
$P.crdnControl.load(1);
}
@@ -207,56 +209,82 @@ $(document).ready(function(){
$P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1);
}
-
- $P.clickCrdnList = (dataKey, auto) => {
- if(dataKey == ""){
- return;
- }
-
- $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
-
- if(!auto){
- $P.crdnControl.setCurrent(dataKey);
- }
- }
-
- $P.dblclickCrdnList = (dataKey) => {
- let params = {
- callControlName : "pageObject['${pageName}'].crdnControl"
- , crdnId : dataKey
- }
-
- ajax.get({
- url : $P.crdnControl.urls.getInfo,
- data : params,
- success : resp => {
-
- dialog.open({
- id : "totalInfoMainDialog",
- title : "개별총정보", size : "xxl", content : resp,
- init : () => {}
- });
-
+
+ $P.refreshCrdnList = () => {
+ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
+ $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
+
+ Apply.fromDatasetControl.load($P.crdnControl, 1).then((resp)=>{
+ Apply.toDataset.set($P.crdnControl.dataset, resp);
+ $P.crdnControl.dataset.onDatasetChange(resp);
+
+ if($P.crdnControl.untilPageNum != 0){
+ $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
+ $P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
+ $P.crdnControl.untilPageNum = 0;
+ }
+
+ if($P.crdnControl.beforeCurrent != null){
+ var beforeCurrentKey = $P.crdnControl.beforeCurrent.key;
+ var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index;
+ $P.crdnControl.beforeCurrent = null;
+
+ if(!$P.crdnControl.dataset.empty){
+ var info = $P.crdnControl.dataset.getData(beforeCurrentKey);
+
+ if(info != null){
+ $P.crdnControl.dataset.setCurrent(beforeCurrentKey,true);
+ } else {
+
+ if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){
+ info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1];
+ } else {
+ info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex];
+ }
+
+ $P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true);
+ }
+ }
}
+
});
-
}
+
+ $P.fnExcelDown = () => {
- $P.renderCrdnList = (total) => {
-
- var crdnDS = $P.crdnControl.dataset;
- var empty = crdnDS.empty;
+ if($P.crdnControl.dataset.empty){
+ alert("조회된 자료가 없습니다.");
+ return;
+ }
+
+ var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
+ $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
+ $P.crdnControl.query.cellDefs = cellDefs;
+
+ $P.crdnControl.download();
+ }
+
+ $P.getGridTemplate = () => {
+
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
+
+ return {
+ found : found,
+ notFound : notFound,
+ replacer : replacer
+ };
+ }
+
+ $P.renderCrdnList = (total, listLength, trs) => {
- var trs = empty ? notFound : crdnDS.inStrings(found,replacer);
- var noMore = (total == crdnDS.length);
+ var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
- $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
+ $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
@@ -268,53 +296,39 @@ $(document).ready(function(){
$P.crdnControl.untilPageNum = 0;
}
}
+
+ $P.clickCrdnList = (dataKey) => {
+ if(dataKey == ""){
+ return;
+ }
- $P.getParams = () => {
- var formFields = new FimsFormFields("#frmSearch--${pageName}");
- var data = formFields.get();
- data.taskSeCd = "DPV";
- data.fetchSize = $P.crdnControl.defaultFetchSize;
+ $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
+ Apply.toDataset.current($P.crdnControl.dataset, dataKey);
- return data;
}
- $P.fnReset = () => {
- var searchForm = $("#frmSearch--${pageName}");
- searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
- searchForm.find("input[type='checkbox']").prop("checked", false);
- searchForm.find("input[type='text']").val("");
- searchForm.find("input[type='hidden']").val("");
- searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
+ $P.dblclickCrdnList = (dataKey) => {
+ let params = {
+ callControlName : "pageObject['${pageName}'].crdnControl"
+ , crdnId : dataKey
+ }
- $("#byOutput--${pageName}").val("동적 검색");
- $('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
- $('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
- $P.crdnControl.setData([]);
- }
+ ajax.get({
+ url : $P.crdnControl.urls.getInfo,
+ data : params,
+ success : (resp) => {
- /**************************************************************************
- * element.on
- **************************************************************************/
- $('#btnReset--${pageName}').on('click', () => $P.fnReset());
- $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
- $('#btnExcel--${pageName}').on('click', function(){
-
- if($P.crdnControl.dataset.empty){
- alert("조회된 자료가 없습니다.");
- return;
- }
-
- var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
- $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
- $P.crdnControl.query.cellDefs = cellDefs;
-
- $P.crdnControl.download();
- });
-
- fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
- fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
-
- $('#btnUpdateToConfirmData--${pageName}').on('click', () => {
+ dialog.open({
+ id : "totalInfoMainDialog",
+ title : "개별총정보", size : "xxl", content : resp,
+ init : () => {}
+ });
+
+ }
+ });
+
+ }
+ $P.save = () => {
if(!$P.crdnControl.getCurrent()) {
dialog.alert({
@@ -329,13 +343,43 @@ $(document).ready(function(){
dialog.alert({
content : "현 자료를 장애차량 확인된 자료로 변경하시겠습니까?",
init : function(){
- focusOK();
+ focusOK();
},
- onOK:() => {
- $P.crdnControl.save({ 'crdnId' : $P.crdnControl.getCurrent()["CRDN_ID"] });
+ onOK : () => {
+ var info = { 'crdnId' : $P.crdnControl.getCurrent()["CRDN_ID"] };
+ ajax.post({
+ url : $P.crdnControl.urls.update,
+ data : info,
+ success : (resp) => {
+ $P.saveCallback(resp);
+ }
+ });
}
});
- });
+ }
+
+ $P.saveCallback = (resp) => {
+ if (resp.saved) {
+ dialog.alert({
+ content : "저장됐습니다.",
+ onClose : () => {
+ $P.refreshCrdnList();
+ }
+ });
+ }
+ }
+
+ /**************************************************************************
+ * element.on
+ **************************************************************************/
+ $('#btnReset--${pageName}').on('click', () => $P.fnReset());
+ $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
+ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
+
+ fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
+ fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
+
+ $('#btnUpdateToConfirmData--${pageName}').on('click', () => $P.save());
/**************************************************************************
* 초기화
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp
index 5d198998..4c0a3aec 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05010-main.jsp
@@ -135,7 +135,6 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null;
- $P.crdnControl.tableRenderComplete = false;
$P.crdnControl.urls.newInfoByFile = "";
$P.crdnControl.urls.newInfoByHand = "";
@@ -156,8 +155,8 @@ $(document).ready(function(){
ajax.get({
url : url,
- data: {},
- success:resp => {
+ data : {},
+ success : (resp) => {
dialog.open({
id: dialogId,
title: title,
@@ -170,34 +169,19 @@ $(document).ready(function(){
};
/**************************************************************************
- * DatasetControl.on
+ * Dataset.on
**************************************************************************/
- $P.crdnControl.onDatasetChange = (obj) => {
-
- $P.renderCrdnList(obj["Total"]);
+ $P.crdnControl.dataset.onDatasetChange = (obj) => {
+ var t = $P.getGridTemplate();
+ var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
- $("#crdnPaging--${pageName}").setPagingInfo({
- list : $P.crdnControl.dataset,
- prefix : "crdnPaging--${pageName}",
- totalSize : obj["Total"]
- });
-
- $P.crdnControl.tableRenderComplete = true;
+ Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
};
- $P.crdnControl.onCurrentChange = (DI) => {
-
- if(!$P.crdnControl.tableRenderComplete){
- return;
- }
-
- $P.crdnControl.tableRenderComplete = false;
- if(!DI){
- $P.clickCrdnList("", true);
- } else {
- $P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
- }
+ $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
+ Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
}
/**************************************************************************
@@ -229,12 +213,13 @@ $(document).ready(function(){
}
}
- $P.refreshCrdnList = () => {
- $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
- $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
- $P.crdnControl.load(1);
- }
-
+ $P.getParams = () => {
+ var formFields = new FimsFormFields("#frmSearch--${pageName}");
+ var data = formFields.get();
+ data.fetchSize = $P.crdnControl.defaultFetchSize;
+ return data;
+ }
+
$P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams();
$P.crdnControl.load(1);
@@ -243,33 +228,34 @@ $(document).ready(function(){
$P.scrollCrdnList = () => {
$P.crdnControl.load($P.crdnControl.query.pageNum + 1);
}
+
+ $P.refreshCrdnList = () => {
+ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
+ $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
+ $P.crdnControl.load(1);
+ }
+
- $P.clickCrdnList = (dataKey, auto) => {
- if(dataKey == ""){
- return;
- }
- $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
-
- if(!auto) {
- $P.crdnControl.setCurrent(dataKey);
- }
- }
-
- $P.renderCrdnList = (total) => {
-
- var crdnDS = $P.crdnControl.dataset;
- var empty = crdnDS.empty;
+ $P.getGridTemplate = () => {
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "");
- var trs = empty ? notFound : crdnDS.inStrings(found,replacer);
- var noMore = (total == crdnDS.length);
+ return {
+ found : found,
+ notFound : notFound,
+ replacer : replacer
+ };
+ }
+
+ $P.renderCrdnList = (total, listLength, trs) => {
+
+ var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
- $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
+ $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
@@ -281,13 +267,16 @@ $(document).ready(function(){
}
}
- $P.getParams = () => {
- var formFields = new FimsFormFields("#frmSearch--${pageName}");
- var data = formFields.get();
- data.fetchSize = $P.crdnControl.defaultFetchSize;
- return data;
- }
+ $P.clickCrdnList = (dataKey) => {
+ if(dataKey == ""){
+ return;
+ }
+ $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
+ $P.crdnControl.setCurrent(dataKey);
+ Apply.toDataset.current($P.crdnControl.dataset, dataKey);
+ }
+
/**************************************************************************
* element.on
**************************************************************************/
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp
index ec7fdb3b..d748474a 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp
@@ -189,38 +189,36 @@ $(document).ready(function(){
});
/**************************************************************************
- * DatasetControl.on
+ * Dataset.on
**************************************************************************/
- $P.parsedInfoControl.onDatasetChange = (obj) => {
+ $P.parsedInfoControl.dataset.onDatasetChange = (obj) => {
- $P.renderParsedInfoList(obj["Total"]);
+ var t = $P.getGridTemplate();
+ var trs = Apply.fromDataset.getTbody($P.parsedInfoControl.dataset, t.found, t.notFound, t.replacer);
+ $P.renderParsedInfoList(obj["Total"], $P.parsedInfoControl.dataset.length, trs);
- $("#parsedInfoPaging--${pageName}").setPagingInfo({
- list : $P.parsedInfoControl.dataset,
- prefix : "parsedInfoPaging--${pageName}",
- totalSize : obj["Total"]
- });
+ Apply.fromDataset.paging($P.parsedInfoControl.dataset, obj, "parsedInfoPaging--${pageName}");
};
- $P.parsedInfoControl.onCurrentChange = (DI) => {
+ $P.parsedInfoControl.dataset.onCurrentChange = (dataItem) => {
$("#imageArea--${pageName}").html("");
- if(DI && DI.data){
- var dataKey = DI.data.FILE_NAME;
+ if(dataItem && dataItem.data){
+ var dataKey = dataItem.data.FILE_NAME;
$("#table-responsive--${pageName}").find("tbody").setCurrentRow(dataKey);
- if(DI.data.FILE_GROUP_TYPE == "BIN"){
+ if(dataItem.data.FILE_GROUP_TYPE == "BIN"){
var srcArr = [];
- for(var i=1; i <= DI.data.PHOTO_CNT; i++){
- srcArr.push("data:image/jpg;base64," + DI.data["B64IMAGE"+i])
+ for(var i=1; i <= dataItem.data.PHOTO_CNT; i++){
+ srcArr.push("data:image/jpg;base64," + dataItem.data["B64IMAGE"+i])
}
$P.renderImage(srcArr);
} else {
if(!dataKey.endsWith(".txt") && !dataKey.endsWith(".TXT")){
- var src = DI.data.FILE_PATH;
+ var src = dataItem.data.FILE_PATH;
$P.renderImage(src);
}
}
@@ -313,21 +311,24 @@ $(document).ready(function(){
});
}
+ $P.getGridTemplate = () => {
+ var notFound = [$("#table-responsive--${pageName}").find("template.notFound")[0].innerHTML];
+ var found = $("#table-responsive--${pageName}").find("template.found")[0].innerHTML;
+ var replacer = (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
+
+ return {
+ found : found,
+ notFound : notFound,
+ replacer : replacer
+ };
+ }
//테이블 렌더링
- $P.renderParsedInfoList = (total) => {
-
- var parsedInfoDS = $P.parsedInfoControl.dataset;
- var empty = parsedInfoDS.empty;
- var notFound = [$("#table-responsive--${pageName}").find("template.notFound")[0].innerHTML];
- var found = $("#table-responsive--${pageName}").find("template.found")[0].innerHTML;
- var replacer = (str, dataItem) => str
- .replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
+ $P.renderParsedInfoList = (total, listLength, trs) => {
- var trs = empty ? notFound : parsedInfoDS.inStrings(found,replacer);
-
- $("#table-responsive--${pageName}").find("tbody").html(trs.join());
+ $("#table-responsive--${pageName}").find("tbody").html(trs);
- if(!empty){
+ if(listLength != 0){
fnDownsizeCheck($("#table-responsive--${pageName}").find("table")[0]);
}
diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp
index a110dd8c..450ca1ec 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp
@@ -1,6 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
-
+