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

+ 5 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml

@@ -1337,7 +1337,11 @@
 		FROM TB_CONTENTS_PREVIEW A
 		WHERE A.CATE_NO = #{cateNo}
 		  AND A.CONTENTS_LOC = #{contentsLoc}
-		  AND A.USE_YN = 'Y'
+		<if test='contentsLoc != null and contentsLoc != ""'>
+		  <if test='contentsLoc != "SCM002" and contentsLoc != "SCM003"'>
+			  AND A.USE_YN = 'Y'
+		  </if>
+		</if>
 		ORDER BY A.DISP_ORD
 	</select>
 

+ 180 - 53
src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

@@ -36,11 +36,13 @@
 			<table class="frmStyle">
 				<colgroup>
 					<col style="width:10%;"/>
-					<col style="width:90%;"/>
+					<col style="width:40%;"/>
+					<col style="width:10%;"/>
+					<col style="width:40%;"/>
 				</colgroup>
 				<tr>
 					<th>컨텐츠 타이틀</th>
-					<td><input type="text" name="contentsTitle" style="width:50%;" maxlength="40" required="required" data-valid-name="컨텐츠타이틀" th:value="${contentsTitle}"></td>
+					<td colspan="3"><input type="text" style="width:43.5%;" name="contentsTitle" maxlength="40" required="required" data-valid-name="컨텐츠타이틀" th:value="${contentsTitle}"></td>
 				</tr>
 			</table>
 		</form>
@@ -71,6 +73,57 @@
 		gagajf.ajaxJsonSubmit('/display/contents/preview/list', jsonData, fnCreatePopLayout);
 	}
 
+	var fnCreateCateMainLayout = function(result){
+		var html = '';
+		for(let i=0; i<result.length; i++){
+			html += '<form name="contentsTitleForm" id="contentsTitleForm" style="width:1170px; overflow:auto;>';
+			html += '	<table className="frmStyle">';
+			html += '		<colgroup>';
+			html += '			<col style="width:10%;"/>';
+			html += '			<col style="width:40%;"/>';
+			html += '			<col style="width:10%;"/>';
+			html += '			<col style="width:40%;"/>';
+			html += '		</colgroup>';
+			html += '		<tr>';
+			html += '			<th>컨텐츠 타이틀</th>';
+			html += '			<td colSpan="3"><input type="text" style="width:43.5%;" name="contentsTitle" maxLength="40" required="required" data-valid-name="컨텐츠타이틀" value"'+result[i].mdTitle+'">';
+			html += '			</td>';
+			html += '		</tr>';
+			html += '		<tr>';
+			html += '			<th>전시 설정</th>';
+			html += '			<td>';
+			if(result[i].useYn=='Y'){
+				html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="Y" checked="checked"/>노출</label>';
+				html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="N"/>비노출</label>';
+			}else{
+				html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="Y"/>노출</label>';
+				html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="N" checked="checked"/>비노출</label>';
+			}
+			html += '			</td>';
+			if(result[i].contentsLoc=='SCM003'){
+				html += '			<th>상품 노출 개수</th>';
+				html += '			<td>';
+				if(result[i].strVar1=='10'){
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10" checked="checked"/>10개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20"/>20개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30"/>30개</label>';
+				}else if(result[i].strVar1=='20'){
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10"/>10개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20" checked="checked"/>20개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30"/>30개</label>';
+				}else{
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10"/>10개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20"/>20개</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30" checked="checked"/>30개</label>';
+				}
+				html += '			</td>';
+			}
+			html += '		</tr>';
+			html += '	</table>';
+			html += '</form>';
+		}
+	}
+
 	var createIdx = 0;
 	var fnCreatePopLayout = function(result) {
 		var html = '';
@@ -101,24 +154,58 @@
 			html += '</select>';
 			html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
 			html += '</td>';
-			html += '<td class="aL">';
-			if(contentsLoc!='SMM005'){
-				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
-			}
-			if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
-				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
-			}
-			if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
-				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
-			}
-			if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
-				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
-			}
-			if(contentsLoc!='SMM005') {
-				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
+			if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
+				html += '<td class="aL">';
+				if(contentsLoc!='SMM005'){
+					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
+				}
+				if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004' || contentsLoc=='SCM001'){
+					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
+				}
+				if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
+					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
+				}
+				if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
+					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
+				}
+				if(contentsLoc!='SMM005') {
+					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
+				}
+				html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 			}
-			html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 			html += '</tr>';
+			if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+				html += '		<tr>';
+				html += '			<th>전시 설정</th>';
+				html += '			<td>';
+				if(result[i].useYn=='Y'){
+					html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="Y" checked="checked"/>노출</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="N"/>비노출</label>';
+				}else{
+					html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="Y"/>노출</label>';
+					html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="N" checked="checked"/>비노출</label>';
+				}
+				html += '			</td>';
+				if(result[i].contentsLoc=='SCM003'){
+					html += '			<th>상품 노출 개수</th>';
+					html += '			<td>';
+					if(result[i].strVar1=='10'){
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10" checked="checked"/>10개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20"/>20개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30"/>30개</label>';
+					}else if(result[i].strVar1=='20'){
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10"/>10개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20" checked="checked"/>20개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30"/>30개</label>';
+					}else{
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10"/>10개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20"/>20개</label>';
+						html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30" checked="checked"/>30개</label>';
+					}
+					html += '			</td>';
+				}
+				html += '		</tr>';
+			}
 			if(contentsLoc=='SMM001'){
 				html += '<tr>';
 				html += '	<th>컨텐츠유형</th>';
@@ -202,24 +289,27 @@
 				}
 			}
 			html += '</thead><tbody>';
-			for(var j=1; j<5; j++){
-				var strTitle = eval("result["+i+"].strTitle" + j);
-				var imgPath = eval("result["+i+"].imgPath" + j);
-				var strVar = eval("result["+i+"].strVar" + j);
-				var subText = eval("result["+i+"].subText" + j);
-				if(strTitle!=null && strTitle!='null' && strTitle!='' ){
-					html += fnAddTitlePopRow(strTitle);
-				}
-				if(imgPath!=null && imgPath!='null' && imgPath!='' ){
-					html += fnAddImgPopRow(imgPath);
-				}
-				if(strVar!=null && strVar!='null' && strVar!='' ){
-					html += fnAddLinkPopRow(strVar);
-				}
-				if(subText!=null && subText!='null' && subText!='' ){
-					html += fnAddSubTextPopRow(subText);
+			if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
+				for(var j=1; j<5; j++){
+					var strTitle = eval("result["+i+"].strTitle" + j);
+					var imgPath = eval("result["+i+"].imgPath" + j);
+					var strVar = eval("result["+i+"].strVar" + j);
+					var subText = eval("result["+i+"].subText" + j);
+					if(strTitle!=null && strTitle!='null' && strTitle!='' ){
+						html += fnAddTitlePopRow(strTitle);
+					}
+					if(imgPath!=null && imgPath!='null' && imgPath!='' ){
+						html += fnAddImgPopRow(imgPath);
+					}
+					if(strVar!=null && strVar!='null' && strVar!='' ){
+						html += fnAddLinkPopRow(strVar);
+					}
+					if(subText!=null && subText!='null' && subText!='' ){
+						html += fnAddSubTextPopRow(subText);
+					}
 				}
 			}
+
 			html += '</tbody></table>';
 		}
 		$("#popSortable").append(html);
@@ -240,6 +330,12 @@
 	var dataIdx=0;
 	$("#btnPopAddRow").on("click", function (){
 		dataIdx = tableLen;
+		if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+			if($(".mcTable").length > 0){
+				mcxDialog.alert('컨텐츠 추가를 1개 이상 할 수 없습니다.');
+				return;
+			}
+		}
 
 		var html = '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+dataIdx+'">';
 		html += '<input type="hidden" name="tableIdx" value="'+dataIdx+'" data-id="'+dataIdx+'">';
@@ -266,23 +362,42 @@
 		html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
 		html += '</td>';
 		html += '<td class="aL">';
-		if(contentsLoc!='SMM005'){
-			html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
-		}
-		if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
-			html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
-		}
-		if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
-			html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
-		}
-		if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
-			html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
-		}
-		if(contentsLoc!='SMM005') {
-			html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
+		if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
+			if(contentsLoc!='SMM005'){
+				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
+			}
+			if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004' || contentsLoc=='SCM001'){
+				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
+			}
+			if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
+				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
+			}
+			if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
+				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
+			}
+			if(contentsLoc!='SMM005') {
+				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
+			}
 		}
 		html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 		html += '</tr>';
+		if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+			html += '		<tr>';
+			html += '			<th>전시 설정</th>';
+			html += '			<td>';
+			html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="Y" checked="checked"/>노출</label>';
+			html += '				<label class="rdoBtn"><input type="radio" name="dispYn" value="N"/>비노출</label>';
+			html += '			</td>';
+			if(contentsLoc=='SCM003'){
+				html += '			<th>상품 노출 개수</th>';
+				html += '			<td>';
+				html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="10" checked="checked"/>10개</label>';
+				html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="20"/>20개</label>';
+				html += '				<label class="rdoBtn"><input type="radio" name="dispCnt" value="30"/>30개</label>';
+				html += '			</td>';
+			}
+			html += '		</tr>';
+		}
 		if(contentsLoc=='SMM001'){
 			html += '<tr>';
 			html += '	<th>컨텐츠유형</th>';
@@ -348,6 +463,7 @@
 		}
 		html += '</thead><tbody>';
 		html += '</tbody></table>';
+
 		$("#popSortable").prepend(html);
 		$("#popSortable").sortable();
 		$('.schDate').datepicker("destroy");
@@ -468,12 +584,13 @@
 	 */
 	var dataArr = [];
 	$("#btnPopSave").on("click", function (){
-		if(!gagajf.checkRequired("#popSortable")){
+		if (!gagajf.checkRequired("#popSortable")) {
 			return;
 		}
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
-				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
+				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
 			if(!gagajf.checkRequired("#contentsTitleForm")){
 				return;
 			}
@@ -527,6 +644,7 @@
 			var subText3 = '';
 			var subText4 = '';
 			var contentsType = '';
+			var useYn = 'Y';
 			var i = 1;
 			$(this).find('input[name=imgPath]').each(function(){
 				eval("imgPath" + i + "='"+$(this).val()+"'");
@@ -579,6 +697,13 @@
 				strVar2 = $(this).find("#bannerLinkTr2").find("input[name=linkUrl]").val();
 			}
 
+			if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+				useYn = $(this).find("input:radio[name=dispYn]:checked").val();
+			}
+			if(contentsLoc=='SCM003'){
+				strVar1 = $(this).find("input:radio[name=dispCnt]:checked").val();
+			}
+
 			var data = {cateNo : cateNo
 				, contentsLoc : contentsLoc
 				, contentsType : contentsType
@@ -605,7 +730,7 @@
 				, subText2 : subText2
 				, subText3 : subText3
 				, subText4 : subText4
-				, useYn : 'Y'
+				, useYn : useYn
 				, dispOrd : dispOrd
 			};
 
@@ -654,7 +779,8 @@
 		}
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
-				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
+				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
 			var data = {
 				cateNo : cateNo
 				, contentsLoc : contentsLoc
@@ -868,7 +994,8 @@
 		$("#popTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
-				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
+				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
 			$("#contentsTitleForm").show();
 		}else{
 			$("#contentsTitleForm").hide();