|
|
@@ -1,6 +1,6 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="ko"
|
|
|
- xmlns:th="http://www.thymeleaf.org">
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
<!--
|
|
|
*******************************************************************************
|
|
|
* @source : MainContentsPopupForm.html
|
|
|
@@ -14,43 +14,43 @@
|
|
|
* 1.0 2021.2.23 bin2107 최초 작성
|
|
|
*******************************************************************************
|
|
|
-->
|
|
|
- <div class="modalPopup" data-width="1400" >
|
|
|
- <div class="panelStyle">
|
|
|
- <div class="panelTitle">
|
|
|
- <h2 id="popTitle" th:text="${contentsLoc}"></h2>
|
|
|
- <button type="button" class="close" onclick="fnMainContentsPopupFormClose()"><i class="fa fa-times"></i></button>
|
|
|
- </div>
|
|
|
- <div class="panelContent">
|
|
|
- <ul class="panelBar">
|
|
|
- <li class="aL">
|
|
|
- <span class="cBlue">* 상단으로 드래그&드랍하여 순서 변경 가능합니다.</span>
|
|
|
- </li>
|
|
|
- <li class="aR">
|
|
|
- <button type="button" class="btn btn btn-base btn-sm" id="btnPopAddRow">컨텐츠 추가</button>
|
|
|
- <button type="button" class="btn btn btn-dark btn-sm" id="btnPopSave">임시저장</button>
|
|
|
- <input type="hidden" name="uploadDefaultUrlPop" id="uploadDefaultUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/'}"/>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <form name="contentsTitleForm" id="contentsTitleForm" style="width:1170px; overflow:auto; display: none;">
|
|
|
- <table class="frmStyle">
|
|
|
- <colgroup>
|
|
|
- <col style="width:10%;"/>
|
|
|
- <col style="width:90%;"/>
|
|
|
- </colgroup>
|
|
|
- <tr>
|
|
|
- <th>컨텐츠 타이틀</th>
|
|
|
- <td><input type="text" name="contentsTitle" style="width:50%;" maxlength="40" required="required" data-valid-name="컨텐츠타이틀" th:value="${contentsTitle}"></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </form>
|
|
|
- <form style="height:600px; width:1370px; overflow:auto;" id="popSortable">
|
|
|
- </form>
|
|
|
+<div class="modalPopup" data-width="1500" >
|
|
|
+ <div class="panelStyle">
|
|
|
+ <div class="panelTitle">
|
|
|
+ <h2 id="popTitle" th:text="${contentsLoc}"></h2>
|
|
|
+ <button type="button" class="close" onclick="fnMainContentsPopupFormClose()"><i class="fa fa-times"></i></button>
|
|
|
</div>
|
|
|
+ <div class="panelContent">
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="aL">
|
|
|
+ <span class="cBlue">* 상단으로 드래그&드랍하여 순서 변경 가능합니다.</span>
|
|
|
+ </li>
|
|
|
+ <li class="aR">
|
|
|
+ <button type="button" class="btn btn btn-base btn-sm" id="btnPopAddRow">컨텐츠 추가</button>
|
|
|
+ <button type="button" class="btn btn btn-dark btn-sm" id="btnPopSave">임시저장</button>
|
|
|
+ <input type="hidden" name="uploadDefaultUrlPop" id="uploadDefaultUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/'}"/>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <form name="contentsTitleForm" id="contentsTitleForm" style="width:1170px; overflow:auto; display: none;">
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:90%;"/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>컨텐츠 타이틀</th>
|
|
|
+ <td><input type="text" name="contentsTitle" style="width:50%;" maxlength="40" required="required" data-valid-name="컨텐츠타이틀" th:value="${contentsTitle}"></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+ <form style="height:600px; width:1470px; overflow:auto;" id="popSortable">
|
|
|
+ </form>
|
|
|
</div>
|
|
|
+</div>
|
|
|
|
|
|
<script th:inline="javascript">
|
|
|
-/*<![CDATA[*/
|
|
|
+ /*<![CDATA[*/
|
|
|
var cateNo = [[${cateNo}]];
|
|
|
var contentsLoc = [[${contentsLoc}]];
|
|
|
var contentsTitle = [[${contentsTitle}]];
|
|
|
@@ -74,7 +74,8 @@
|
|
|
for(var i=0; i<result.length; i++){
|
|
|
var dispStdt = result[i].dispStdt.split(" ");
|
|
|
var dispEddt = result[i].dispEddt.split(" ");
|
|
|
- html += '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
+ html += '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+i+'">';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+i+'" >';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -98,7 +99,7 @@
|
|
|
html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
|
|
|
html += '</td>';
|
|
|
html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
- if(contentsLoc=='SMM001' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
+ 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'){
|
|
|
@@ -109,7 +110,27 @@
|
|
|
}
|
|
|
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></thead><tbody>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ //html += fnMainBannerArea(i);
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>컨텐츠유형</th>';
|
|
|
+ html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="P" onclick="fnChangeContentsType(this,'+i+');" checked="checked"/>기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+i+'" value="E" onclick="fnChangeContentsType(this,'+i+');"/>이벤트</label>';
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq'+i+'" value=""/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+i+');">기획전검색</button>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
+ html += ' <td colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+i+'" value="WHITE" />WHITE</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ html += '</thead><tbody>';
|
|
|
for(var j=1; j<5; j++){
|
|
|
var strTitle = eval("result["+i+"].strTitle" + j);
|
|
|
var imgPath = eval("result["+i+"].imgPath" + j);
|
|
|
@@ -138,12 +159,33 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
+ fnResetIdx();
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnResetIdx = function (){
|
|
|
+ $(".mcTable").each(function(i){
|
|
|
+ var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
+
|
|
|
+ $(this).find("input:radio[name=contentsType"+thisIdx+"]").removeAttr("onclick");
|
|
|
+ $(this).find("input:radio[name=contentsType"+thisIdx+"]").attr("onclick", "fnChangeContentsType(this,"+i+");");
|
|
|
+ $(this).find("input[name=planSq"+thisIdx+"]").removeAttr("onclick");
|
|
|
+ $(this).find("input[name=planSq"+thisIdx+"]").attr("onclick", "fnSearchPlan("+i+");");
|
|
|
+ $(this).find("input[name=contentsType"+thisIdx+"]").attr('name','contentsType'+i);
|
|
|
+ $(this).find("input[name=planSq"+thisIdx+"]").attr('name','planSq'+i);
|
|
|
+ $(this).find("input[name=thumTextColor"+thisIdx+"]").attr('name','thumTextColor'+i);
|
|
|
+ $(this).attr('id','mcTable'+i);
|
|
|
+ $(this).find("input[name=tableIdx]").val(i);
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 컨텐츠 추가 버튼
|
|
|
*/
|
|
|
+ var dataIdx=0;
|
|
|
$("#btnPopAddRow").on("click", function (){
|
|
|
- var html = '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
+ var html = '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+dataIdx+'">';
|
|
|
+ html += '<input type="hidden" name="tableIdx" value="'+dataIdx+'">';
|
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
|
@@ -167,7 +209,7 @@
|
|
|
html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
|
|
|
html += '</td>';
|
|
|
html += '<td class="aL"><button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
- if(contentsLoc=='SMM001' || contentsLoc=='SBM004' || contentsLoc=='SBMM004'){
|
|
|
+ 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'){
|
|
|
@@ -178,7 +220,27 @@
|
|
|
}
|
|
|
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></thead><tbody></tbody></table>';
|
|
|
+ html += '</tr>';
|
|
|
+ if(contentsLoc=='SMM001'){
|
|
|
+ //html += fnMainBannerArea();
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>컨텐츠유형</th>';
|
|
|
+ html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+dataIdx+'" value="P" onclick="fnChangeContentsType(this,'+dataIdx+');" checked="checked"/>기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+dataIdx+'" value="E" onclick="fnChangeContentsType(this,'+dataIdx+');"/>이벤트</label>';
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq'+dataIdx+'" value=""/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+dataIdx+');">기획전검색</button>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
+ html += ' <td colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+dataIdx+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+dataIdx+'" value="WHITE" />WHITE</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ }
|
|
|
+ html += '</thead><tbody></tbody></table>';
|
|
|
$("#popSortable").prepend(html);
|
|
|
$("#popSortable").sortable();
|
|
|
$('.schDate').datepicker("destroy");
|
|
|
@@ -187,8 +249,56 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
+ fnResetIdx();
|
|
|
});
|
|
|
|
|
|
+ var mbIdx = 0;
|
|
|
+ var fnMainBannerArea = function (param){
|
|
|
+ var html = '';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>컨텐츠유형</th>';
|
|
|
+ html += ' <td class="planArea" name="planArea" colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+mbIdx+'" value="P" onclick="fnChangeContentsType(this,'+mbIdx+');" checked="checked"/>기획전</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="contentsType'+mbIdx+'" value="E" onclick="fnChangeContentsType(this,'+mbIdx+');"/>이벤트</label>';
|
|
|
+ html += ' <input type="text" class="w100 inputPlan" name="planSq'+mbIdx+'" value=""/>';
|
|
|
+ html += ' <button type="button" class="btn btn btn-dark btn-sm btnPlan" onclick="fnSearchPlan('+mbIdx+');">기획전검색</button>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ html += '<tr>';
|
|
|
+ html += ' <th>썸네일 <br>글자 색상</th>';
|
|
|
+ html += ' <td colspan="3">';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+mbIdx+'" value="BLACK" checked="checked"/>BLACK</label>';
|
|
|
+ html += ' <label class="rdoBtn"><input type="radio" name="thumTextColor'+mbIdx+'" value="WHITE" />WHITE</label>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += '</tr>';
|
|
|
+ mbIdx++;
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 몰메인>메인롤링배너 컨텐츠유형 선택시
|
|
|
+ var fnChangeContentsType = function (obj, idx){
|
|
|
+ var radioVal = $(obj).closest("td").find("input[name=contentsType"+idx+"]:checked").val();
|
|
|
+ if(radioVal=='P'){
|
|
|
+ $(obj).find(".planArea .inputPlan").show();
|
|
|
+ $(obj).find(".planArea .btnPlan").show();
|
|
|
+ }else{
|
|
|
+ $(obj).find(".planArea").find("input[name=planSq"+idx+"]").val('');
|
|
|
+ $(obj).find(".planArea .inputPlan").hide();
|
|
|
+ $(obj).find(".planArea .btnPlan").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 몰메인>메인롤링배너 기획전 조회
|
|
|
+ var tableDataId = 0;
|
|
|
+ var fnSearchPlan = function (idx){
|
|
|
+ cfnOpenPlanPopup('callbackPlanPopup');
|
|
|
+ tableDataId = idx;
|
|
|
+ }
|
|
|
+
|
|
|
+ var callbackPlanPopup = function (result){
|
|
|
+ $("#mcTable"+tableDataId+" .planArea").find("input[name=planSq"+tableDataId+"]").val(result[0].planSq);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 임시저장
|
|
|
*/
|
|
|
@@ -565,7 +675,7 @@
|
|
|
$("#popSortable").disableSelection();
|
|
|
fnGetContentsPreviewList();
|
|
|
});
|
|
|
-/*]]>*/
|
|
|
+ /*]]>*/
|
|
|
</script>
|
|
|
|
|
|
</html>
|