MailHeaderFooterForm.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : MailHeaderFooterForm.html
  7. * @desc : 메일헤더푸터관리 화면
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2021.02.01 csh9191 최초 작성
  15. * 1.1 2021.05.13 gagamel 전반적 수정
  16. *******************************************************************************
  17. -->
  18. <div id="main">
  19. <!-- 메인타이틀 영역 -->
  20. <div class="main-title">
  21. </div>
  22. <!-- //메인타이틀 영역 -->
  23. <!-- 메뉴 설명 -->
  24. <div class="infoBox menu-desc">
  25. </div>
  26. <!-- //메뉴 설명 -->
  27. <!-- 검색조건 영역 -->
  28. <div class="panelStyle">
  29. <form id="searchForm" name="searchForm" action="#" th:action="@{'/marketing/mail/headerfooter/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
  30. <table class="frmStyle" aria-describedby="검색조건">
  31. <colgroup>
  32. <col style="width:10%;"/>
  33. <col style="width:20%;"/>
  34. <col style="width:10%;"/>
  35. <col/>
  36. </colgroup>
  37. <tr>
  38. <th>구분</th>
  39. <td>
  40. <select name="mailhfGb">
  41. <option value="">[전체]</option>
  42. <option value="H">헤더</option>
  43. <option value="F">푸터</option>
  44. </select>
  45. </td>
  46. <th>헤더푸터명</th>
  47. <td>
  48. <input type="text" name="mailhfNm" class="w200" maxlength="50"/>
  49. </td>
  50. </tr>
  51. </table>
  52. <ul class="panelBar">
  53. <li class="center">
  54. <button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
  55. <button type="button" class="btn btn-info btn-lg" id="btnSearch">조회</button>
  56. </li>
  57. </ul>
  58. </form>
  59. </div>
  60. <!-- 검색조건 영역 -->
  61. <!-- 리스트 영역 -->
  62. <div class="panelStyle">
  63. <!-- 버튼 배치 영역 -->
  64. <ul class="panelBar">
  65. <li class="left">
  66. <button type="button" class="btn btn-danger btn-lg" id="btnDeleteRow">선택삭제</button>
  67. </li>
  68. <li class="right">
  69. <button type="button" class="btn btn-info btn-lg" onclick="fnOpenMailHeaderFooterPopup('N');">메일헤더푸터 등록</button>
  70. </li>
  71. </ul>
  72. <!-- //버튼 배치 영역 -->
  73. <div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
  74. </div>
  75. <!-- //리스트 영역 -->
  76. </div>
  77. <script th:inline="javascript">
  78. /*<![CDATA[*/
  79. //헤더 푸터 구분 표시
  80. let mailhfGb = { "H":"헤더", "F":"푸터" };
  81. // specify the columns
  82. let columnDefs = [
  83. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  84. {headerName: "헤더푸터번호", field: "mailhfSq", width: 150, cellClass: 'text-center'},
  85. {
  86. headerName: "헤더푸터구분", field: "mailhfGb", width: 150, cellClass: 'text-center',
  87. valueFormatter: function (params) { return gagaAgGrid.lookupValue(mailhfGb, params.value); }
  88. },
  89. {
  90. headerName: "헤더푸터명", field: "mailhfNm", width: 350,
  91. cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
  92. },
  93. {headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center'},
  94. {headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'},
  95. {
  96. headerName: "등록일시", field: "regDt", width: 150, cellClass: 'text-center',
  97. cellRenderer: function(params) { return gagaAgGrid.toDateTimeFormat(params.value); }
  98. },
  99. {headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'},
  100. {
  101. headerName: "수정일시", field: "updDt", width: 150, cellClass: 'text-center',
  102. cellRenderer: function(params) { return gagaAgGrid.toDateTimeFormat(params.value); }
  103. }
  104. ];
  105. // Get GridOptions
  106. let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  107. // 다중 선택
  108. gridOptions.rowSelection = 'multiple';
  109. // 셀 클릭 이벤트
  110. gridOptions.onCellClicked = function(event) {
  111. if (event.colDef.field != 'mailhfNm')
  112. return;
  113. fnOpenMailHeaderFooterPopup('U', event.data.mailhfSq);
  114. }
  115. // 조회
  116. $('#btnSearch').on('click', function() {
  117. gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
  118. });
  119. // 선택삭제
  120. $('#btnDeleteRow').on('click', function() {
  121. var removedData = gagaAgGrid.removeRowData(gridOptions);
  122. if (removedData.length == 0) {
  123. mcxDialog.alert('선택된 행이 없습니다.');
  124. return;
  125. }
  126. mcxDialog.confirm("삭제하시겠습니까?", {
  127. sureBtnText: "확인",
  128. cancelBtnText: "취소",
  129. sureBtnClick: function() {
  130. // delete 대신 update 처리해야 하므로 다음과 같이 useYn 값으로 처리
  131. var updatedData = [];
  132. $.each(removedData, function(idx, item) {
  133. item.useYn = 'N';
  134. updatedData.push(item);
  135. });
  136. var jsonData = JSON.stringify(updatedData);
  137. gagajf.ajaxJsonSubmit('/marketing/mail/headerfooter/list/delete', jsonData, function() {
  138. $('#btnSearch').trigger('click');
  139. });
  140. }
  141. });
  142. });
  143. // 등록/상세 팝업
  144. var fnOpenMailHeaderFooterPopup = function(mode, mailhfSq) {
  145. var actionUrl = '/marketing/mail/headerfooter/detail/form?mode=' + mode;
  146. if (!gagajf.isNull(mailhfSq)) actionUrl += '&mailhfSq=' + mailhfSq;
  147. cfnOpenModalPopup(actionUrl, 'popupMailHeaderFooter');
  148. }
  149. $(document).ready(function() {
  150. // Create a agGrid
  151. gagaAgGrid.createGrid('gridList', gridOptions);
  152. });
  153. /*]]>*/
  154. </script>
  155. </html>