bin2107 5 лет назад
Родитель
Сommit
637ef3a116

+ 3 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaRenderer.xml

@@ -26,6 +26,9 @@
 		/* TsaRenderer.getCommonCodeList */
 		SELECT CD
 		     , CD_NM
+		<if test="cdGb != null and cdGb != '' and cdGb == 'G028'">
+		     , CD_DESC
+		</if>
 		FROM   TB_COMMON_CODE
 		WHERE  1 = 1
 		<if test="useYn != null and useYn != ''">

+ 39 - 21
src/main/webapp/WEB-INF/views/display/MainListForm.html

@@ -279,16 +279,18 @@
 			html += '<div><span style="font-weight:bold">'+result[i].contentsLoc+'</span></div><div><span>[ '+gagaAgGrid.lookupValue(contentsLocArr, result[i].contentsLoc)+' ]</span></div>';
 			html += '<input type="text" class="w200" name="contentsTitle" placeholder="메인타이틀" value="'+result[i].contentsTitle+'"/>';
 			html += '<br/>';
-			if(result[i].contentsYn=='C'){
+			if(result[i].contentsYn=='C' || result[i].contentsYn=='A'){
 				html += '<button type="button" class="btn btn-success btn-lg" onclick="fnChangeContents(this);">수정</button>';
 				html += '<button type="button" class="btn btn-default btn-lg" onclick="fnUpdateContents(\''+result[i].contentsLoc+'\');">적용</button>';
-			}else if(result[i].contentsYn=='G' || result[i].contentsYn=='A'){
-				if(result[i].contentsYn=='A'){
-					html += '<button type="button" class="btn btn-success btn-lg" onclick="fnChangeContents(this);">수정</button>';
-					html += '<button type="button" class="btn btn-default btn-lg" onclick="fnUpdateContents(\''+result[i].contentsLoc+'\');">적용</button>';
-					html += '<br/>';
-				}
+			}else if(result[i].contentsYn=='G'){
+				// if(result[i].contentsYn=='A'){
+				// 	html += '<button type="button" class="btn btn-success btn-lg" onclick="fnChangeContents(this);">수정</button>';
+				// 	html += '<button type="button" class="btn btn-default btn-lg" onclick="fnUpdateContents(\''+result[i].contentsLoc+'\');">적용</button>';
+				// 	html += '<br/>';
+				// }
 					html += '<button type="button" class="btn btn-success btn-lg" onclick="fnSearchCategory(\''+result[i].contentsLoc+'\');">상품관리</button>';
+			}else{
+				html += '<li>위치설정</li>';
 			}
 			html += '<input type="hidden" name="contentsLoc" value="'+result[i].contentsLoc+'"/>';
 			html += '<input type="hidden" name="colCnt" value="'+result[i].colCnt+'"/>';
@@ -373,9 +375,24 @@
 		//uifnFitGrid();
 	}
 
+	var fnTest = function (obj,idx){
+		var $obj = $(obj);
+		var index = $("#contentsBox"+idx+" option").index($("#contentsBox"+idx+" option:selected"));
+		var contentsType = $("#contentsBox"+idx+" option:eq("+index+")").attr('data-idx');
+		console.log(index);
+		console.log(contentsType);
+		// var dataSelect = document.getElementsByName("contentsLocEdit");
+		// var value = dataSelect.options[document.getElementsByName("contentsLocEdit").selectedIndex].value;
+		// $("select[name=contentsLocEdit]").val();
+		console.log($(obj).val());
+		// $("#id").val("1").prop("selected", true);
+		$("#contentsYn"+idx).val(contentsType).prop('selected',true);
+	}
+
 	/**
 	* 레이아웃 행추가 버튼
 	*/
+	let contentsIdx = 0;
 	$("#btnAddRow").on("click", function (){
 		var val = $("#searchForm select[name=cate1No]").val();
 		var cate1No = val.split(',')[0];
@@ -408,17 +425,17 @@
 		});
 
 		if(cate1No=='1700'){
-			contentsLocHtml += '<option value="SGNB001">[SGNB001] STYLE24MALL > GNB > TOP배너</option>';
-			contentsLocHtml += '<option value="SGNB002">[SGNB002] STYLE24MALL > GNB > TOP배너(모바일)</option>';
-			contentsLocHtml += '<option value="STAB001">[STAB001] STYLE24MALL > GNB > 브랜드</option>';
-			contentsLocHtml += '<option value="STAB002">[STAB002] STYLE24MALL > GNB > 카테고리</option>';
-			contentsLocHtml += '<option value="SKEY001">[SKEY001] STYLE24MALL > GNB > 검색어</option>';
+			contentsLocHtml += '<option value="SGNB001" data-idx="C">[SGNB001] STYLE24MALL > GNB > TOP배너</option>';
+			contentsLocHtml += '<option value="SGNB002" data-idx="C">[SGNB002] STYLE24MALL > GNB > TOP배너(모바일)</option>';
+			contentsLocHtml += '<option value="STAB001" data-idx="C">[STAB001] STYLE24MALL > GNB > 브랜드</option>';
+			contentsLocHtml += '<option value="STAB002" data-idx="C">[STAB002] STYLE24MALL > GNB > 카테고리</option>';
+			contentsLocHtml += '<option value="SKEY001" data-idx="C">[SKEY001] STYLE24MALL > GNB > 검색어</option>';
 		}
 		if(cate1No=='1720'){
-			contentsLocHtml += '<option value="SGNB002">[SGNB002] STYLE24MALL > GNB > TOP배너(모바일)</option>';
-			contentsLocHtml += '<option value="STAB001">[STAB001] STYLE24MALL > GNB > 브랜드</option>';
-			contentsLocHtml += '<option value="STAB002">[STAB002] STYLE24MALL > GNB > 카테고리</option>';
-			contentsLocHtml += '<option value="SKEY001">[SKEY001] STYLE24MALL > GNB > 검색어</option>';
+			contentsLocHtml += '<option value="SGNB002" data-idx="C">[SGNB002] STYLE24MALL > GNB > TOP배너(모바일)</option>';
+			contentsLocHtml += '<option value="STAB001" data-idx="C">[STAB001] STYLE24MALL > GNB > 브랜드</option>';
+			contentsLocHtml += '<option value="STAB002" data-idx="C">[STAB002] STYLE24MALL > GNB > 카테고리</option>';
+			contentsLocHtml += '<option value="SKEY001" data-idx="C">[SKEY001] STYLE24MALL > GNB > 검색어</option>';
 		}
 		for(var i=0; i<contentsLocList.length; i++){
 			var contentsLocCd = contentsLocList[i].cd;
@@ -426,14 +443,14 @@
 			if(contentsLocCd==clocPrefix){
 				if(cate1No=='1700'){
 					if(contentsLocList[i].cd != 'SMM012'){
-						contentsLocHtml += '<option value="'+contentsLocList[i].cd+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
+						contentsLocHtml += '<option value="'+contentsLocList[i].cd+'" data-idx="'+contentsLocList[i].cdDesc+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
 					}
 				}else if(cate1No=='1720'){
 					if(contentsLocList[i].cd != 'SMM009'){
-						contentsLocHtml += '<option value="'+contentsLocList[i].cd+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
+						contentsLocHtml += '<option value="'+contentsLocList[i].cd+'" data-idx="'+contentsLocList[i].cdDesc+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
 					}
 				}else{
-					contentsLocHtml += '<option value="'+contentsLocList[i].cd+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
+					contentsLocHtml += '<option value="'+contentsLocList[i].cd+'" data-idx="'+contentsLocList[i].cdDesc+'">['+contentsLocList[i].cd+'] '+contentsLocList[i].cdNm+'</option>';
 				}
 			}
 		}
@@ -464,9 +481,9 @@
 
 			html += '" style="text-align:center; max-width:'+maxWidth+'px;">';
 			html += '<div>';
-			html += '<select name="contentsLocEdit" required="required" style="max-width:300px;" data-valid-name="컨텐츠 위치">'+contentsLocHtml+'</select>';
+			html += '<select name="contentsLocEdit" id="contentsBox'+contentsIdx+'" required="required" style="max-width:300px;" data-valid-name="컨텐츠 위치" onchange="fnTest(this,'+contentsIdx+');">'+contentsLocHtml+'</select>';
 			html += '</div>';
-			html += '<select name="contentsYn" required="required" style="max-width:160px;" data-valid-name="컨텐츠 타입"><option value="C">[C] 컨텐츠</option><option value="G">[G] 상품</option><option value="A">[A] 컨텐츠 + 상품</option></select>';
+			html += '<select name="contentsYn" id="contentsYn'+contentsIdx+'" required="required" style="max-width:160px;" data-valid-name="컨텐츠 타입" disabled="disabled"><option value="C">[C] 컨텐츠</option><option value="G">[G] 상품</option><option value="A">[A] 컨텐츠 + 상품</option><option value="E">[E] 위치설정</option></select>';
 			html += '<input type="hidden" name="contentsLoc" value=""/>';
 			html += '<input type="hidden" name="colCnt" value="'+colCnt+'"/>';
 			html += '<input type="hidden" name="colNo" value="'+colNo+'"/>';
@@ -524,6 +541,7 @@
 			$("#mainSortable").sortable();
 		}
 		//uifnFitGrid();
+		contentsIdx ++;
 	});
 
 	/**

+ 2 - 2
src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

@@ -773,7 +773,7 @@ console.log('brandGroupNo:'+brandGroupNo);
 			// 여기서 부터 시작! 상품불러오는거 똑같이 html 추가해서 체크
 			// +) 저장할때 TB_CONTENTS_GOODS 에 상품코드, 상품명, 상품이미지경로 추가해서 3개다 불러와서 데이터 뿌릴수 있게
 			$.each(goodsCdList.split(','),function (i){
-				html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:120px;"> ';
+				html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:140px;"> ';
 				goodsImg = goodsImgList.split(',')[i];
 				goodsCd = goodsCdList.split(',')[i];
 				goodsNm = goodsNmList.split(',')[i];
@@ -835,7 +835,7 @@ console.log('brandGroupNo:'+brandGroupNo);
 			if(i==0){
 				firstOrd = result[i].dispOrd;
 			}
-			html+='<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:120px;" ';
+			html+='<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:140px;" ';
 			if(result[i].goodsStat!="G008_90" || result[i].currStockQty<1){
 				html += 'background:#f5f5f5;';
 			}