|
|
@@ -0,0 +1,204 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="ko"
|
|
|
+ xmlns:th="http://www.thymeleaf.org">
|
|
|
+<!--
|
|
|
+ *******************************************************************************
|
|
|
+ * @source : LookbookBannerPopupForm.html
|
|
|
+ * @desc : 룩북 배너 등록/수정 상세 팝업
|
|
|
+ *============================================================================
|
|
|
+ * STYLE24
|
|
|
+ * Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
+ *============================================================================
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
+ * === =========== ========== =============================================
|
|
|
+ * 1.0 2021.03.05 bin2107 최초 작성
|
|
|
+ *******************************************************************************
|
|
|
+ -->
|
|
|
+<div class="modalPopup" data-width="1400" data-height="750">
|
|
|
+ <div class="panelStyle" >
|
|
|
+ <form id="lbBannerForm" name="lbBannerForm" action="#" th:action="@{'/display/lookbook/save'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
|
|
|
+ <input type="hidden" id="siteCd" name="siteCd" value="G00_10"/>
|
|
|
+ <input type="hidden" id="lookbookSq" name="lookbookSq" th:value="${lookbookSq}"/>
|
|
|
+ <div class="panelTitle">
|
|
|
+ <h2 th:text="${'룩북 ' + (mode == 'N' ? '등록1' : '상세')}"></h2>
|
|
|
+ <button type="button" class="close" onclick="uifnPopupClose('popupLookbookBanner');"><i class="fa fa-times"></i></button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ <col style="width:10%;"/>
|
|
|
+ <col style="width:15%;"/>
|
|
|
+ </colgroup>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>타이틀<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w400" name="title" required="required" data-valid-name="타이틀">
|
|
|
+ </td>
|
|
|
+ <th>브랜드<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="brandCd">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${brandGroupList}" th:each="oneData, status : ${brandGroupList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>노출기간<i class="required" title="필수"></i></th>
|
|
|
+ <td id="sellTerms2">
|
|
|
+ <span class="nowrap">
|
|
|
+ <input name="lbDispStdt" id="lbStDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="노출기간 시작일" />
|
|
|
+ <select id="lbStTimeHour" required="required" data-valid-name="노출기간 시작시간">
|
|
|
+ <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" >시간</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <select id="lbStTimeMin" required="required" data-valid-name="노출기간 시작시간">
|
|
|
+ <th:block th:each="num: ${#numbers.sequence(0,59)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" >분</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <input name="lbDispStTime" id="lbStTime" type="hidden" data-valid-name="노출기간 시작시간" value='000000' />
|
|
|
+ ~
|
|
|
+ <input name="lbDispEddt" id="lbEdDate" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="노출기간 종료일" />
|
|
|
+ <select id="lbEdTimeHour" required="required" data-valid-name="노출기간 종료시간">
|
|
|
+ <th:block th:each="num: ${#numbers.sequence(0,23)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${#numbers.formatInteger(num,2)}==23 ? 'true'">시간</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <select id="lbEdTimeMin" required="required" data-valid-name="노출기간 종료시간">
|
|
|
+ <th:block th:each="num: ${#numbers.sequence(0,59)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="${#numbers.formatInteger(num,2)}==59 ? 'true'">분</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <input name="lbDispEdTime" id="lbEdTime" type="hidden" data-valid-name="노출기간 종료시간" value='235959' />
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ <th>노출여부<i class="required" title="필수"></i></th>
|
|
|
+ <td>
|
|
|
+ <label class="rdoBtn"><input type="radio" name="dispYn" value="Y" checked="checked"/>Y</label>
|
|
|
+ <label class="rdoBtn"><input type="radio" name="dispYn" value="N">N</label>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>메인 목록 썸네일<i class="required" title="필수"></i></th>
|
|
|
+ <td colspan="3">
|
|
|
+ <div class="uFile w300">
|
|
|
+ <input id="file" name="file" type="file" class="uFileInput w300"/>
|
|
|
+ <label for="file" class="uFileLabel">파일선택</label>
|
|
|
+ <input type="hidden" name="orgTnfileNm"/>
|
|
|
+ <input type="hidden" name="sysTnfileNm"/>
|
|
|
+ <input type="hidden" name="newSysTnfileNm"/>
|
|
|
+ </div>
|
|
|
+ <input type="hidden" name="uploadDefaultUrl" id="uploadDefaultUrl" th:value="${@environment.getProperty('upload.image.view') + '/display/lookbook/thumbnail/'}"/>
|
|
|
+ <div id="imgView" class="off">
|
|
|
+ <img id="bannerPreViewUrl" src="" style="width:100px; height:100px"/>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ <ul class="panelBar">
|
|
|
+ <li class="right">
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnSave">저장</button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
|
|
|
+<script th:inline="javascript">
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 저장
|
|
|
+ */
|
|
|
+ $("#btnSave").on('click',function (){
|
|
|
+ // 필수값 validation 체크
|
|
|
+ if (!gagajf.validation('#lbBannerForm')) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 데이터 validation 체크
|
|
|
+ if(!dataValidation()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var orgTnfileNm = $('#lbBannerForm input[name=sysTnfileNm]').val();
|
|
|
+ var sysTnfileNm = $('#lbBannerForm input[name=sysTnfileNm]').val();
|
|
|
+ var newSysTnfileNm = $('#lbBannerForm input[name=newSysTnfileNm]').val();
|
|
|
+ console.log('orgTnfileNm>>'+orgTnfileNm);
|
|
|
+ console.log('sysTnfileNm>>'+sysTnfileNm);
|
|
|
+ console.log('newSysTnfileNm>>'+newSysTnfileNm);
|
|
|
+
|
|
|
+ var fromDate = $('#lbBannerForm input[name=lbDispStdt]').val().replace(/[^0-9]/g, '')+$('#lbBannerForm #lbStTimeHour').val()+$('#lbBannerForm #lbStTimeMin').val()+'00';
|
|
|
+ var toDate = $('#lbBannerForm input[name=lbDispEddt]').val().replace(/[^0-9]/g, '')+$('#lbBannerForm #lbEdTimeHour').val()+$('#lbBannerForm #lbEdTimeMin').val()+'59';
|
|
|
+
|
|
|
+ var data = {
|
|
|
+ lookbookSq : $('#lbBannerForm input[name=lookbookSq]').val()
|
|
|
+ ,title : $('#lbBannerForm input[name=title]').val()
|
|
|
+ ,brandCd : $('#lbBannerForm select[name=brandCd]').val()
|
|
|
+ ,dispStdt : fromDate
|
|
|
+ ,dispEddt : toDate
|
|
|
+ ,dispYn : $('#lbBannerForm input[name=dispYn]:checked').val()
|
|
|
+ ,orgTnfileNm : orgTnfileNm
|
|
|
+ ,sysTnfileNm : sysTnfileNm
|
|
|
+ ,newSysTnfileNm : newSysTnfileNm
|
|
|
+ ,mainDispYn : 'N'
|
|
|
+ ,dispOrd : 1
|
|
|
+ };
|
|
|
+
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+
|
|
|
+ gagajf.ajaxJsonSubmit($('#lbBannerForm').prop('action'), jsonData, fnPopupSaveCollback);
|
|
|
+ });
|
|
|
+
|
|
|
+ var fnPopupSaveCollback = function (result){
|
|
|
+ uifnPopupClose('popupLookbookBanner');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 데이터 validation 체크
|
|
|
+ function dataValidation(){
|
|
|
+ // 날짜체크
|
|
|
+ var fromDate = $('#lbBannerForm input[name=lbDispStdt]').val().replace(/[^0-9]/g, '')+$('#lbBannerForm #lbStTimeHour').val()+$('#lbBannerForm #lbStTimeMin').val();
|
|
|
+ var toDate = $('#lbBannerForm input[name=lbDispEddt]').val().replace(/[^0-9]/g, '')+$('#lbBannerForm #lbEdTimeHour').val()+$('#lbBannerForm #lbEdTimeMin').val();
|
|
|
+ if(fromDate > toDate){
|
|
|
+ mcxDialog.alert('노출 시작일자는 종료일자 보다 클 수 없습니다.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 썸네일이미지 첨부파일
|
|
|
+ $("#lbBannerForm input[name=file]").on('change',function(){
|
|
|
+ var file = this.files[0];
|
|
|
+ file.name = 'test';
|
|
|
+ if (typeof(file) == 'undefined'){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ gagajf.ajaxFileUpload('/common/file/upload?subDir=/display/lookbook/thumbnail'
|
|
|
+ , file
|
|
|
+ , function(result) {
|
|
|
+ $('#lbBannerForm input[name=sysTnfileNm]').val(result.oldFileName);
|
|
|
+ $('#lbBannerForm input[name=newSysTnfileNm]').val(result.newFileName);
|
|
|
+ $("#lbBannerForm #bannerPreViewUrl").attr('src', $("#lbBannerForm #uploadDefaultUrl").val()+result.newFileName);
|
|
|
+ $("#lbBannerForm #imgView").removeClass("off").addClass("on");
|
|
|
+ }
|
|
|
+ , 'image'
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).ready(function() {
|
|
|
+ //sortable Item List
|
|
|
+ //fnSearchData();
|
|
|
+ });
|
|
|
+</script>
|
|
|
+</html>
|