Sfoglia il codice sorgente

메인전시 버튼 수정

bin2107 5 anni fa
parent
commit
47385bb285
1 ha cambiato i file con 110 aggiunte e 16 eliminazioni
  1. 110 16
      src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

+ 110 - 16
src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

@@ -9,6 +9,7 @@
  * STYLE24
  * Copyright(C) 2020 TSIT, All rights reserved.
  *============================================================================
+
  * VER  DATE         AUTHOR      DESCRIPTION
  * ===  ===========  ==========  =============================================
  * 1.0  2021.2.23    bin2107     최초 작성
@@ -64,6 +65,7 @@
 		gagajf.ajaxJsonSubmit('/display/contents/preview/list', jsonData, fnCreatePopLayout);
 	}
 
+	// 데이터 뿌리기
 	var createIdx = 0;
 	var fnCreatePopLayout = function(result) {
 		var html = '';
@@ -100,19 +102,23 @@
 			html += '</td>';
 			if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
 				html += '<td class="aL">';
-				if(contentsLoc!='SMM005'  && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012'){
+				if(contentsLoc!='SMM005'  && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012' && contentsLoc!='SMM001' && contentsLoc!='SOM001' && contentsLoc!='SMM003' && contentsLoc!='SMM004'  && contentsLoc!='SMM006'
+						&& contentsLoc!='SBM007' && contentsLoc!='SBM008' && contentsLoc!='SBM009' && contentsLoc!='SBM010' && contentsLoc!='SBM011' && contentsLoc!='SBM013' && contentsLoc!='SBM017' && contentsLoc!='SBM018' && contentsLoc!='SBM019'
+						&& contentsLoc!='SOM003' && contentsLoc!='SOM004'  && contentsLoc!='SCM004' && contentsLoc!='SBM004'){
 					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' || contentsLoc=='SOM001'){
+				if(contentsLoc=='SMM002' || 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' && contentsLoc!='SGNB001' && contentsLoc!='SGNB002'  && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012'){
+				if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005' && contentsLoc!='SGNB001' && contentsLoc!='SGNB002'  && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012' && contentsLoc!='SMM001' && contentsLoc!='SOM001' && contentsLoc!='SMM003' && contentsLoc!='SMM004' && contentsLoc!='SMM006'
+					&& contentsLoc!='SBM007' && contentsLoc!='SBM008' && contentsLoc!='SBM009' && contentsLoc!='SBM010' && contentsLoc!='SBM011' && contentsLoc!='SBM013' && contentsLoc!='SBM017' && contentsLoc!='SBM018' && contentsLoc!='SBM019' && contentsLoc!='SOM003' && contentsLoc!='SOM004'  && contentsLoc!='SCM004' && contentsLoc!='SBM004'){
 					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
 				}
-				if(contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012'){
+				if(contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012' && contentsLoc!='SMM001' && contentsLoc!='SOM001' && contentsLoc!='SMM003' && contentsLoc!='SMM006'  && contentsLoc!='SCM004' && contentsLoc!='SBM004'
+						&& contentsLoc!='SBM007' && contentsLoc!='SBM008' && contentsLoc!='SBM009' && contentsLoc!='SBM010' && contentsLoc!='SBM011' && contentsLoc!='SBM013' && contentsLoc!='SBM017' && contentsLoc!='SBM018' && contentsLoc!='SBM019' && contentsLoc!='SOM003' && contentsLoc!='SOM004' ){
 					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>';
@@ -387,7 +393,7 @@
 					}
 					if(contentsLoc!='SGNB001'){
 						if(imgPath!=null && imgPath!='null' && imgPath!='' ){
-							html += fnAddImgPopRow(imgPath);
+							html += fnAddImgPopRow(imgPath, j);
 						}
 					}
 					if(strVar!=null && strVar!='null' && strVar!='' ){
@@ -550,20 +556,43 @@
 		html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
 		html += '</td>';
 		html += '<td class="aL">';
-		if(contentsLoc!='SCM002' && contentsLoc!='SCM003' && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012'){
+		if(contentsLoc!='SCM002' && contentsLoc!='SCM003' && contentsLoc!='SMM011' && contentsLoc!='SBM012' && contentsLoc!='SBMM012' && contentsLoc!='SMM003' && contentsLoc!='SMM004' && contentsLoc!='SMM006'
+				&& contentsLoc!='SBM007' && contentsLoc!='SBM008' && contentsLoc!='SBM009' && contentsLoc!='SBM010' && contentsLoc!='SBM011' && contentsLoc!='SBM013' && contentsLoc!='SBM017' && contentsLoc!='SBM018' && contentsLoc!='SBM019'
+				&& contentsLoc!='SOM003' && contentsLoc!='SOM004'  && contentsLoc!='SCM004' ){
 			if(contentsLoc!='SMM005'){
-				html += '<button type="button" class="btn btn-base btn-lg" id="addTitle'+dataIdx+'" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
+				html += '<button type="button" class="btn btn-base btn-lg"';
+				if(contentsLoc=='SMM001' || contentsLoc=='SOM001' || contentsLoc=='SBM004'){
+					html += ' style="display:none;" ';
+				}
+				html+= ' id="addTitle'+dataIdx+'" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
 			}
 			if(contentsLoc=='SMM001' || contentsLoc=='SMM002' || contentsLoc=='SBM004' || contentsLoc=='SBMM004' || contentsLoc=='SCM001' || contentsLoc=='SOM001'){
-				html += '<button type="button" class="btn btn-base btn-lg" id="addSubText'+dataIdx+'" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
+				html += '<button type="button" class="btn btn-base btn-lg"';
+				if(contentsLoc=='SMM001' || contentsLoc=='SOM001'|| contentsLoc=='SBM004'){
+					html += ' style="display:none;" ';
+				}
+				html += ' id="addSubText'+dataIdx+'" ';
+				if(contentsLoc=='SBM004'){
+					html += ' style="display:none;" ';
+				}
+				html += ' 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!='SBM005' && contentsLoc!='SBMM005' && contentsLoc!='SGNB001') {
-				html += '<button type="button" class="btn btn-base btn-lg" id="addImg'+dataIdx+'" onclick="fnAddImgPopRow(this);">이미지추가</button>';
+				html += '<button type="button" class="btn btn-base btn-lg"';
+				if(contentsLoc=='SMM001' || contentsLoc=='SOM001' || contentsLoc=='SBM004'){
+					html += ' style="display:none;" ';
+				}
+				html += ' id="addImg'+dataIdx+'" onclick="fnAddImgPopRow(this);">이미지추가</button>';
+			}
+			if(contentsLoc=='SMM001' || contentsLoc=='SOM001' || contentsLoc=='SBM004'){
+				html += '<button type="button" style="display: none;" class="btn btn-base btn-lg" id="addMobImg'+dataIdx+'" onclick="fnAddMobImgPopRow(this);">모바일이미지추가</button>';
 			}
+			if(contentsLoc!='SMM001' && contentsLoc!='SOM001' && contentsLoc!='SBM004'){
 				html += '<button type="button" class="btn btn-base btn-lg" id="addLink'+dataIdx+'" onclick="fnAddLinkPopRow(this);">링크추가</button>';
+			}
 		}
 		html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 		html += '</tr>';
@@ -733,11 +762,12 @@
 			changeYear: true,
 			defaultDate: $('.schDate').val()
 		});
-		if(contentsLoc=='SMM001' || contentsLoc=='SOM001'){
+		if(contentsLoc=='SMM001' || contentsLoc=='SOM001' || contentsLoc=='SBM004'){
 			$("#addTitle"+dataIdx).click();
 			$("#addSubText"+dataIdx).click();
 			$("#addLink"+dataIdx).click();
 			$("#addImg"+dataIdx).click();
+			$("#addMobImg"+dataIdx).click();
 		}
 
 		if(contentsLoc=='SGNB001'){
@@ -1088,7 +1118,9 @@
 		var html = '<tr name="linkPopRow">';
 		html += '<th>링크 (없으면 #)</th>';
 		html += '<td><input name="link" type="text" maxlength="200" required="required" data-valid-name="링크" value="'+val+'"/></td>';
-		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		if(contentsLoc!='SMM001' && contentsLoc!='SOM001'){
+			html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		}
 		html += '</tr>';
 		if(typeof param == 'object'){
 			if(contentsLoc=='SMM005'){
@@ -1117,7 +1149,9 @@
 		var html = '<tr name="subTextPopRow">'
 		html += '<th>서브텍스트</th>';
 		html += '<td><input type="text" name="subText" maxlength="200" value="'+val+'"/></td>';
-		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		if(contentsLoc!='SMM001' && contentsLoc!='SOM001'){
+			html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		}
 		html += '</tr>';
 		if(typeof param == 'object'){
 			if($(param).closest("table").find("tbody").find("tr[name=subTextPopRow]").length>3){
@@ -1155,7 +1189,7 @@
 	 * 이미지 추가
 	 */
 	var imgIndex = 0;
-	var fnAddImgPopRow = function (param){
+	var fnAddImgPopRow = function (param, idx){
 		var src = '';
 		var imgPath = '';
 		if(typeof param!='object'){
@@ -1163,7 +1197,11 @@
 			imgPath = param;
 		}
 		var html = '<tr name="imgPopRow">';
-		html += '<th>이미지';
+		if(idx>1){
+			html += '<th>모바일용 이미지';
+		}else{
+			html += '<th>이미지';
+		}
 		html += '</th>';
 		html += '<td><div class="uFile w300">';
 		html += '<input id="filePop_'+imgIndex+'" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, '+imgIndex+')"/>';
@@ -1179,7 +1217,61 @@
 		}
 		html += '<img id="bannerPreViewUrlPop_'+imgIndex+'" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
 		html += '</div></td>';
-		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		if(contentsLoc!='SMM001' && contentsLoc!='SOM001'){
+			html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		}
+		html += '</tr>';
+		if(typeof param == 'object'){
+			if(contentsLoc=='SMM005'){
+				if($(param).closest("table").find("tbody").find("tr[name=imgPopRow]").length>1){
+					mcxDialog.alert("이미지는 최대 2개까지 등록 가능합니다");
+					return;
+				}
+			}else{
+				if($(param).closest("table").find("tbody").find("tr[name=imgPopRow]").length>3){
+					mcxDialog.alert("이미지는 4개까지 등록 가능합니다");
+					return;
+				}
+			}
+			imgIndex++;
+			$(param).closest("table").find("tbody").append(html);
+		}else{
+			imgIndex++;
+			return html;
+		}
+	}
+
+	/**
+	 * 모바일용 이미지 추가
+	 */
+	var imgMobIndex = 0;
+	var fnAddMobImgPopRow = function (param){
+		var src = '';
+		var imgPath = '';
+		if(typeof param!='object'){
+			src = $("#uploadDefaultUrlPop").val().replace('/contents/', '')+param;
+			imgPath = param;
+		}
+		var html = '<tr name="imgPopRow">';
+		html += '<th>모바일용 이미지';
+		html += '</th>';
+		html += '<td><div class="uFile w300">';
+		html += '<input id="filePop_'+imgMobIndex+'" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, '+imgMobIndex+')"/>';
+		html += '<label for="filePop_'+imgMobIndex+'" class="uFileLabel">파일선택</label>';
+		html += '<input type="hidden" name="imgPath" value="'+imgPath+'"/>';
+		html += '<input type="hidden" name="newImgFile" value="" />';
+		html += '</div>';
+		html += '<div id="imgViewPop_'+imgMobIndex+'" class=';
+		if(src!=''){
+			html += '"on">';
+		}else{
+			html += '"off">';
+		}
+		html += '<img id="bannerPreViewUrlPop_'+imgMobIndex+'" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
+		html += '</div></td>';
+		if(contentsLoc!='SMM001' && contentsLoc!='SOM001'){
+			html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		}
 		html += '</tr>';
 		if(typeof param == 'object'){
 			if(contentsLoc=='SMM005'){
@@ -1209,7 +1301,9 @@
 		var html = '<tr name="titlePopRow">';
 		html += '<th>타이틀</th>';
 		html += '<td><input name="title" type="text" maxlength="200" data-valid-name="타이틀" value="'+val+'"/></td>';
-		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		if(contentsLoc!='SMM001' && contentsLoc!='SOM001'){
+			html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
+		}
 		html += '</tr>';
 		if(typeof param == 'object'){
 			if($(param).closest("table").find("tbody").find("tr[name=titlePopRow]").length>3){