This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -352,7 +352,7 @@ public class LayoutManService extends OnlBaseService {
|
||||
}
|
||||
|
||||
if (max == 0 && min == 0) {
|
||||
if ("GRID".equalsIgnoreCase(loutItemType)) {
|
||||
if ("GRID".equalsIgnoreCase(loutItemType) || "ARRAY".equalsIgnoreCase(loutItemType)) {
|
||||
min = 1;
|
||||
max = -1;
|
||||
} else {
|
||||
@@ -371,7 +371,8 @@ public class LayoutManService extends OnlBaseService {
|
||||
}
|
||||
|
||||
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 String.valueOf(layoutItemUI.getLoutItemOccCnt());
|
||||
@@ -385,6 +386,8 @@ public class LayoutManService extends OnlBaseService {
|
||||
node = Item.NODE_GROUP;
|
||||
} else if ("ATTR".equalsIgnoreCase(el.getLoutItemType())) {
|
||||
node = Item.NODE_ATTR;
|
||||
} else if ("ARRAY".equalsIgnoreCase(el.getLoutItemType())) {
|
||||
node = Item.NODE_FIELD;
|
||||
} else {
|
||||
node = Item.NODE_FIELD;
|
||||
}
|
||||
|
||||
+26
-6
@@ -71,13 +71,33 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
|
||||
itemType = isGridCondition ? "GRID" : "GROUP";
|
||||
|
||||
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
|
||||
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())
|
||||
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
|
||||
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) {
|
||||
itemLoopCount = item.getLoutitemoccurptrndstcd();
|
||||
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
|
||||
if ("*".equals(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 {
|
||||
// 아이템 노드 타입이 GROUP이 아닌 경우, 해당 노드 타입으로 itemType 설정
|
||||
// 아이템 노드 타입이 GROUP/FIELD가 아닌 경우, 해당 노드 타입으로 itemType 설정
|
||||
itemType = ItemNodeType.fromNumber(item.getLoutitemnodeptrnidname()).toString();
|
||||
}
|
||||
|
||||
@@ -85,7 +105,7 @@ public interface LayoutItemUIMapper extends GenericMapper<LayoutItemUI, LayoutIt
|
||||
|
||||
itemUi.setLoutItemType(itemType);
|
||||
|
||||
if(NumberUtils.toInt(itemLoopCount) == 0){
|
||||
if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
|
||||
itemLoopCount = "";
|
||||
}
|
||||
itemUi.setLoutItemOccCnt(itemLoopCount);
|
||||
|
||||
+25
-5
@@ -71,10 +71,30 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
|
||||
itemType = isGridCondition ? "GRID" : "GROUP";
|
||||
|
||||
// isGridCondition이 참이고, 참조 정보2가 비어 있는 경우, itemLoopCount 설정
|
||||
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())
|
||||
&& NumberUtils.isCreatable(item.getLoutitemoccurptrndstcd())
|
||||
&& Integer.parseInt(item.getLoutitemoccurptrndstcd()) > -1 ) {
|
||||
itemLoopCount = item.getLoutitemoccurptrndstcd();
|
||||
if (isGridCondition && StringUtils.isBlank(item.getLoutitemrefinfo2())) {
|
||||
if ("*".equals(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 {
|
||||
// 아이템 노드 타입이 GROUP이 아닌 경우, 해당 노드 타입으로 itemType 설정
|
||||
@@ -85,7 +105,7 @@ public interface LayoutPopupUIMapper extends GenericMapper<LayoutPopupUI, Layout
|
||||
|
||||
popupUI.setLoutItemType(itemType);
|
||||
|
||||
if(NumberUtils.toInt(itemLoopCount) == 0){
|
||||
if (!"*".equals(itemLoopCount) && NumberUtils.toInt(itemLoopCount) == 0) {
|
||||
itemLoopCount = "";
|
||||
}
|
||||
popupUI.setLoutItemOccCnt(itemLoopCount);
|
||||
|
||||
Reference in New Issue
Block a user