레이아웃관리 - 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();
const itemTypes = ['Field', 'Grid', 'Group', 'Attr'];
const itemTypes = ['Field', 'Grid', 'Group', 'Attr', 'Array'];
columns = [ // for columnData prop
{ 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_GRID = "Grid";
const LAYOUT_ITEM_TYPE_FIELD = "Field";
const LAYOUT_ITEM_TYPE_ARRAY = "Array";
var isDetail = false;
@@ -550,6 +551,14 @@
return data;
}
// 항목 자신이 Array인 경우, 경로/변환명령 끝에 반복 표시 [*]를 추가
function addArrayTag(loutItemType, data) {
if (loutItemType == LAYOUT_ITEM_TYPE_ARRAY && !data.endsWith("[*]")) {
data = data + "[*]";
}
return data;
}
//변환명에 있는 서비스코드와 if서비스 코드 매칭
function validation(){
if ($('input[name=cnvsnName]').val() == '') {
@@ -889,10 +898,10 @@
let selectValue = "";
let targetValue = "";
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);
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);
if (targetValue == selectValue ) {
var data = sourceData[i]['LOUTITEMPATH'];
@@ -916,8 +925,8 @@
//field, ATTR 여부 판단
var sourceRow = sourceGrid.getRowData( srcRowId );
var targetRow = targetGrid.getRowData( tgtRowId );
if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr') &&
(targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr') ){
if ( (sourceRow["loutItemType"] == 'Field' || sourceRow["loutItemType"] == 'Attr' || sourceRow["loutItemType"] == 'Array') &&
(targetRow["loutItemType"] == 'Field' || targetRow["loutItemType"] == 'Attr' || targetRow["loutItemType"] == 'Array') ){
;
}else{
alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
@@ -936,15 +945,15 @@
var targetValue = "";
var j=tgtIndex-1-1;
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++;
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++;
}
if (targetData.length -1 < j) break;
var targetRowId = targetData[j]['id'];
targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH']));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH']));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNCMDNAME',addArrayTag(sourceData[i]['loutItemType'], addGroupTag(srcGroup,sourceData[i]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNRSULTITEMPATHNAME',addArrayTag(targetData[j]['loutItemType'], addGroupTag(tgtGroup,targetData[j]['LOUTITEMPATH'])));
targetGrid.jqGrid('setCell',targetRowId,'CNVSNITEMSERNO',targetData[j]['loutItemSerno']);
const sourceEndpointElementId = sourceGrid.getEndpointElementId(sourceData[i]['id']);
@@ -1015,7 +1024,7 @@
var targetData = targetGrid.getRowData();
var gridData = new Array();
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;
}
if (targetData[i]['CNVSNCMDNAME']==null
@@ -1158,7 +1167,7 @@
function srcformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"];
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;' />";
}else{
return "<div id='div_srcgroup_"+rowId+"' name='srcgroup_"+rowId+"' style='width:28px;height:17px;' />";
@@ -1170,7 +1179,7 @@
function tgtformatterFunction(cellvalue,options,rowObject){
var rowId = options["rowId"];
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;' >"
+ "<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>";
@@ -1669,8 +1678,8 @@
return;
}
if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr')
|| (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr')) {
if ((sourceRow["loutItemType"] != 'Field' && sourceRow["loutItemType"] != 'Attr' && sourceRow["loutItemType"] != 'Array')
|| (targetRow["loutItemType"] != 'Field' && targetRow["loutItemType"] != 'Attr' && targetRow["loutItemType"] != 'Array')) {
alert('<%=localeMessage.getString("transformManDetail.alert3")%>');
return ;
}
@@ -1684,7 +1693,7 @@
if (targetRow['CNVSNCMDNAME'] == '') {
// 변환 명령 값이 한번 설정 되면 변경 되지 않게 함.
var cnvsnCmdName = addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]);
var cnvsnCmdName = addArrayTag(sourceRow["loutItemType"], addGroupTag(srcGroup,sourceRow["LOUTITEMPATH"]));
// function까지 처리되도록 수정했으나, parameter가 하나인 경우에만 정상처리됨
if($('#functionCombo').val() != "") {
cnvsnCmdName = $('#functionCombo').val() + "(" + cnvsnCmdName + ")";
@@ -1693,7 +1702,7 @@
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,'CNVSNSRCITEMS', cnvsnSrcItems);
targetGrid.jqGrid('setCell',tgtRowId,'ISVALIDMAPPING', true);
@@ -1885,8 +1894,8 @@
if (loutItemType == LAYOUT_ITEM_TYPE_GRID || loutItemType == LAYOUT_ITEM_TYPE_GROUP) {
// group 인 경우
items = createGridGroupContextMenuItems(grid, rowId);
} else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD) {
// field 인 경우
} else if(loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
// field, array 인 경우
items = createFieldContextMenuItems(grid, positionElement.attr('id'));
} else {
return false;
@@ -1989,7 +1998,7 @@
break;
}
if (loutItemType == LAYOUT_ITEM_TYPE_FIELD) {
if (loutItemType == LAYOUT_ITEM_TYPE_FIELD || loutItemType == LAYOUT_ITEM_TYPE_ARRAY) {
loutItemPath = loutItemPath.replace(new RegExp("^" + prefix), "");
console.debug(grid.getId() + " : loutItemPath : " + loutItemPath);
rowData['GROUP_LOUTITEMPATH'] = loutItemPath;