gagamel 5 лет назад
Родитель
Сommit
bffa3f775a

+ 158 - 0
style24.admin/src/main/webapp/WEB-INF/views/envset/ClauseDetailForm.html

@@ -0,0 +1,158 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ClauseDetailForm.html
+ * @desc    : 약관 상세 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.29   gagamel     최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="900" id="popupUser">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong th:text="${'약관 ' + (mode == 'N' ? '등록' : '상세')}">약관 상세</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupClause');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		
+		<!-- CONTENT -->
+		<div class="panelContent" th:if="${mode == 'N'}">
+			<form id="clauseDetailForm" name="clauseDetailForm" action="#" th:action="@{'/envset/clause/save'}" th:method="post">
+				<input type="hidden" name="mode" th:value="${mode}"/>
+				
+				<table class="frmStyle" aria-describedby="등록폼">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col style="width:25%;"/>
+						<col style="width:15%;"/>
+						<col style="width:45%;"/>
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>약관번호</th>
+							<td>
+								<input type="text" name="clauseSq" maxlength="20" placeholder="자동생성" readonly="readonly"/>
+							</td>
+							<th>사이트<em class="required" title="필수"></em></th>
+							<td>
+								<select name="siteCd" required="required">
+									<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<th>약관유형<em class="required" title="필수"></em></th>
+							<td>
+								<select name="clauseType" required="required">
+									<option th:if="${clauseTypeList}" th:each="oneData, status : ${clauseTypeList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+								</select>
+							</td>
+							<th>시행일자<em class="required" title="필수"></em></th>
+							<td>
+								<input type="text" class="schDate w80" name="effectDt" maxlength="10" required="required" data-valid-type="calendar" data-valid-name="시행일자"/>
+							</td>
+						</tr>
+						<tr>
+							<th>표시여부</th>
+							<td colspan="3">
+								<input type="hidden" name="dispYn" value="Y"/>
+								<label class="chkBox"><input type="checkbox" name="chkDispYn" value="Y" checked="checked"/>표시</label>
+								<span class="cBlue"><i class="fa fa-info-circle" aria-hidden="true"></i> 표시여부를 체크할 경우, 현재 약관으로 노출됩니다.</span>
+							</td>
+						</tr>
+						<tr>
+							<th>약관 제목<em class="required" title="필수"></em></th>
+							<td colspan="3">
+								<input type="text" name="clauseTitle" placeholder="" maxlength="100"/>
+							</td>
+						</tr>
+						<tr>
+							<th>약관 내용<em class="required" title="필수"></em></th>
+							<td colspan="3">
+								<div id="summernote"></div>
+<!-- 								<textarea class="textareaR4" name="clauseContent" style="height:350px;"></textarea> -->
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</form>
+		</div>
+		<!-- //CONTENT -->
+
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" onclick="fnSaveClause('#clauseDetailForm');">저장</button>
+			</li>
+		</ul>
+		<!-- //버튼 배치 영역 -->
+	</div>
+</div>
+
+<script src="/ux/plugins/summernote/bootstrap.min.js"></script><!-- summernote : default  -->
+<script src="/ux/plugins/summernote/summernote.js"></script><!-- summernote : default  -->
+<script src="/ux/plugins/summernote/summernote-ext-print.js"></script><!-- summernote : 인쇄 -->
+<script src="/ux/plugins/summernote/summernote-emoji.js"></script><!-- summernote : 이모티콘 -->
+<script th:inline="javascript">
+/*<![CDATA[*/
+// 	let seOptions = gagaSe.getEditorOptions();
+	let mode = [[${mode}]];
+	
+	// 초기화
+	let fnInitialize = function() {
+		let clauseInfo = [[${clauseInfo}]];
+		
+		$('#clauseDetailForm input[name=clauseSq]').val(clauseInfo.clauseSq);
+		$('#clauseDetailForm select[name=siteCd]').val(clauseInfo.siteCd);
+		$('#clauseDetailForm select[name=clauseType]').val(clauseInfo.clauseType);
+		$('#clauseDetailForm input[name=effectDt]').val(clauseInfo.effectDt.toDate("YYYYMMDD").format("YYYY-MM-DD"));
+		$('#clauseDetailForm input[name=clauseTitle]').val(clauseInfo.clauseTitle);
+		
+		if (clauseInfo.dispYn == 'Y') {
+			$('#clauseDetailForm input:checkbox[name=chkDispYn]').attr('checked', true);
+		} else {
+			$("#clauseDetailForm input:checkbox[name=chkDispYn]").attr('checked', false);
+		}
+		
+// 		gagaSe.createSmartEditor(seOptions, 'clauseContent');
+// 		gagaSe.setContents('clauseContent', clauseInfo.clauseContent);
+	}
+	
+	// 저장
+	var fnSaveClause = function() {
+		// 입력 값 체크
+		if (!gagajf.validation('#clauseDetailForm'))
+			return false;
+		
+		mcxDialog.confirm("저장하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				$('#clauseDetailForm input[name=dispYn]').val($('#clauseDetailForm input:checkbox[name=chkDispYn]').is(':checked') ? 'Y' : 'N');
+				
+				gagajf.ajaxFormSubmit($('#clauseDetailForm').prop('action'), '#clauseDetailForm', function() {
+					uifnPopupClose('popupClause');
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	}
+	
+	$(document).ready(function() {
+		// 상세/수정 화면이면
+		if (mode == 'U') {
+			fnInitialize();
+		}
+	});
+/*]]>*/
+</script>
+
+</html>

+ 137 - 0
style24.admin/src/main/webapp/WEB-INF/views/envset/ClauseForm.html

@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ClauseForm.html
+ * @desc    : 약관관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.10.29   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/envset/clause/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:40%;"/>
+						<col style="width:10%;"/>
+						<col style="width:40%;"/>
+					</colgroup>
+					<tr>
+						<th>사이트</th>
+						<td>
+							<select name="siteCd">
+								<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+							</select>
+						</td>
+						<th>약관유형</th>
+						<td>
+							<select name="clauseType">
+								<option value="">전체</option>
+								<option th:if="${clauseTypeList}" th:each="oneData, status : ${clauseTypeList}" th:value="${oneData.cd}" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
+							</select>
+						</td>
+					</tr>
+				</table>
+				
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- //검색조건 영역 -->
+		
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-info btn-lg" onclick="fnOpenClausePopup('N');">등록</button>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+			
+			<div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let siteList = gagajf.convertToArray([[${siteList}]]);
+	let clauseTypeList = gagajf.convertToArray([[${clauseTypeList}]]);
+	
+	// specify the columns
+	let columnDefs = [
+		{headerName: "약관번호", field: "clauseSq", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "사이트", field: "siteCd", width: 150, cellClass: 'text-center', 
+			valueGetter: function(params) { return gagaAgGrid.lookupValue(siteList, params.data.siteCd); }
+		},
+		{
+			headerName: "약관유형", field: "clauseType", width: 150, cellClass: 'text-center', 
+			valueGetter: function(params) { return gagaAgGrid.lookupValue(clauseTypeList, params.data.clauseType); }
+		},
+		{
+			headerName: "약관제목", field: "clauseTitle", width: 300, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return '<a href="javascript:void(0);">' + params.value + '</a>';
+			}
+		},
+		{headerName: "표시여부", field: "useYn", width: 100, cellClass: 'text-center'}
+	];
+	
+	// Get GridOptions
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	
+	// 셀 클릭 이벤트
+	gridOptions.onCellClicked = function(event) {
+		if (event.colDef.field != 'clauseTitle')
+			return;
+		
+		fnOpenClausePopup('U', event.data.clauseSq);
+	}
+	
+	// 조회
+	$('#btnSearch').on('click', function() {
+		// Fetch data
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+	});
+	
+	// 등록/상세 팝업
+	var fnOpenClausePopup = function(mode, clauseSq) {
+		var actionUrl = '/envset/clause/detail/form' + '?mode=' + mode;
+		if (!gagajf.isNull(clauseSq)) actionUrl += '&clauseSq=' + clauseSq;
+		console.log('actionUrl: ' + actionUrl);
+		cfnOpenModalPopup(actionUrl, 'popupClause');
+	}
+	
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+/*]]>*/
+</script>
+
+</html>