DatasetControl keyMapper 설정 수정

main
이범준 3 months ago
parent c517183297
commit c640b606d0

@ -86,7 +86,7 @@
<tbody name="layoutTbody"> <tbody name="layoutTbody">
</tbody> </tbody>
<template is="curly-brackets" name="layoutRow"> <template is="curly-brackets" name="layoutRow">
<tr data-key="FILE_LAYOUT_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">ROW_NUM</td> <td onclick ondblclick class="text-end">ROW_NUM</td>
<td onclick ondblclick class="text-center">TASK_SE_NM</td> <td onclick ondblclick class="text-center">TASK_SE_NM</td>
<td onclick ondblclick class="text-center">DEPT_NM</td> <td onclick ondblclick class="text-center">DEPT_NM</td>
@ -202,8 +202,8 @@ $(document).ready(function(){
var notFound = [$P.findn("layoutNotFound").innerHTML]; var notFound = [$P.findn("layoutNotFound").innerHTML];
var found = $P.findn("layoutRow").innerHTML; var found = $P.findn("layoutRow").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickLayoutList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickLayoutList('{FILE_LAYOUT_ID}');");
return { return {
found : found, found : found,
@ -225,14 +225,14 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
} }
$P.clickLayoutList = (dataKey) => { $P.clickLayoutList = (dataIndex) => {
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("layoutTbody").setCurrentRow(dataKey); $P.$findn("layoutTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }
$P.dblclickLayoutList = (dataKey) => { $P.dblclickLayoutList = (dataKey) => {

@ -219,7 +219,7 @@
</thead> </thead>
<tbody name="photoInspectionTbody"></tbody> <tbody name="photoInspectionTbody"></tbody>
<template is="curly-brackets" name="photoInspectionRow"> <template is="curly-brackets" name="photoInspectionRow">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-center">ROW_NUM</td> <td onclick ondblclick class="text-center">ROW_NUM</td>
<td onclick ondblclick class="text-center">CRDN_YMD_TM</td> <td onclick ondblclick class="text-center">CRDN_YMD_TM</td>
<td onclick ondblclick class="text-center">VHRNO</td> <td onclick ondblclick class="text-center">VHRNO</td>
@ -284,7 +284,7 @@
</thead> </thead>
<tbody name="sameVehicleInspectionMainTbody"></tbody> <tbody name="sameVehicleInspectionMainTbody"></tbody>
<template is="curly-brackets" name="sameVehicleInspectionMainRow"> <template is="curly-brackets" name="sameVehicleInspectionMainRow">
<tr data-key="CRDN_ID_LIST"> <tr data-index="DATA-INDEX">
<td onclick class="text-center">VHRNO</td> <td onclick class="text-center">VHRNO</td>
<td onclick class="text-center">CRDN_STDG_NM</td> <td onclick class="text-center">CRDN_STDG_NM</td>
<td onclick class="text-center">CRDN_CNT</td> <td onclick class="text-center">CRDN_CNT</td>
@ -336,7 +336,7 @@
<tbody name="sameVehicleInspectionSubTbody"> <tbody name="sameVehicleInspectionSubTbody">
</tbody> </tbody>
<template is="curly-brackets" name="sameVehicleInspectionSubRow"> <template is="curly-brackets" name="sameVehicleInspectionSubRow">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-center">CRDN_YMD_TM</td> <td onclick ondblclick class="text-center">CRDN_YMD_TM</td>
<td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td> <td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td>
<td onclick ondblclick class="text-center">TEAM_NM</td> <td onclick ondblclick class="text-center">TEAM_NM</td>
@ -395,13 +395,13 @@ $(document).ready(function(){
ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null; ctrl.beforeCurrent = null;
ctrl.getNext = (key) => { ctrl.getNext = (dataIndex) => {
var crdnId = ctrl.dataset.getData(dataIndex).CRDN_ID;
var dsArray = ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset(); var index = dsArray.findIndex(item => item.CRDN_ID == crdnId);
if(dsArray.length > index+1){
var index = ds.findIndex(item => item.CRDN_ID == key); return dsArray[index+1];
if(ds.length > index+1){
return ds[index+1];
} else { } else {
return null; return null;
} }
@ -418,19 +418,21 @@ $(document).ready(function(){
ctrl.dataset.onCurrentChange = (dataItem) => { ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("photoInspectionTbody")); Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("photoInspectionTbody"));
var dataKey = ""; var dataIndex = "";
var curCrdnId = "";
var curDataVhrno = ""; var curDataVhrno = "";
var nextDataKey = ""; var nextCrdnId = "";
var nextDataVhrno = ""; var nextDataVhrno = "";
if(!ctrl.dataset.empty){ if(!ctrl.dataset.empty){
dataKey = ctrl.dataset.getKey(dataItem); dataIndex = ctrl.dataset.getKey(dataItem);
curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"]; curCrdnId = ctrl.dataset.getData(dataIndex).CRDN_ID;
var nextData = ctrl.getNext(dataKey); curDataVhrno = ctrl.dataset.getData(dataIndex).VHRNO;
nextDataKey = nextData != null ? nextData.CRDN_ID : ""; var nextData = ctrl.getNext(dataIndex);
nextCrdnId = nextData != null ? nextData.CRDN_ID : "";
nextDataVhrno = nextData != null ? nextData.VHRNO : ""; nextDataVhrno = nextData != null ? nextData.VHRNO : "";
} }
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno); $P.showPhoto(curCrdnId,nextCrdnId,curDataVhrno,nextDataVhrno);
} }
$P.pagingSupport0 = new FimsPagingSupport({ $P.pagingSupport0 = new FimsPagingSupport({
@ -570,74 +572,36 @@ $(document).ready(function(){
switch ($P.currentDisplay) { switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"], primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if(ctrl.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID");
let beforeCurrentKey = ctrl.beforeCurrent.key; ctrl.beforeCurrent = null;
let beforeCurrentIndex = ctrl.beforeCurrent.index; if(todoCurrent != null){
ctrl.beforeCurrent = null; ctrl.dataset.setCurrent(todoCurrent.index, true);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
ctrl.dataset.setCurrent(beforeCurrentKey, true);
} else {
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
ctrl.dataset.setCurrent(info["CRDN_ID"], true);
}
}
} }
}); });
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
alt.beforeCurrent = { alt.beforeCurrent = {
key : alt.dataset.getCurrent()["CRDN_ID_LIST"], primaryKey : alt.dataset.getCurrent()["CRDN_ID_LIST"],
index : alt.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : alt.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload(alt).then((resp)=>{ Apply.fromDatasetControl.reload(alt).then((resp)=>{
Apply.toDataset.set(alt.dataset, resp); Apply.toDataset.set(alt.dataset, resp);
alt.dataset.onDatasetChange(resp, {reloaded : true}); alt.dataset.onDatasetChange(resp, {reloaded : true});
if(alt.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(alt.dataset, alt.beforeCurrent, "CRDN_ID_LIST");
var beforeCurrentKey = alt.beforeCurrent.key; alt.beforeCurrent = null;
var beforeCurrentIndex = alt.beforeCurrent.index; if(todoCurrent != null){
alt.beforeCurrent = null; alt.dataset.setCurrent(todoCurrent.index, true);
if(!alt.dataset.empty){
var info = alt.dataset.getData(beforeCurrentKey);
if(info != null){
alt.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > (alt.dataset.length - 1)){
info = alt.dataset.getDataset()[alt.dataset.length - 1];
} else {
info = alt.dataset.getDataset()[beforeCurrentIndex];
}
alt.dataset.setCurrent(info["CRDN_ID_LIST"],true);
}
}
} }
}); });
break; break;
@ -704,23 +668,23 @@ $(document).ready(function(){
notFound = [$P.findn("photoInspectionNotFound").innerHTML] notFound = [$P.findn("photoInspectionNotFound").innerHTML]
found = $P.findn("photoInspectionRow").innerHTML; found = $P.findn("photoInspectionRow").innerHTML;
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('{DATA-INDEX}','photoInspection');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('{CRDN_ID}','photoInspection');");
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
notFound = [$P.findn("sameVehicleInspectionMainNotFound").innerHTML]; notFound = [$P.findn("sameVehicleInspectionMainNotFound").innerHTML];
found = $P.findn("sameVehicleInspectionMainRow").innerHTML; found = $P.findn("sameVehicleInspectionMainRow").innerHTML;
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('{DATA-INDEX}','sameVehicleInspectionMain');");
break; break;
case "sameVehicleInspectionSub": case "sameVehicleInspectionSub":
notFound = [$P.findn("sameVehicleInspectionSubNotFound").innerHTML] notFound = [$P.findn("sameVehicleInspectionSubNotFound").innerHTML]
found = $P.findn("sameVehicleInspectionSubRow").innerHTML; found = $P.findn("sameVehicleInspectionSubRow").innerHTML;
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('{DATA-INDEX}','sameVehicleInspectionSub');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('{CRDN_ID}','sameVehicleInspectionSub');");
break; break;
} }
@ -766,40 +730,42 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
} }
$P.clickInspectionDataList = (dataKey, gridType) => { $P.clickInspectionDataList = (dataIndex, gridType) => {
switch (gridType) { switch (gridType) {
case "photoInspection": case "photoInspection":
if(dataKey != ""){ if(dataIndex != ""){
$P.$findn("photoInspectionTbody").setCurrentRow(dataKey); $P.$findn("photoInspectionTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }
var curData = ctrl.dataset.getData(dataIndex);
var curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"]; var curCrdnId = curData.CRDN_ID;
var nextData = ctrl.getNext(dataKey); var curDataVhrno = curData.VHRNO;
var nextDataKey = nextData != null ? nextData.CRDN_ID : ""; var nextData = ctrl.getNext(dataIndex);
var nextCrdnId = 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(curCrdnId,nextCrdnId,curDataVhrno,nextDataVhrno);
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("sameVehicleInspectionMainTbody").setCurrentRow(dataKey); $P.$findn("sameVehicleInspectionMainTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(alt.dataset, dataKey); Apply.toDataset.current(alt.dataset, dataIndex);
$P.searchDetailInspectionDataList(dataKey); var crdnIdList = alt.dataset.getData(dataIndex).CRDN_ID_LIST;
$P.searchDetailInspectionDataList(crdnIdList);
break; break;
case "sameVehicleInspectionSub": case "sameVehicleInspectionSub":
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("sameVehicleInspectionSubTbody").setCurrentRow(dataKey); $P.$findn("sameVehicleInspectionSubTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(shift.dataset, dataKey); Apply.toDataset.current(shift.dataset, dataIndex);
break; break;
} }
} }
@ -836,9 +802,9 @@ $(document).ready(function(){
}); });
} }
$P.showPhoto = (dataKey, nextDataKey, curDataVhrno, nextDataVhrno) => { $P.showPhoto = (crdnId, nextCrndId, curDataVhrno, nextDataVhrno) => {
if(dataKey == ""){ if(crdnId == ""){
$P.$findn("curDataVhrno").html(""); $P.$findn("curDataVhrno").html("");
$P.$findn("nextDataVhrno").html(""); $P.$findn("nextDataVhrno").html("");
$P.$findn("curDataFiles").html(""); $P.$findn("curDataFiles").html("");
@ -853,15 +819,15 @@ $(document).ready(function(){
url:"file/list.do", url:"file/list.do",
data: { data: {
infoType : "100", infoType : "100",
infoKeys : [dataKey, nextDataKey], infoKeys : [crdnId, nextCrndId],
fetchSize : 0 fetchSize : 0
}, },
success : (resp) => { success : (resp) => {
var fileList = resp.fileList; var fileList = resp.fileList;
var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey); var currentDataFileList = fileList.filter(x => x.INF_KEY == crdnId);
var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey); var nextDataFileList = fileList.filter(x => x.INF_KEY == nextCrndId);
$P.$findn("curDataFiles").html(""); $P.$findn("curDataFiles").html("");
$P.$findn("nextDataFiles").html(""); $P.$findn("nextDataFiles").html("");
@ -880,22 +846,22 @@ $(document).ready(function(){
} }
$P.openLevyExclPop = (levyExclSeCd) => { $P.openLevyExclPop = (levyExclSeCd) => {
var info = ""; var dataItem = "";
if ($P.currentDisplay == "photoInspection") { if ($P.currentDisplay == "photoInspection") {
info = ctrl.dataset.getCurrent("item"); dataItem = ctrl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") { } else if ($P.currentDisplay == "sameVehicleInspection") {
info = shift.dataset.getCurrent("item"); dataItem = shift.dataset.getCurrent("item");
} else { } else {
return; return;
} }
if (info == undefined || info == "") { if (dataItem == undefined || dataItem == "") {
return; return;
} }
var params = { var params = {
"crdnId" : info.data.CRDN_ID, "crdnId" : dataItem.data.CRDN_ID,
"levyExclSeCd" : levyExclSeCd, "levyExclSeCd" : levyExclSeCd,
"savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']", "savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']",
"callPurpose" : "create" "callPurpose" : "create"
@ -943,14 +909,14 @@ $(document).ready(function(){
return; return;
} }
var info = ctrl.dataset.getCurrent("item"); var dataItem = ctrl.dataset.getCurrent("item");
if (info == undefined || info == "") { if (dataItem == undefined || dataItem == "") {
return; return;
} }
var params = { var params = {
"crdnId" : info.data.CRDN_ID, "crdnId" : dataItem.data.CRDN_ID,
"savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']" "savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']"
}; };

@ -84,7 +84,7 @@
<tbody name="crdnTbody"> <tbody name="crdnTbody">
</tbody> </tbody>
<template is="curly-brackets" name="crdnRow"> <template is="curly-brackets" name="crdnRow">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">ROW_NUM</td> <td onclick ondblclick class="text-end">ROW_NUM</td>
<td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td> <td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td>
<td onclick ondblclick class="text-center">CRDN_YMD_TM</td> <td onclick ondblclick class="text-center">CRDN_YMD_TM</td>
@ -196,35 +196,18 @@ $(document).ready(function(){
$P.refreshCrdnList = () => { $P.refreshCrdnList = () => {
ctrl.beforeCurrent = { ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"], primaryKey : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1 arrayIndex : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
}; };
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{ Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp); Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true}); ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if(ctrl.beforeCurrent != null){ let todoCurrent = Apply.fromDataset.getTodoCurrent(ctrl.dataset, ctrl.beforeCurrent, "CRDN_ID_LIST");
let beforeCurrentKey = ctrl.beforeCurrent.key; ctrl.beforeCurrent = null;
let beforeCurrentIndex = ctrl.beforeCurrent.index; if(todoCurrent != null){
ctrl.beforeCurrent = null; ctrl.dataset.setCurrent(todoCurrent.index, true);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
ctrl.dataset.setCurrent(info["CRDN_ID"],true);
}
}
} }
}); });
@ -249,8 +232,8 @@ $(document).ready(function(){
var notFound = [$P.findn("crdnNotFound").innerHTML]; var notFound = [$P.findn("crdnNotFound").innerHTML];
var found = $P.findn("crdnRow").innerHTML; var found = $P.findn("crdnRow").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('{CRDN_ID}');");
return { return {
found : found, found : found,
@ -273,13 +256,13 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
} }
$P.clickCrdnList = (dataKey) => { $P.clickCrdnList = (dataIndex) => {
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }

@ -71,7 +71,7 @@
</thead> </thead>
<tbody name="crdnTbody"></tbody> <tbody name="crdnTbody"></tbody>
<template is="curly-brackets" name="crdnRow"> <template is="curly-brackets" name="crdnRow">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">ROW_NUM</td> <td onclick ondblclick class="text-end">ROW_NUM</td>
<td onclick ondblclick class="text-center">CRDN_REG_SE_NM</td> <td onclick ondblclick class="text-center">CRDN_REG_SE_NM</td>
<td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td> <td onclick ondblclick class="text-center">CRDN_INPT_SE_NM</td>
@ -124,7 +124,6 @@ $(document).ready(function(){
ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.urls.newInfoByFile = ""; ctrl.urls.newInfoByFile = "";
ctrl.urls.newInfoByHand = ""; ctrl.urls.newInfoByHand = "";
@ -200,7 +199,7 @@ $(document).ready(function(){
var notFound = [$P.findn("crdnNotFound").innerHTML]; var notFound = [$P.findn("crdnNotFound").innerHTML];
var found = $P.findn("crdnRow").innerHTML; var found = $P.findn("crdnRow").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
return { return {
@ -225,14 +224,14 @@ $(document).ready(function(){
} }
$P.clickCrdnList = (dataKey) => { $P.clickCrdnList = (dataIndex) => {
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }
$P.newInfo = (type) => { $P.newInfo = (type) => {

@ -216,10 +216,10 @@
<th class="cmn dummy-th"></th> <th class="cmn dummy-th"></th>
</template> </template>
<template is="curly-brackets" name="crdnRow"> <template is="curly-brackets" name="crdnRow">
<tr data-key="CRDN_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end cmn">ROW_NUM</td> <td onclick ondblclick class="text-end cmn">ROW_NUM</td>
<td class="cmn text-center"> <td class="cmn text-center">
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="CRDN_ID" <input type="checkbox" class="form-check-input" name="gridCheckbox" value="DATA-INDEX"
onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);"> onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);">
</td> </td>
<td onclick ondblclick class="text-center cmn">CRDN_INPT_SE_NM</td> <td onclick ondblclick class="text-center cmn">CRDN_INPT_SE_NM</td>
@ -308,7 +308,6 @@ $(document).ready(function(){
ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.dataset.onDatasetChange = (obj, option) => { ctrl.dataset.onDatasetChange = (obj, option) => {
@ -446,8 +445,8 @@ $(document).ready(function(){
var found = foundTr.outerHTML; var found = foundTr.outerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('{CRDN_ID}');");
return { return {
found : found, found : found,
@ -470,13 +469,13 @@ $(document).ready(function(){
} }
$P.clickCrdnList = (dataKey) => { $P.clickCrdnList = (dataIndex) => {
if(dataKey == ""){ if(dataIndex == ""){
return; return;
} }
$P.$findn("crdnTbody").setCurrentRow(dataKey); $P.$findn("crdnTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -510,7 +509,8 @@ $(document).ready(function(){
var datas = 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 = ctrl.dataset.getKeys("selected"); var keys = datas.map(item => item.CRDN_ID);
var url = ""; var url = "";
if(taskSeCd == "PVS"){ if(taskSeCd == "PVS"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do"; url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do";

@ -66,7 +66,7 @@
</thead> </thead>
<tbody name="useTeamTbody"></tbody> <tbody name="useTeamTbody"></tbody>
<template is="curly-brackets" name="useTeamRow"> <template is="curly-brackets" name="useTeamRow">
<tr data-key="TEAM_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-start">TEAM_NM</td> <td onclick ondblclick class="text-start">TEAM_NM</td>
<td onclick ondblclick class="text-start">CRDN_SE_NM</td> <td onclick ondblclick class="text-start">CRDN_SE_NM</td>
<td onclick ondblclick class="text-start">TEAMER_1</td> <td onclick ondblclick class="text-start">TEAMER_1</td>
@ -202,7 +202,7 @@
</thead> </thead>
<tbody name="delTeamTbody"></tbody> <tbody name="delTeamTbody"></tbody>
<template is="curly-brackets" name="delTeamRow"> <template is="curly-brackets" name="delTeamRow">
<tr data-key="TEAM_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-start">TEAM_NM</td> <td onclick ondblclick class="text-start">TEAM_NM</td>
<td onclick ondblclick class="text-start">CRDN_SE_NM</td> <td onclick ondblclick class="text-start">CRDN_SE_NM</td>
<td onclick ondblclick class="text-start">TEAMER_1</td> <td onclick ondblclick class="text-start">TEAMER_1</td>
@ -361,7 +361,7 @@ $(document).ready(function(){
notFound = [$P.findn("useTeamNotFound").innerHTML]; notFound = [$P.findn("useTeamNotFound").innerHTML];
found = $P.findn("useTeamRow").innerHTML; found = $P.findn("useTeamRow").innerHTML;
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickUseTeamList('" + dataItem.getValue("TEAM_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickUseTeamList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
} else { } else {
notFound = [$P.findn("delTeamNotFound").innerHTML]; notFound = [$P.findn("delTeamNotFound").innerHTML];
@ -386,8 +386,8 @@ $(document).ready(function(){
$P.$findn("delTeamTbody").html(trs); $P.$findn("delTeamTbody").html(trs);
} }
$P.clickUseTeamList = (dataKey) => { $P.clickUseTeamList = (dataIndex) => {
ctrl.dataset.setCurrent(dataKey); ctrl.dataset.setCurrent(dataIndex);
} }
$P.fnSave = () => { $P.fnSave = () => {

@ -81,7 +81,7 @@
</thead> </thead>
<tbody name="exmptnVhclTbody"></tbody> <tbody name="exmptnVhclTbody"></tbody>
<template is="curly-brackets" name="exmptnVhclRow"> <template is="curly-brackets" name="exmptnVhclRow">
<tr data-key="EXMPTN_VHCL_ID"> <tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">ROW_NUM</td> <td onclick ondblclick class="text-end">ROW_NUM</td>
<td onclick ondblclick class="text-center">VHRNO</td> <td onclick ondblclick class="text-center">VHRNO</td>
<td onclick ondblclick class="text-start">EXMPTN_RSN</td> <td onclick ondblclick class="text-start">EXMPTN_RSN</td>
@ -138,8 +138,6 @@ $(document).ready(function(){
var ctrl = newCrdn08010Control($P); var ctrl = newCrdn08010Control($P);
ctrl.defaultFetchSize = FETCH_XS; ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize }; ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.dataset.onDatasetChange = (obj, option) => { ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate(); var t = $P.getGridTemplate();
@ -210,8 +208,8 @@ $(document).ready(function(){
var notFound = [$P.findn("exmptnVhclNotFound").innerHTML]; var notFound = [$P.findn("exmptnVhclNotFound").innerHTML];
var found = $P.findn("exmptnVhclRow").innerHTML; var found = $P.findn("exmptnVhclRow").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickExmptnVhclList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('{EXMPTN_VHCL_ID}');");
return { return {
found : found, found : found,
@ -234,30 +232,32 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
} }
$P.clickExmptnVhclList = (dataKey) => { $P.clickExmptnVhclList = (dataIndex) => {
if(dataKey == ""){ if(dataIndex == ""){
$P.$findn("btnOpenDelRsn").prop("disabled", true); $P.$findn("btnOpenDelRsn").prop("disabled", true);
$P.$findn("btnHistory").prop("disabled", true); $P.$findn("btnHistory").prop("disabled", true);
return; return;
} }
if(ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){ if(ctrl.dataset.getData(dataIndex)["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);
} }
$P.$findn("btnHistory").prop("disabled", false); $P.$findn("btnHistory").prop("disabled", false);
$P.$findn("exmptnVhclTbody").setCurrentRow(dataKey); $P.$findn("exmptnVhclTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataKey); Apply.toDataset.current(ctrl.dataset, dataIndex);
} }
$P.dblclickExmptnVhclList = (dataKey) => { $P.dblclickExmptnVhclList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
var data = ctrl.dataset.getData(dataKey);
let dataItem = ctrl.dataset.getDataset("item").filter(item => item.data.EXMPTN_VHCL_ID == dataKey)[0];
var data = dataItem.data;
if(data.DEL_YN == "Y"){ if(data.DEL_YN == "Y"){
dialog.alert({ dialog.alert({
content : "삭제된 자료입니다.", content : "삭제된 자료입니다.",

@ -309,6 +309,31 @@ const Apply = {
var empty = dataset.empty; var empty = dataset.empty;
var trs = empty ? notFound : dataset.inStrings(found, replacer); var trs = empty ? notFound : dataset.inStrings(found, replacer);
return trs.join(); return trs.join();
},
getTodoCurrent : function(dataset, beforeCurrent, columnName){
let di = null;
if(beforeCurrent == null){
return null;
}
if(dataset.empty){
return null;
}
let filtered = dataset.getDataset("item").filter(item => item.data[columnName] == beforeCurrent.primaryKey);
if(filtered.length > 0){
di = filtered[0];
return di;
}
let otherInfo;
if(beforeCurrent.arrayIndex > (dataset.length - 1)){
di = dataset.getDataset("item")[dataset.length - 1];
} else {
di = dataset.getDataset("item")[beforeCurrent.arrayIndex];
}
return di;
} }
}, },
toDataset : { toDataset : {
@ -334,8 +359,9 @@ const Apply = {
set : function(dataset, resp){ set : function(dataset, resp){
dataset._byKeys = {}; dataset._byKeys = {};
dataset._current = null; dataset._current = null;
resp = resp || {};
var data = dataset._getDataItems(resp,{});
var data = dataset._getDataItems(resp = resp || {});
dataset._items = data.items; dataset._items = data.items;
dataset._byKeys = data.byKeys; dataset._byKeys = data.byKeys;
}, },
@ -345,7 +371,8 @@ const Apply = {
return; return;
} }
var state = dataset.state; var state = dataset.state;
var data = dataset._getDataItems(resp = resp || {}); resp = resp || {};
var data = dataset._getDataItems(resp,{});
dataset._items = this._items.concat(data.items); dataset._items = this._items.concat(data.items);
dataset._byKeys = { dataset._byKeys = {
...this._byKeys, ...this._byKeys,

@ -1,8 +1,9 @@
function newCrdn01010Control(page, doctx = ""){ function newCrdn01010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.FILE_LAYOUT_ID : "", appendData:true,
urls : { keys : ["FILE_LAYOUT_ID"],
urls : {
load : "", load : "",
getInfo : "" getInfo : ""
}, },

@ -1,7 +1,8 @@
function newCrdn02010Control(page, doctx = ""){ function newCrdn02010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", appendData:true,
keys: ["CRDN_ID"],
urls : { urls : {
load : "" load : ""
}, },
@ -16,8 +17,9 @@ function newCrdn02010Control(page, doctx = ""){
function newCrdn02010Alt(page, doctx = ""){ function newCrdn02010Alt(page, doctx = ""){
page.alt = new DatasetControl({ page.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID_LIST : "", appendData:true,
keys : ["CRDN_ID_LIST"],
urls : { urls : {
load : "" load : ""
}, },
@ -32,7 +34,7 @@ function newCrdn02010Alt(page, doctx = ""){
function newCrdn02010Shift(page, doctx = ""){ function newCrdn02010Shift(page, doctx = ""){
page.shift = new DatasetControl({ page.shift = new DatasetControl({
dataGetter : obj => obj["List"], dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", keys: ["CRDN_ID"],
urls : { urls : {
load : "" load : ""
}, },

@ -1,12 +1,13 @@
function newCrdn03010Control(page, doctx = ""){ function newCrdn03010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", appendData:true,
keys : ["CRDN_ID"],
urls : { urls : {
load : wctx.url("/DPV/crdn/crdn03/030/list.do"), load : wctx.url("/DPV/crdn/crdn03/030/list.do"),
getInfo : wctx.url("/DPV/sprt/sprt02/010/main.do"), getInfo : wctx.url("/DPV/sprt/sprt02/010/main.do"),
update: wctx.url("/DPV/crdn/crdn03/030/update.do") update: wctx.url("/DPV/crdn/crdn03/030/update.do")
}, },
formats: { formats: {
CRDN_YMD_TM : datetimeFormat, CRDN_YMD_TM : datetimeFormat,
FFNLG_CRDN_AMT : numberFormat, FFNLG_CRDN_AMT : numberFormat,

@ -1,7 +1,8 @@
function newCrdn05010Control(page, doctx = ""){ function newCrdn05010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", appendData:true,
keys : ["CRDN_ID"],
urls : { urls : {
load : "" load : ""
}, },

@ -1,11 +1,12 @@
function newCrdn06010Control(page, doctx = ""){ function newCrdn06010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", appendData:true,
urls : { keys : ["CRDN_ID"],
load : "", urls : {
getInfo : "" load : "",
}, getInfo : ""
},
formats: { formats: {
CRDN_YMD_TM : datetimeFormat, CRDN_YMD_TM : datetimeFormat,
REG_DT : datetimeFormat, REG_DT : datetimeFormat,

@ -1,12 +1,13 @@
function newCrdn07010Control(page, doctx = ""){ function newCrdn07010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:false, dataGetter : obj => obj["List"],
keymapper : info => info ? info.TEAM_ID : "", appendData:false,
urls : { keys : ["TEAM_ID"],
load : "", urls : {
remove : "", load : "",
save : "" remove : "",
}, save : ""
},
formats: { formats: {
REG_DT : datetimeFormat, REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat, MDFCN_DT : datetimeFormat,
@ -18,8 +19,9 @@ function newCrdn07010Control(page, doctx = ""){
function newCrdn07010Alt(page, doctx = ""){ function newCrdn07010Alt(page, doctx = ""){
page.alt = new DatasetControl({ page.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false, dataGetter : obj => obj["List"],
keymapper : info => info ? info.TEAM_ID : "", appendData: false,
keys : ["TEAM_ID"],
urls : { }, urls : { },
formats: { formats: {
REG_DT : datetimeFormat, REG_DT : datetimeFormat,

@ -1,13 +1,14 @@
function newCrdn08010Control(page, doctx = ""){ function newCrdn08010Control(page, doctx = ""){
page.ctrl = new DatasetControl({ page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"],
keymapper : info => info ? info.EXMPTN_VHCL_ID : "", appendData:true,
urls : { keys : ["EXMPTN_VHCL_ID"],
load : wctx.url("/BPV/crdn/crdn08/010/list.do"), urls : {
remove : wctx.url("/BPV/crdn/crdn08/010/remove.do"), load : wctx.url("/BPV/crdn/crdn08/010/list.do"),
newInfo : wctx.url("/BPV/crdn/crdn08/020/info.do"), remove : wctx.url("/BPV/crdn/crdn08/010/remove.do"),
getInfo : wctx.url("/BPV/crdn/crdn08/020/info.do") newInfo : wctx.url("/BPV/crdn/crdn08/020/info.do"),
}, getInfo : wctx.url("/BPV/crdn/crdn08/020/info.do")
},
formats: { formats: {
EXMPTN_BGNG_YMD : dateFormat, EXMPTN_BGNG_YMD : dateFormat,
EXMPTN_END_YMD : dateFormat, EXMPTN_END_YMD : dateFormat,

Loading…
Cancel
Save