레이아웃관리 - Array 아이템유형 추가
eapim-admin CI / build (push) Has been cancelled

This commit is contained in:
eastargh
2026-07-06 11:25:16 +09:00
parent f23cb02b1c
commit 142d402bad
5 changed files with 84 additions and 32 deletions
@@ -71,7 +71,7 @@
$('#grid').children().remove(); $('#grid').children().remove();
const itemTypes = ['Field', 'Grid', 'Group', 'Attr']; const itemTypes = ['Field', 'Grid', 'Group', 'Attr', 'Array'];
columns = [ // for columnData prop columns = [ // for columnData prop
{ title: '<%= localeMessage.getString("layoutMan.itmeEn") %>', name: 'loutItemName', type: 'text', width:280, resize:true, minWidth:120 }, { title: '<%= localeMessage.getString("layoutMan.itmeEn") %>', name: 'loutItemName', type: 'text', width:280, resize:true, minWidth:120 },
@@ -54,6 +54,7 @@
const LAYOUT_ITEM_TYPE_GROUP = "Group"; const LAYOUT_ITEM_TYPE_GROUP = "Group";
const LAYOUT_ITEM_TYPE_GRID = "Grid"; const LAYOUT_ITEM_TYPE_GRID = "Grid";
const LAYOUT_ITEM_TYPE_FIELD = "Field"; const LAYOUT_ITEM_TYPE_FIELD = "Field";
const LAYOUT_ITEM_TYPE_ARRAY = "Array";
var isDetail = false; var isDetail = false;
@@ -550,6 +551,14 @@
return data; return data;
} }
// 항목 자신이 Array인 경우, 경로/변환명령 끝에 반복 표시 [*]를 추가
function addArrayTag(loutItemType, data) {
if (loutItemType == LAYOUT_ITEM_TYPE_ARRAY && !data.endsWith("[*]")) {
data = data + "[*]";
}
return data;
}
//변환명에 있는 서비스코드와 if서비스 코드 매칭 //변환명에 있는 서비스코드와 if서비스 코드 매칭
function validation(){ function validation(){
if ($('input[name=cnvsnName]').val() == '') { if ($('input[name=cnvsnName]').val() == '') {
@@ -889,10 +898,10 @@
let selectValue = ""; let selectValue = "";
let targetValue = ""; let targetValue = "";
for ( var i = 0; i < sourceData.length; i++) { for ( var i = 0; i < sourceData.length; i++) {
if (sourceData[i]['loutItemType'] != "Field" && sourceData[i]['loutItemType'] != "Attr") continue; if (sourceData[i]['loutItemType'] != "Field" && sourceData[i]['loutItemType'] != "Attr" && sourceData[i]['loutItemType'] != "Array") continue;
selectValue = (sourceData[i]['LOUTITEMPATH']).substr(sourceData[i]['loutName'].length+1); selectValue = (sourceData[i]['LOUTITEMPATH']).substr(sourceData[i]['loutName'].length+1);
for (var j = 0; j <targetData.length; j++) { for (var j = 0; j <targetData.length; j++) {
if (targetData[j]['loutItemType'] != "Field" && targetData[j]['loutItemType'] != "Attr") continue; if (targetData[j]['loutItemType'] != "Field" && targetData[j]['loutItemType'] != "Attr" && targetData[j]['loutItemType'] != "Array") continue;
targetValue = (targetData[j]['LOUTITEMPATH']).substr(targetData[j]['loutName'].length+1); targetValue = (targetData[j]['LOUTITEMPATH']).substr(targetData[j]['loutName'].length+1);
if (targetValue == selectValue ) { if (targetValue == selectValue ) {
var data = sourceData[i]['LOUTITEMPATH']; var data = sourceData[i]['LOUTITEMPATH'];
@@ -916,8 +925,8 @@
//field, ATTR 여부 판단 //field, ATTR 여부 판단
var sourceRow = sourceGrid.getRowData( srcRowId ); var sourceRow = sourceGrid.getRowData( srcRowId );
var targetRow = targetGrid.getRowData( tgtRowId ); var targetRow = targetGrid.getRowData( tgtRowId );
if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr') && if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr' || sourceRow["loutItemType"] == 'Array') &&
(targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr') ){ (targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr' || targetRow["loutItemType"] == 'Array') ){
; ;
}else{ }else{
alert('<%=localeMessage.getString("transformManDetail.alert3")%>'); alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
@@ -936,15 +945,15 @@
var targetValue = ""; var targetValue = "";
var j=tgtIndex-1-1; var j=tgtIndex-1-1;
for ( var i = srcIndex-1; i < sourceData.length; i++) { for ( var i = srcIndex-1; i < sourceData.length; i++) {
if (sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_FIELD) continue; if (sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_FIELD && sourceData[i]['loutItemType'] != LAYOUT_ITEM_TYPE_ARRAY) continue;
j++; j++;
while (targetData.length -1 >= j &&targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_FIELD){ while (targetData.length -1 >= j && targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_FIELD && targetData[j]["loutItemType"] != LAYOUT_ITEM_TYPE_ARRAY){
j++; j++;
} }
if (targetData.length -1 < j) break; if (targetData.length -1 < j) break;
var targetRowId = targetData[j]['id']; var targetRowId = targetData[j]['id'];
targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH'])); targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addArrayTag(sourceData[i]['loutItemType'], addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH'])); targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addArrayTag(targetData[j]['loutItemType'], addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNITEMSERNO',targetData[j]['loutItemSerno']); targetGrid.jqGrid('setCell',targetRowId,'CNVSNITEMSERNO',targetData[j]['loutItemSerno']);
const sourceEndpointElementId = sourceGrid.getEndpointElementId(sourceData[i]['id']); const sourceEndpointElementId = sourceGrid.getEndpointElementId(sourceData[i]['id']);
@@ -1015,7 +1024,7 @@
var targetData = targetGrid.getRowData(); var targetData = targetGrid.getRowData();
var gridData = new Array(); var gridData = new Array();
for (var i = 0; i <targetData.length; i++) { for (var i = 0; i <targetData.length; i++) {
if ((targetData[i]['loutItemType'] != "Field") && (targetData[i]['loutItemType'] != "Attr")) { if ((targetData[i]['loutItemType'] != "Field") && (targetData[i]['loutItemType'] != "Attr") && (targetData[i]['loutItemType'] != "Array")) {
continue; continue;
} }
if (targetData[i]['CNVSNCMDNAME']==null if (targetData[i]['CNVSNCMDNAME']==null
@@ -1158,7 +1167,7 @@
function srcformatterFunction(cellvalue,options,rowObject){ function srcformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"]; var rowId = options["rowId"];
var loutItemType = rowObject["loutItemType"]; var loutItemType = rowObject["loutItemType"];
if (loutItemType == 'Field' || loutItemType == 'Attr'){ if (loutItemType == 'Field' || loutItemType == 'Attr' || loutItemType == 'Array'){
return "<div id='div_src_"+rowId+"' name='src_"+rowId+"' style='width:28px;height:17px;background-color: #D12F35; border-color: #ab1717; border-style: solid; border-width: 1px; border-radius: 3px;' />"; return "<div id='div_src_"+rowId+"' name='src_"+rowId+"' style='width:28px;height:17px;background-color: #D12F35; border-color: #ab1717; border-style: solid; border-width: 1px; border-radius: 3px;' />";
}else{ }else{
return "<div id='div_srcgroup_"+rowId+"' name='srcgroup_"+rowId+"' style='width:28px;height:17px;' />"; return "<div id='div_srcgroup_"+rowId+"' name='srcgroup_"+rowId+"' style='width:28px;height:17px;' />";
@@ -1170,7 +1179,7 @@
function tgtformatterFunction(cellvalue,options,rowObject){ function tgtformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"]; var rowId = options["rowId"];
var loutItemType = rowObject["loutItemType"]; var loutItemType = rowObject["loutItemType"];
if (loutItemType == 'Field' || loutItemType == 'Attr'){ if (loutItemType == 'Field' || loutItemType == 'Attr' || loutItemType == 'Array'){
return "<div id='div_tgt_"+rowId+"_base' name='div_tgt_"+rowId+"_base' style='width:30px;height:20px; background-color:gray;' >" return "<div id='div_tgt_"+rowId+"_base' name='div_tgt_"+rowId+"_base' style='width:30px;height:20px; background-color:gray;' >"
+ "<div id='div_tgt_"+rowId+"' name='tgt_"+rowId+"' style='width:28px;height:17px; background-color: #3E7E9C; border-color: #217ca7; border-style: solid; border-width: 1px; border-radius: 3px;' onclick='jqGridOnTargetGridEndpointClick(this)'>" + "<div id='div_tgt_"+rowId+"' name='tgt_"+rowId+"' style='width:28px;height:17px; background-color: #3E7E9C; border-color: #217ca7; border-style: solid; border-width: 1px; border-radius: 3px;' onclick='jqGridOnTargetGridEndpointClick(this)'>"
+ "</div></div>"; + "</div></div>";
@@ -1669,8 +1678,8 @@
return; return;
} }
if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr') if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr' && sourceRow["loutItemType"] != 'Array')
|| (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr')) { || (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr' && targetRow["loutItemType"] != 'Array')) {
alert('<%=localeMessage.getString("transformManDetail.alert3")%>'); alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
return ; return ;
} }
@@ -1684,7 +1693,7 @@
if (targetRow['CNVSNCMDNAME'] == '') { if (targetRow['CNVSNCMDNAME'] == '') {
// 변환 명령 값이 한번 설정 되면 변경 되지 않게 함. // 변환 명령 값이 한번 설정 되면 변경 되지 않게 함.
var cnvsnCmdName = addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]); var cnvsnCmdName = addArrayTag(sourceRow["loutItemType"], addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]));
// function까지 처리되도록 수정했으나, parameter가 하나인 경우에만 정상처리됨 // function까지 처리되도록 수정했으나, parameter가 하나인 경우에만 정상처리됨
if($('#functionCombo').val() != "") { if($('#functionCombo').val() != "") {
cnvsnCmdName = $('#functionCombo').val() + "(" + cnvsnCmdName + ")"; cnvsnCmdName = $('#functionCombo').val() + "(" + cnvsnCmdName + ")";
@@ -1693,7 +1702,7 @@
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNCMDNAME', cnvsnCmdName); targetGrid.jqGrid('setCell',tgtRowId,'CNVSNCMDNAME', cnvsnCmdName);
} }
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNRSULTITEMPATHNAME',addGroupTag(tgtGroup,targetRow["LOUTITEMPATH"])); targetGrid.jqGrid('setCell',tgtRowId,'CNVSNRSULTITEMPATHNAME',addArrayTag(targetRow["loutItemType"], addGroupTag(tgtGroup,targetRow["LOUTITEMPATH"])));
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNITEMSERNO',targetRow['loutItemSerno']); targetGrid.jqGrid('setCell',tgtRowId,'CNVSNITEMSERNO',targetRow['loutItemSerno']);
targetGrid.jqGrid('setCell',tgtRowId,'CNVSNSRCITEMS', cnvsnSrcItems); targetGrid.jqGrid('setCell',tgtRowId,'CNVSNSRCITEMS', cnvsnSrcItems);
targetGrid.jqGrid('setCell',tgtRowId,'ISVALIDMAPPING', true); targetGrid.jqGrid('setCell',tgtRowId,'ISVALIDMAPPING', true);
@@ -1885,8 +1894,8 @@
if (loutItemType == LAYOUT_ITEM_TYPE_GRID || loutItemType == LAYOUT_ITEM_TYPE_GROUP) { if (loutItemType == LAYOUT_ITEM_TYPE_GRID || loutItemType == LAYOUT_ITEM_TYPE_GROUP) {
// group 인 경우 // group 인 경우
items = createGridGroupContextMenuItems(grid, rowId); items = createGridGroupContextMenuItems(grid, rowId);
} else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD) { } else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
// field 인 경우 // field, array 인 경우
items = createFieldContextMenuItems(grid, positionElement.attr('id')); items = createFieldContextMenuItems(grid, positionElement.attr('id'));
} else { } else {
return false; return false;
@@ -1989,7 +1998,7 @@
break; break;
} }
if (loutItemType == LAYOUT_ITEM_TYPE_FIELD) { if (loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
loutItemPath = loutItemPath.replace(new RegExp("^" + prefix), ""); loutItemPath = loutItemPath.replace(new RegExp("^" + prefix), "");
console.debug(grid.getId() + " : loutItemPath : " + loutItemPath); console.debug(grid.getId() + " : loutItemPath : " + loutItemPath);
rowData['GROUP_LOUTITEMPATH'] = loutItemPath; rowData['GROUP_LOUTITEMPATH'] = loutItemPath;
@@ -352,7 +352,7 @@ public class LayoutManService extends OnlBaseService {
} }
if (max == 0 && min == 0) { if (max == 0 && min == 0) {
if ("GRID".equalsIgnoreCase(loutItemType)) { if ("GRID".equalsIgnoreCase(loutItemType) || "ARRAY".equalsIgnoreCase(loutItemType)) {
min = 1; min = 1;
max = -1; max = -1;
} else { } else {
@@ -371,7 +371,8 @@ public class LayoutManService extends OnlBaseService {
} }
private String determineOccurNoItem(LayoutItemUI layoutItemUI, String loutItemType) { private String determineOccurNoItem(LayoutItemUI layoutItemUI, String loutItemType) {
if ("GRID".equalsIgnoreCase(loutItemType) && NumberUtils.toInt(layoutItemUI.getLoutItemOccCnt()) == 0) { if (("GRID".equalsIgnoreCase(loutItemType) || "ARRAY".equalsIgnoreCase(loutItemType))
&& NumberUtils.toInt(layoutItemUI.getLoutItemOccCnt()) == 0) {
return "*"; return "*";
} }
return String.valueOf(layoutItemUI.getLoutItemOccCnt()); return String.valueOf(layoutItemUI.getLoutItemOccCnt());
@@ -385,6 +386,8 @@ public class LayoutManService extends OnlBaseService {
node = Item.NODE_GROUP; node = Item.NODE_GROUP;
} else if ("ATTR".equalsIgnoreCase(el.getLoutItemType())) { } else if ("ATTR".equalsIgnoreCase(el.getLoutItemType())) {
node = Item.NODE_ATTR; node = Item.NODE_ATTR;
} else if ("ARRAY".equalsIgnoreCase(el.getLoutItemType())) {
node = Item.NODE_FIELD;
} else { } else {
node = Item.NODE_FIELD; node = Item.NODE_FIELD;
} }
@@ -71,13 +71,33 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
itemType = isGridCondition ? "GRID" : "GROUP"; itemType = isGridCondition ? "GRID" : "GROUP";
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정 // isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2()) if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd()) if ("*".equals(item.getLoutitemoccurptrndstcd())) {
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) { // 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = item.getLoutitemoccurptrndstcd(); itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else if (ItemNodeType.FIELD.getNumber() == item.getLoutitemnodeptrnidname()) {
// 아이템 발생 포인터 명이 '*'이거나 숫자로 생성 가능한 경우
boolean isArrayCondition = "*".equals(item.getLoutitemoccurptrndstcd()) || NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd());
// itemType을 ARRAY 또는 FIELD 로 설정
itemType = isArrayCondition ? "ARRAY" : "FIELD";
// isArrayCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isArrayCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
} }
} else { } else {
// 아이템 노드 타입이 GROUP 아닌 경우, 해당 노드 타입으로 itemType 설정 // 아이템 노드 타입이 GROUP/FIELD가 아닌 경우, 해당 노드 타입으로 itemType 설정
itemType = ItemNodeType.fromNumber(item.getLoutitemnodeptrnidname()).toString(); itemType = ItemNodeType.fromNumber(item.getLoutitemnodeptrnidname()).toString();
} }
@@ -85,7 +105,7 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
itemUi.setLoutItemType(itemType); itemUi.setLoutItemType(itemType);
if(NumberUtils.toInt(itemLoopCount) == 0){ if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
itemLoopCount = ""; itemLoopCount = "";
} }
itemUi.setLoutItemOccCnt(itemLoopCount); itemUi.setLoutItemOccCnt(itemLoopCount);
@@ -71,10 +71,30 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
itemType = isGridCondition ? "GRID" : "GROUP"; itemType = isGridCondition ? "GRID" : "GROUP";
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정 // isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2()) if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd()) if ("*".equals(item.getLoutitemoccurptrndstcd())) {
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) { // 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = item.getLoutitemoccurptrndstcd(); itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
}
} else if (ItemNodeType.FIELD.getNumber() == item.getLoutitemnodeptrnidname()) {
// 아이템 발생 포인터 명이 '*'이거나 숫자로 생성 가능한 경우
boolean isArrayCondition = "*".equals(item.getLoutitemoccurptrndstcd()) || NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd());
// itemType을 ARRAY 또는 FIELD 로 설정
itemType = isArrayCondition ? "ARRAY" : "FIELD";
// isArrayCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
if (isArrayCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
if ("*".equals(item.getLoutitemoccurptrndstcd())) {
// 반복횟수로 '*'(무제한)이 저장된 경우, 화면 그리드에도 '*'을 그대로 표시
itemLoopCount = "*";
} else if (NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1) {
itemLoopCount = item.getLoutitemoccurptrndstcd();
}
} }
} else { } else {
// 아이템 노드 타입이 GROUP이 아닌 경우, 해당 노드 타입으로 itemType 설정 // 아이템 노드 타입이 GROUP이 아닌 경우, 해당 노드 타입으로 itemType 설정
@@ -85,7 +105,7 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
popupUI.setLoutItemType(itemType); popupUI.setLoutItemType(itemType);
if(NumberUtils.toInt(itemLoopCount) == 0){ if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
itemLoopCount = ""; itemLoopCount = "";
} }
popupUI.setLoutItemOccCnt(itemLoopCount); popupUI.setLoutItemOccCnt(itemLoopCount);