DatasetControl keyMapper 설정 수정

main
이범준 3 months ago
parent 9ddb9c1f07
commit f2395c65a9

@ -97,7 +97,7 @@
</thead>
<tbody></tbody>
<template is="curly-brackets" class="found">
<tr data-key="FILE_NAME">
<tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-center">TEMP_GROUP_ID</td>
<td onclick ondblclick title="{FILE_NAME}"
class="text-start text-truncate max-w-th">FILE_NAME</td>
@ -187,9 +187,9 @@ $(document).ready(function(){
$P.$findn("imageArea").html("");
if(dataItem && dataItem.data){
var dataKey = dataItem.data.FILE_NAME;
var dataIndex = dataItem.index;
$P.$findn("table-responsive").find("tbody").setCurrentRow(dataKey);
$P.$findn("table-responsive").find("tbody").setCurrentRow(dataIndex);
if(dataItem.data.FILE_GROUP_TYPE == "BIN"){
var srcArr = [];
@ -200,6 +200,7 @@ $(document).ready(function(){
$P.renderImage(srcArr);
} else {
var dataKey = dataItem.data.FILE_NAME;
if(!dataKey.endsWith(".txt") && !dataKey.endsWith(".TXT")){
var src = dataItem.data.FILE_PATH;
$P.renderImage(src);
@ -303,7 +304,7 @@ $(document).ready(function(){
var notFound = [$P.$findn("table-responsive").find("template.notFound")[0].innerHTML];
var found = $P.$findn("table-responsive").find("template.found")[0].innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('{DATA-INDEX}');");
return {
found : found,
@ -354,12 +355,12 @@ $(document).ready(function(){
}
$P.clickParsedInfoList = (dataKey) => {
if(dataKey == ""){
$P.clickParsedInfoList = (dataIndex) => {
if(dataIndex == ""){
return;
}
ctrl.dataset.setCurrent(dataKey);
ctrl.dataset.setCurrent(dataIndex);
};
$P.createCrdn = () => {
@ -393,13 +394,13 @@ $(document).ready(function(){
data : formData,
success : (resp) => {
var removedFileName = $P.tempGroup[firstGroupKey].map(item => item.FILE_NAME);
let removedFileNameArr = $P.tempGroup[firstGroupKey].map(item => item.FILE_NAME);
delete $P.tempGroup[firstGroupKey];
if(resp.saved){
$P.removeCallback(removedFileName);
$P.removeCallback(removedFileNameArr);
if(resp.alertMessage){
alert(resp.alertMessage);
@ -430,31 +431,30 @@ $(document).ready(function(){
},
success : (resp) => {
if(resp.saved){
$P.removeCallback(fileName);
$P.removeCallback([fileName]);
}
}
});
}
$P.removeCallback = (removedFileName) => {
ctrl.dataset.remove(removedFileName);
$P.removeTableRow(removedFileName);
$P.removeCallback = (removedFileNameArr) => {
let removedDataIndexArr = [];
for(var i = 0; i < removedFileNameArr.length; i++){
let dii = ctrl.dataset.getDataset("item").filter(item=>item.data.FILE_NAME == removedFileNameArr[i])[0].index;
removedDataIndexArr.push(dii);
}
ctrl.dataset.remove(removedDataIndexArr);
$P.removeTableRow(removedDataIndexArr);
}
$P.removeTableRow = (removedFileName) => {
$P.removeTableRow = (removedDataIndexArr) => {
var fileListTable = $P.$findn("table-responsive").find("table")[0];
var targetArr = [];
if(Array.isArray(removedFileName)){
targetArr = removedFileName;
} else {
targetArr = [removedFileName];
}
for(var i = 0; i < targetArr.length; i++){
var target = targetArr[i];
var tr = $(fileListTable).find("tbody").find("tr[data-key='"+target+"']");
for(var i = 0; i < removedDataIndexArr.length; i++){
var target = removedDataIndexArr[i];
var tr = $(fileListTable).find("tbody").find("tr[data-index='"+target+"']");
var trIndex = $(fileListTable).find("tbody tr").index(tr);
fileListTable.deleteRow(trIndex+1);
}

@ -30,7 +30,7 @@
</thead>
<tbody name="exmptnVhclTbody"></tbody>
<template is="curly-brackets" name="exmptnVhclRow">
<tr data-key="HSTRY_SN">
<tr data-index="DATA-INDEX">
<td onclick ondblclick class="text-end">HSTRY_SN</td>
<td onclick ondblclick class="text-center">VHRNO</td>
<td onclick ondblclick class="text-start">EXMPTN_RSN</td>

@ -125,9 +125,9 @@
</thead>
<tbody name="vltnTbody"></tbody>
<template is="curly-brackets" name="vltnRow">
<tr data-key="VLTN_CASE_ID">
<tr data-index="DATA-INDEX">
<td class="text-center min-w-px-50 mw-px-50">
<input type="radio" name="levyRadio" value="VLTN_CASE_ID"
<input type="radio" name="levyRadio" value="DATA-INDEX"
onchange />
</td>
<td onclick class="text-center">VLTN_CASE_NM</td>
@ -155,9 +155,9 @@
</thead>
<tbody name="warningTbody"></tbody>
<template is="curly-brackets" name="warningRow">
<tr data-key="LEVY_EXCL_RSN_CD">
<tr data-index="DATA-INDEX">
<td class="text-center min-w-px-50 mw-px-50">
<input type="radio" name="warningRadio" value="LEVY_EXCL_RSN_CD"
<input type="radio" name="warningRadio" value="DATA-INDEX"
onchange />
</td>
<td onclick class="text-center">LEVY_EXCL_RSN_NM</td>
@ -186,9 +186,9 @@
</thead>
<tbody name="nonlevyTbody"></tbody>
<template is="curly-brackets" name="nonlevyRow">
<tr data-key="LEVY_EXCL_RSN_CD">
<tr data-index="DATA-INDEX">
<td class="text-center min-w-px-50 mw-px-50">
<input type="radio" name="nonlevyRadio" value="LEVY_EXCL_RSN_CD"
<input type="radio" name="nonlevyRadio" value="DATA-INDEX"
onchange />
</td>
<td onclick class="text-center">LEVY_EXCL_RSN_NM</td>
@ -372,16 +372,16 @@ $(document).ready(function(){
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){
var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy');
var current = ctrl.levy.getCurrent("item");
$P.clickAnsBodyList(current.index,'levy');
}
if(resp.warningCaseList.length > 0){
var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning');
var current = ctrl.warning.getCurrent("item");
$P.clickAnsBodyList(current.index,'warning');
}
if(resp.nonlevyCaseList.length > 0){
var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy');
var current = ctrl.nonlevy.getCurrent("item");
$P.clickAnsBodyList(current.index,'nonlevy');
}
}
});
@ -416,25 +416,25 @@ $(document).ready(function(){
var replacer = () => {};
if(renderDataType == "levy"){
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('" + dataItem.getValue("VLTN_CASE_ID") + "','levy');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('" + dataItem.getValue("VLTN_CASE_ID") + "','levy');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('{DATA-INDEX}','levy');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('{DATA-INDEX}','levy');");
} else if(renderDataType == "warning"){
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "','warning');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "','warning');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('{DATA-INDEX}','warning');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('{DATA-INDEX}','warning');");
} else if(renderDataType == "nonlevy"){
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "','nonlevy');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "','nonlevy');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickAnsBodyList('{DATA-INDEX}','nonlevy');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickAnsBodyList('{DATA-INDEX}','nonlevy');");
}
var trs = empty ? notFound : ansBodyDS.inStrings(found, replacer);
$P.$findn(tbodyName).html(trs.join());
}
$P.radioClickAnsBodyList = (dataKey, gridType) => {
$P.radioClickAnsBodyList = (dataIndex, gridType) => {
ctrl[gridType].setCurrent(dataKey);
ctrl[gridType].setCurrent(dataIndex);
var tbodyName = "";
if(gridType == "levy"){
@ -446,7 +446,7 @@ $(document).ready(function(){
} else {
return;
}
$P.$findn(tbodyName).setCurrentRow(dataKey);
$P.$findn(tbodyName).setCurrentRow(dataIndex);
if(gridType == "levy" && $P.currentDisplay == "levyAnsBody"){
$P.changeAnsBodyText();
@ -457,7 +457,7 @@ $(document).ready(function(){
}
}
$P.clickAnsBodyList = (dataKey, gridType) => {
$P.clickAnsBodyList = (dataIndex, gridType) => {
var radioName = "";
if(gridType == "levy"){
radioName = "levyRadio";
@ -469,17 +469,17 @@ $(document).ready(function(){
return;
}
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataKey+"']").prop("checked",true);
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataIndex+"']").prop("checked",true);
if(gridType == "levy" && $P.currentDisplay == "levyAnsBody"){
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataKey+"']").focus();
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataIndex+"']").focus();
} else if(gridType == "warning" && $P.currentDisplay == "warningAnsBody"){
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataKey+"']").focus();
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataIndex+"']").focus();
} else if(gridType == "nonlevy" && $P.currentDisplay == "nonlevyAnsBody"){
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataKey+"']").focus();
$P.$findn("wrapper").find(":radio[name='"+radioName+"'][value='"+dataIndex+"']").focus();
}
$P.radioClickAnsBodyList(dataKey, gridType);
$P.radioClickAnsBodyList(dataIndex, gridType);
}
$P.changeAnsBodyText = () => {
@ -530,9 +530,9 @@ $(document).ready(function(){
}
$P.refreshAnsWordsInfo = () => {
var cursor1 = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var cursor2 = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor3 = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor1 = ctrl.levy.getCurrent("item").index;
var cursor2 = ctrl.warning.getCurrent("item").index;
var cursor3 = ctrl.nonlevy.getCurrent("item").index;
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
@ -554,18 +554,18 @@ $(document).ready(function(){
if(resp.levyCaseList.length > 0){
ctrl.levy.setCurrent(cursor1);
var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy');
var current = ctrl.levy.getCurrent("item");
$P.clickAnsBodyList(current.index,'levy');
}
if(resp.warningCaseList.length > 0){
ctrl.warning.setCurrent(cursor2);
var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning');
var current = ctrl.warning.getCurrent("item");
$P.clickAnsBodyList(current.index,'warning');
}
if(resp.nonlevyCaseList.length > 0){
ctrl.nonlevy.setCurrent(cursor3);
var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy');
var current = ctrl.nonlevy.getCurrent("item");
$P.clickAnsBodyList(current.index,'nonlevy');
}
}
});

@ -48,9 +48,9 @@
</thead>
<tbody name="warningWordsTbody"></tbody>
<template is="curly-brackets" name="warningWordsRow">
<tr data-key="LEVY_EXCL_RSN_CD">
<tr data-index="DATA-INDEX">
<td class="text-center min-w-px-50 mw-px-50">
<input type="radio" name="gridRadio" value="LEVY_EXCL_RSN_CD"
<input type="radio" name="gridRadio" value="DATA-INDEX"
onchange />
</td>
<td onclick class="text-center">LEVY_EXCL_RSN_NM</td>
@ -179,8 +179,8 @@ $(document).ready(function(){
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current);
var current = ctrl.dataset.getCurrent("item");
$P.clickWarningWordsList(current.index);
}
}
});
@ -194,29 +194,29 @@ $(document).ready(function(){
var found = $P.findn("warningWordsRow").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickWarningWordsList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickWarningWordsList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickWarningWordsList('{DATA-INDEX}');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickWarningWordsList('{DATA-INDEX}');");
var trs = empty ? notFound : warningWordsDS.inStrings(found, replacer);
$P.$findn("warningWordsTbody").html(trs.join());
}
$P.radioClickWarningWordsList = (dataKey, gridType) => {
$P.radioClickWarningWordsList = (dataIndex, gridType) => {
ctrl.dataset.setCurrent(dataKey);
ctrl.dataset.setCurrent(dataIndex);
$P.$findn("warningWordsTbody").setCurrentRow(dataKey);
$P.$findn("warningWordsTbody").setCurrentRow(dataIndex);
$P.changeTextarea();
}
$P.clickWarningWordsList = (dataKey, gridType) => {
$P.clickWarningWordsList = (dataIndex, gridType) => {
$P.$findn("wrapper").find(":radio[name='gridRadio'][value='"+dataKey+"']").prop("checked",true);
$P.$findn("wrapper").find(":radio[name='gridRadio'][value='"+dataKey+"']").focus();
$P.$findn("wrapper").find(":radio[name='gridRadio'][value='"+dataIndex+"']").prop("checked",true);
$P.$findn("wrapper").find(":radio[name='gridRadio'][value='"+dataIndex+"']").focus();
$P.radioClickWarningWordsList(dataKey, gridType);
$P.radioClickWarningWordsList(dataIndex, gridType);
}
$P.changeTextarea = () => {
@ -252,8 +252,8 @@ $(document).ready(function(){
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
ctrl.dataset.setCurrent(cursor);
var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current,'warning');
var current = ctrl.dataset.getCurrent("item");
$P.clickWarningWordsList(current.index,'warning');
}
}

@ -1,7 +1,7 @@
function newCrdn05020Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"],
keymapper : info => info ? info.FILE_NAME : "",
keys : ["FILE_NAME"],
urls : { },
formats: {
CRDN_YMD : dateFormat,

@ -1,7 +1,8 @@
function newCrdn08030Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj, appendData:false,
keymapper : info => info ? info.HSTRY_SN : "",
dataGetter : obj => obj,
appendData:false,
keys : ["HSTRY_SN"],
urls : { },
formats: {
EXMPTN_BGNG_YMD : dateFormat,

@ -1,16 +1,22 @@
function newCvlc05010Control(page, doctx = ""){
page.ctrl = new AnswerBodyControl({
dataGetter : obj => obj["levyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.VLTN_CASE_ID : ""
dataGetter : obj => obj["levyCaseList"],
urls : {},
formats : {},
keys : ["VLTN_CASE_ID"]
},
{
dataGetter : obj => obj["warningCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
dataGetter : obj => obj["warningCaseList"],
urls : {},
formats : {},
keys : ["LEVY_EXCL_RSN_CD"]
},
{
dataGetter : obj => obj["nonlevyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
dataGetter : obj => obj["nonlevyCaseList"],
urls : {},
formats : {},
keys : ["LEVY_EXCL_RSN_CD"]
});
return page.ctrl;
}

@ -1,7 +1,7 @@
function newCvlc06010Control(page, doctx = ""){
page.ctrl = new DatasetControl({
dataGetter : obj => obj["List"],
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : "",
keys : ["LEVY_EXCL_RSN_CD"],
urls : {},
formats : {}
});

Loading…
Cancel
Save