DatasetControl keyMapper 설정 수정

main
이범준 3 months ago
parent c517183297
commit c640b606d0

@ -86,7 +86,7 @@
<tbody name="layoutTbody">
</tbody>
<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-center">TASK_SE_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 found = $P.findn("layoutRow").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickLayoutList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickLayoutList('{FILE_LAYOUT_ID}');");
return {
found : found,
@ -225,14 +225,14 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
}
$P.clickLayoutList = (dataKey) => {
if(dataKey == ""){
$P.clickLayoutList = (dataIndex) => {
if(dataIndex == ""){
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) => {

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

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

@ -71,7 +71,7 @@
</thead>
<tbody name="crdnTbody"></tbody>
<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-center">CRDN_REG_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.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.urls.newInfoByFile = "";
ctrl.urls.newInfoByHand = "";
@ -200,7 +199,7 @@ $(document).ready(function(){
var notFound = [$P.findn("crdnNotFound").innerHTML];
var found = $P.findn("crdnRow").innerHTML;
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, "");
return {
@ -225,14 +224,14 @@ $(document).ready(function(){
}
$P.clickCrdnList = (dataKey) => {
if(dataKey == ""){
$P.clickCrdnList = (dataIndex) => {
if(dataIndex == ""){
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) => {

@ -216,10 +216,10 @@
<th class="cmn dummy-th"></th>
</template>
<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 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);">
</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.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.dataset.onDatasetChange = (obj, option) => {
@ -446,8 +445,8 @@ $(document).ready(function(){
var found = foundTr.outerHTML;
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") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('{CRDN_ID}');");
return {
found : found,
@ -470,13 +469,13 @@ $(document).ready(function(){
}
$P.clickCrdnList = (dataKey) => {
if(dataKey == ""){
$P.clickCrdnList = (dataIndex) => {
if(dataIndex == ""){
return;
}
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
$P.$findn("crdnTbody").setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataIndex);
}
$P.dblclickCrdnList = (dataKey) => {
@ -510,7 +509,8 @@ $(document).ready(function(){
var datas = ctrl.dataset.getDataset("selected");
var taskSeCd = datas[0].TASK_SE_CD;
var keys = ctrl.dataset.getKeys("selected");
var keys = datas.map(item => item.CRDN_ID);
var url = "";
if(taskSeCd == "PVS"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do";

@ -66,7 +66,7 @@
</thead>
<tbody name="useTeamTbody"></tbody>
<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">CRDN_SE_NM</td>
<td onclick ondblclick class="text-start">TEAMER_1</td>
@ -202,7 +202,7 @@
</thead>
<tbody name="delTeamTbody"></tbody>
<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">CRDN_SE_NM</td>
<td onclick ondblclick class="text-start">TEAMER_1</td>
@ -361,7 +361,7 @@ $(document).ready(function(){
notFound = [$P.findn("useTeamNotFound").innerHTML];
found = $P.findn("useTeamRow").innerHTML;
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, "");
} else {
notFound = [$P.findn("delTeamNotFound").innerHTML];
@ -386,8 +386,8 @@ $(document).ready(function(){
$P.$findn("delTeamTbody").html(trs);
}
$P.clickUseTeamList = (dataKey) => {
ctrl.dataset.setCurrent(dataKey);
$P.clickUseTeamList = (dataIndex) => {
ctrl.dataset.setCurrent(dataIndex);
}
$P.fnSave = () => {

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

@ -309,6 +309,31 @@ const Apply = {
var empty = dataset.empty;
var trs = empty ? notFound : dataset.inStrings(found, replacer);
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 : {
@ -334,8 +359,9 @@ const Apply = {
set : function(dataset, resp){
dataset._byKeys = {};
dataset._current = null;
resp = resp || {};
var data = dataset._getDataItems(resp,{});
var data = dataset._getDataItems(resp = resp || {});
dataset._items = data.items;
dataset._byKeys = data.byKeys;
},
@ -345,7 +371,8 @@ const Apply = {
return;
}
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._byKeys = {
...this._byKeys,

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

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

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

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

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

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

@ -1,7 +1,8 @@
function newCrdn08010Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
dataGetter : obj => obj["List"],
appendData:true,
keys : ["EXMPTN_VHCL_ID"],
urls : {
load : wctx.url("/BPV/crdn/crdn08/010/list.do"),
remove : wctx.url("/BPV/crdn/crdn08/010/remove.do"),

Loading…
Cancel
Save