|
@@ -1,26 +1,34 @@
|
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
|
<html lang="ko"
|
|
<html lang="ko"
|
|
|
xmlns:th="http://www.thymeleaf.org">
|
|
xmlns:th="http://www.thymeleaf.org">
|
|
|
-<!--
|
|
|
|
|
|
|
+ <!--
|
|
|
*******************************************************************************
|
|
*******************************************************************************
|
|
|
- * @source : BasicAnswerForm.html
|
|
|
|
|
- * @desc : 기본답변문구관리 Page
|
|
|
|
|
|
|
+ * @source : AnswerPhaseForm.html
|
|
|
|
|
+ * @desc : 답변문구관리 Page
|
|
|
*============================================================================
|
|
*============================================================================
|
|
|
- * Wivismall
|
|
|
|
|
- * Copyright(C) 2019 TSIT, All rights reserved.
|
|
|
|
|
|
|
+ * STYLE24
|
|
|
|
|
+ * Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
*============================================================================
|
|
*============================================================================
|
|
|
* VER DATE AUTHOR DESCRIPTION
|
|
* VER DATE AUTHOR DESCRIPTION
|
|
|
* === =========== ========== =============================================
|
|
* === =========== ========== =============================================
|
|
|
- * 1.0 2019.12.13 jaewonHo 최초 작성
|
|
|
|
|
|
|
+ * 1.0 2020.10.29 gagamel 최초 작성
|
|
|
*******************************************************************************
|
|
*******************************************************************************
|
|
|
-->
|
|
-->
|
|
|
<div id="main">
|
|
<div id="main">
|
|
|
|
|
+ <!-- 메인타이틀 영역 -->
|
|
|
<div class="main-title">
|
|
<div class="main-title">
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- //메인타이틀 영역 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 메뉴 설명 -->
|
|
|
|
|
+ <div class="infoBox menu-desc">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- //메뉴 설명 -->
|
|
|
|
|
+
|
|
|
<!-- 검색조건 영역 -->
|
|
<!-- 검색조건 영역 -->
|
|
|
- <div class="panelStyle2">
|
|
|
|
|
- <form id="searchForm" name="searchForm" action="#" th:action="@{'/system/basic/answer/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
|
|
|
|
|
- <table class="frmStyle">
|
|
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <form id="searchForm" name="searchForm" action="#" th:action="@{'/envset/answer/phase/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
|
|
|
|
|
+ <table class="frmStyle" aria-describedby="검색조건">
|
|
|
<colgroup>
|
|
<colgroup>
|
|
|
<col style="width:10%;"/>
|
|
<col style="width:10%;"/>
|
|
|
<col style="width:20%;"/>
|
|
<col style="width:20%;"/>
|
|
@@ -59,33 +67,35 @@
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</table>
|
|
|
- <div class="panelBtnB">
|
|
|
|
|
- <input type="button" value="조회" class="btn btn-base btn-lg" id="btnSearch" onclick="fnSearch();"/>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <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>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 검색조건 영역 -->
|
|
<!-- 검색조건 영역 -->
|
|
|
|
|
|
|
|
<!-- 리스트 영역 -->
|
|
<!-- 리스트 영역 -->
|
|
|
- <div class="panelStyle2">
|
|
|
|
|
- <ul class="lrStyle">
|
|
|
|
|
- <li>
|
|
|
|
|
- <button type="button" class="btn btn-default btn-lg" id="btnExcelDown" onclick="fnExcelDown();">엑셀다운로드</button>
|
|
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <!-- 버튼 배치 영역 -->
|
|
|
|
|
+ <ul class="panelBar">
|
|
|
|
|
+ <li class="right">
|
|
|
|
|
+ <button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
+ <!-- //버튼 배치 영역 -->
|
|
|
|
|
|
|
|
- <div class="panelContent" style="overflow: hidden;">
|
|
|
|
|
- <div id="gridList" style="width: 100%; height: 450px;" class="ag-theme-balham"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- //리스트 영역 -->
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<!-- 등록/수정 -->
|
|
<!-- 등록/수정 -->
|
|
|
- <div class="panelStyle2">
|
|
|
|
|
- <form id="detailForm" name="detailForm" action="#" th:action="@{'/system/basic/answer/save'}">
|
|
|
|
|
|
|
+ <div class="panelStyle">
|
|
|
|
|
+ <form id="detailForm" name="detailForm" action="#" th:action="@{'/envset/answer/phase/save'}">
|
|
|
<input type="hidden" name="ansSq" value=""/>
|
|
<input type="hidden" name="ansSq" value=""/>
|
|
|
-
|
|
|
|
|
- <table class="frmStyle">
|
|
|
|
|
|
|
+ <table class="frmStyle" aria-describedby="등록폼">
|
|
|
<colgroup>
|
|
<colgroup>
|
|
|
<col style="width:10%;"/>
|
|
<col style="width:10%;"/>
|
|
|
<col style="width:20%;"/>
|
|
<col style="width:20%;"/>
|
|
@@ -96,49 +106,50 @@
|
|
|
<col/>
|
|
<col/>
|
|
|
</colgroup>
|
|
</colgroup>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>사이트<i class="star"></i></th>
|
|
|
|
|
|
|
+ <th>사이트<em class="required" title="필수"></em></th>
|
|
|
<td>
|
|
<td>
|
|
|
<select name="siteCd" required="required" data-valid-name="사이트">
|
|
<select name="siteCd" required="required" data-valid-name="사이트">
|
|
|
<option>[전체]</option>
|
|
<option>[전체]</option>
|
|
|
<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
</select>
|
|
</select>
|
|
|
</td>
|
|
</td>
|
|
|
- <th>답변종류<i class="star"></i></th>
|
|
|
|
|
|
|
+ <th>답변종류<em class="required" title="필수"></em></th>
|
|
|
<td>
|
|
<td>
|
|
|
<select name="ansClsf" required="required" data-valid-name="답변종류">
|
|
<select name="ansClsf" required="required" data-valid-name="답변종류">
|
|
|
<option value="">[선택]</option>
|
|
<option value="">[선택]</option>
|
|
|
<option th:if="${ansClsfList}" th:each="oneData, status : ${ansClsfList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
<option th:if="${ansClsfList}" th:each="oneData, status : ${ansClsfList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
</select>
|
|
</select>
|
|
|
</td>
|
|
</td>
|
|
|
- <th>등록자</th>
|
|
|
|
|
|
|
+ <th>사용여부</th>
|
|
|
<td>
|
|
<td>
|
|
|
- <label th:text="${sessionInfo.userId}" id="regId"></label>
|
|
|
|
|
|
|
+ <input type="hidden" name="useYn" value="Y"/>
|
|
|
|
|
+ <label class="chkBox"><input type="checkbox" name="chkUseYn" checked="checked"/>사용</label>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>답변제목<i class="star"></i></th>
|
|
|
|
|
- <td colspan="3">
|
|
|
|
|
|
|
+ <th>답변제목<em class="required" title="필수"></em></th>
|
|
|
|
|
+ <td colspan="5">
|
|
|
<input type="text" name="ansTitle" required="required" data-valid-name="답변제목"/>
|
|
<input type="text" name="ansTitle" required="required" data-valid-name="답변제목"/>
|
|
|
</td>
|
|
</td>
|
|
|
- <th>사용여부</th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <input type="hidden" name="useYn" value="Y"/>
|
|
|
|
|
- <label><input type="checkbox" name="chkUseYn" checked="checked"/>사용</label>
|
|
|
|
|
- </td>
|
|
|
|
|
|
|
+
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>답변내용<i class="star"></i></th>
|
|
|
|
|
|
|
+ <th>답변내용<em class="required" title="필수"></em></th>
|
|
|
<td colspan="5">
|
|
<td colspan="5">
|
|
|
- <textarea name="ansContent" class="textareaR3" required="required" data-valid-name="답변내용" ></textarea>
|
|
|
|
|
|
|
+ <textarea name="ansContent" class="textareaR3" required="required" data-valid-name="답변내용"></textarea>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</table>
|
|
|
-
|
|
|
|
|
- <div class="panelBtnB">
|
|
|
|
|
- <button type="button" class="btn btn-success btn-lg" id="btnNew">신규</button>
|
|
|
|
|
- <button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
|
|
|
|
|
- </div>
|
|
|
|
|
</form>
|
|
</form>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 버튼 배치 영역 -->
|
|
|
|
|
+ <ul class="panelBar">
|
|
|
|
|
+ <li class="right">
|
|
|
|
|
+ <button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
|
|
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ <!-- //버튼 배치 영역 -->
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 등록/수정 -->
|
|
<!-- 등록/수정 -->
|
|
|
</div>
|
|
</div>
|
|
@@ -149,24 +160,29 @@
|
|
|
var ansClsfList = gagajf.convertToArray([[${ansClsfList}]]);
|
|
var ansClsfList = gagajf.convertToArray([[${ansClsfList}]]);
|
|
|
|
|
|
|
|
var columnDefs = [
|
|
var columnDefs = [
|
|
|
- {headerName: "답변번호", field: "ansSq", width: 150, cellClass: 'text-center'},
|
|
|
|
|
|
|
+ {headerName: "답변번호", field: "ansSq", width: 100, cellClass: 'text-center'},
|
|
|
{
|
|
{
|
|
|
headerName: "사이트", field: "siteCd", width: 150, cellClass: 'text-center',
|
|
headerName: "사이트", field: "siteCd", width: 150, cellClass: 'text-center',
|
|
|
- valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteList, params.value); }
|
|
|
|
|
|
|
+ valueGetter: function (params) { return gagaAgGrid.lookupValue(siteList, params.data.siteCd); }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
headerName: "답변종류", field: "ansClsf", width: 150, cellClass: 'text-center',
|
|
headerName: "답변종류", field: "ansClsf", width: 150, cellClass: 'text-center',
|
|
|
- valueFormatter: function (params) { return gagaAgGrid.lookupValue(ansClsfList, params.value); }
|
|
|
|
|
|
|
+ valueGetter: function (params) { return gagaAgGrid.lookupValue(ansClsfList, params.data.ansClsf); }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
headerName: "답변제목", field: "ansTitle", width: 350,
|
|
headerName: "답변제목", field: "ansTitle", width: 350,
|
|
|
cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
|
|
cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
|
|
|
},
|
|
},
|
|
|
{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'},
|
|
{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'},
|
|
|
- {headerName: "등록자ID", field: "regId", width: 150, cellClass: 'text-center'},
|
|
|
|
|
|
|
+ {headerName: "등록자", field: "regNm", width: 150, cellClass: 'text-center'},
|
|
|
{
|
|
{
|
|
|
- headerName: "등록일", field: "regDt", width: 100, cellClass: 'text-center',
|
|
|
|
|
- cellRenderer: function(params) { return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDD").format("YYYY-MM-DD") : ''; }
|
|
|
|
|
|
|
+ headerName: "등록일시", field: "regDt", width: 150, cellClass: 'text-center',
|
|
|
|
|
+ cellRenderer: function(params) { return gagaAgGrid.toDateTimeFormat(params.value); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'},
|
|
|
|
|
+ {
|
|
|
|
|
+ headerName: "수정일시", field: "updDt", width: 150, cellClass: 'text-center',
|
|
|
|
|
+ cellRenderer: function(params) { return gagaAgGrid.toDateTimeFormat(params.value); }
|
|
|
}
|
|
}
|
|
|
];
|
|
];
|
|
|
|
|
|
|
@@ -177,88 +193,61 @@
|
|
|
if (event.colDef.field != 'ansTitle')
|
|
if (event.colDef.field != 'ansTitle')
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- $('#detailForm input[name=ansSq]').val(event.data.ansSq); // 답변일련번호
|
|
|
|
|
- $('#detailForm select[name=siteCd]').val(event.data.siteCd); // 사이트
|
|
|
|
|
- $('#detailForm select[name=ansClsf]').val(event.data.ansClsf); // 답변종류
|
|
|
|
|
- $('#regId').html(event.data.regId); // 등록자ID
|
|
|
|
|
- $('#detailForm input[name=ansTitle]').val(event.data.ansTitle.replaceAll('>','>')); // 답변제목
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $('#detailForm input[name=ansSq]').val(event.data.ansSq); // 답변일련번호
|
|
|
|
|
+ $('#detailForm select[name=siteCd]').val(event.data.siteCd); // 사이트
|
|
|
|
|
+ $('#detailForm select[name=ansClsf]').val(event.data.ansClsf); // 답변종류
|
|
|
|
|
+
|
|
|
if (event.data.useYn == 'Y') {
|
|
if (event.data.useYn == 'Y') {
|
|
|
$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', true);
|
|
$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', true);
|
|
|
- $("#detailForm input:checkbox[name=chkUseYn]").parent().addClass('checked');
|
|
|
|
|
} else {
|
|
} else {
|
|
|
$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', false);
|
|
$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', false);
|
|
|
- $("#detailForm input:checkbox[name=chkUseYn]").parent().removeClass('checked');
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $('#detailForm textarea[name=ansContent]').val(event.data.ansContent); // 답변내용
|
|
|
|
|
|
|
+ $('#detailForm input[name=ansTitle]').val(event.data.ansTitle.replaceAll('>','>')); // 답변제목
|
|
|
|
|
+ $('#detailForm textarea[name=ansContent]').val(event.data.ansContent); // 답변내용
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 검색
|
|
|
|
|
+ $('#btnSearch').on('click', function() {
|
|
|
|
|
+ gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 신규
|
|
// 신규
|
|
|
$('#btnNew').on('click', function() {
|
|
$('#btnNew').on('click', function() {
|
|
|
$('#detailForm')[0].reset();
|
|
$('#detailForm')[0].reset();
|
|
|
$('#detailForm input[name=ansSq]').val('');
|
|
$('#detailForm input[name=ansSq]').val('');
|
|
|
$('#detailForm input[name=ansTitle]').focus();
|
|
$('#detailForm input[name=ansTitle]').focus();
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- // 검색
|
|
|
|
|
- var fnSearch = function() {
|
|
|
|
|
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
// 저장/수정
|
|
// 저장/수정
|
|
|
- $("#btnSave").on("click", function(formId){
|
|
|
|
|
- var formId = '#detailForm';
|
|
|
|
|
-
|
|
|
|
|
- var selectedData = gridOptions.api.getSelectedRows();
|
|
|
|
|
-
|
|
|
|
|
- //필수값 체크
|
|
|
|
|
- if (!gagajf.validation(formId))
|
|
|
|
|
|
|
+ $("#btnSave").on("click", function() {
|
|
|
|
|
+ // 필수값 체크
|
|
|
|
|
+ if (!gagajf.validation('#detailForm'))
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
- var msg = '저장하시겠습니까?';
|
|
|
|
|
- if (selectedData.length == 0) {
|
|
|
|
|
- msg = '등록하시겠습니까?';
|
|
|
|
|
- }
|
|
|
|
|
- var ansSq = $(formId + " input[name=ansSq]").val();
|
|
|
|
|
- var siteCd = $(formId + " select[name=siteCd").val(); // 사이트
|
|
|
|
|
- var ansClsf = $(formId + " select[name=ansClsf]").val(); // 답변종류
|
|
|
|
|
- var ansTitle = $(formId + " input[name=ansTitle]").val(); // 답변제목
|
|
|
|
|
- var ansContent = $(formId + " textarea[name=ansContent]").val(); // 답변내용
|
|
|
|
|
- var useYn = $(formId + ' input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N'; // 사용여부
|
|
|
|
|
-
|
|
|
|
|
- var data = {
|
|
|
|
|
- ansSq : ansSq,
|
|
|
|
|
- siteCd : siteCd,
|
|
|
|
|
- ansClsf : ansClsf,
|
|
|
|
|
- ansTitle : ansTitle,
|
|
|
|
|
- ansContent : ansContent,
|
|
|
|
|
- useYn : useYn
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- mcxDialog.confirm(msg, {
|
|
|
|
|
|
|
+ mcxDialog.confirm('저장하시겠습니까?', {
|
|
|
cancelBtnText: "취소",
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
sureBtnClick: function() {
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
|
|
|
|
+ $('#detailForm input[name=useYn]').val($('#detailForm input:checkbox[name=chkUseYn]').is(':checked') ? 'Y' : 'N');
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxFormSubmit($('#detailForm').prop('action'), '#detailForm', function() {
|
|
|
|
|
+ $('btnNew').click();
|
|
|
|
|
+ $('#btnSearch').trigger('click');
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
gagajf.ajaxJsonSubmit($(formId).prop("action"), jsonData, fnSaveCallback);
|
|
gagajf.ajaxJsonSubmit($(formId).prop("action"), jsonData, fnSaveCallback);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- //저장후 콜백
|
|
|
|
|
- var fnSaveCallback = function() {
|
|
|
|
|
- fnSearch();
|
|
|
|
|
- $("#btnNew").click();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 엑셀다운로드
|
|
|
|
|
+ $('#btnExcel').on('click', function() {
|
|
|
|
|
+ gagaAgGrid.exportToExcel('답변문구 목록', gridOptions);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|
|
|
-
|
|
|
|
|
- // Grid 높이 조정
|
|
|
|
|
- uifnFitGrid();
|
|
|
|
|
-
|
|
|
|
|
- fnSearch();
|
|
|
|
|
});
|
|
});
|
|
|
/*]]>*/
|
|
/*]]>*/
|
|
|
</script>
|
|
</script>
|