UserForm.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * @source : UserForm.html
  7. * @desc : 사용자관리 Page
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2020.10.07 gagamel 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div id="main">
  18. <!-- 메인타이틀 영역 -->
  19. <div class="main-title">
  20. </div>
  21. <!-- //메인타이틀 영역 -->
  22. <!-- 메뉴 설명 -->
  23. <div class="infoBox menu-desc">
  24. </div>
  25. <!-- //메뉴 설명 -->
  26. <!-- 검색조건 영역 -->
  27. <div class="panelStyle">
  28. <form id="searchForm" name="searchForm" action="#" th:action="@{'/system/user/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
  29. <table class="frmStyle" aria-describedby="검색조건">
  30. <colgroup>
  31. <col style="width:10%;"/>
  32. <col style="width:15%;"/>
  33. <col style="width:10%;"/>
  34. <col style="width:20%;"/>
  35. <col style="width:10%;"/>
  36. <col style="width:15%;"/>
  37. <col style="width:10%;"/>
  38. <col style="width:10%;"/>
  39. </colgroup>
  40. <tr>
  41. <th>입점벤더</th>
  42. <td>
  43. <!-- <select name="supplyCompCd"> -->
  44. <!-- <option th:if="${sessionInfo.supplyCompCd == null}" value="">[전체]</option> -->
  45. <!-- <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option> -->
  46. <!-- </select> -->
  47. <input type="hidden" class="w100" name="supplyVendorCd" id="supplyCompSearchTxt" maxlength="20"/>
  48. <input type="text" class="w100" name="supplyVendorNm" id="supplyVendorNm" maxlength="20"/>
  49. <button type="button" class="btn icn" onclick="fnOpenSupplyVendorPopup('input[name=supplyVendorCd]', 'input[name=supplyVendorNm]');"><i class="fa fa-search"></i></button>
  50. <!-- <span id="supplyCompTxt"></span>-->
  51. <!-- <input type="hidden" name="supplyCompList"/>-->
  52. </td>
  53. <th>권한</th>
  54. <td>
  55. <select name="roleCd">
  56. <option value="">[전체]</option>
  57. <option th:if="${roleList}" th:each="oneData, status : ${roleList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
  58. </select>
  59. </td>
  60. <th>구분</th>
  61. <td>
  62. <select name="searchGb">
  63. <option value="">[선택]</option>
  64. <option value="userId">사용자ID</option>
  65. <option value="userNm">사용자명</option>
  66. </select>
  67. <input type="text" class="w100" name="searchTxt" placeholder="" maxlength="20"/>
  68. </td>
  69. <th>사용여부</th>
  70. <td>
  71. <select name="useYn">
  72. <option value="">[전체]</option>
  73. <option value="Y" selected="selected">[Y] Yes</option>
  74. <option value="N">[N] No</option>
  75. </select>
  76. </td>
  77. </tr>
  78. </table>
  79. <ul class="panelBar">
  80. <li class="center">
  81. <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
  82. <button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
  83. </li>
  84. </ul>
  85. </form>
  86. </div>
  87. <!-- //검색조건 영역 -->
  88. <!-- 리스트 영역 -->
  89. <div class="panelStyle">
  90. <!-- 버튼 배치 영역 -->
  91. <ul class="panelBar">
  92. <li class="right">
  93. <button type="button" class="btn btn-info btn-lg" onclick="fnOpenUserDetailPopup('N');">등록</button>
  94. <button type="button" class="btn btn-danger btn-lg" id="btnDelete">사용안함</button>
  95. </li>
  96. </ul>
  97. <!-- //버튼 배치 영역 -->
  98. <div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
  99. </div>
  100. <!-- //리스트 영역 -->
  101. </div>
  102. <script th:inline="javascript">
  103. /*<![CDATA[*/
  104. var roleList = gagajf.convertToArray([[${roleList}]]);
  105. // specify the columns
  106. var columnDefs = [
  107. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
  108. {headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
  109. {headerName: "사용자번호", field: "userNo", width: 100, cellClass: 'text-center', hide: true},
  110. {
  111. headerName: "메뉴", field: "btnMenu", width: 100, cellClass: 'text-center',
  112. cellRenderer: function(params) {
  113. return '<button type="button" class="btn btn-success btn-sm" onclick="fnOpenUserMenuPopup(\'' + params.data.userNo + '\');">메뉴관리</button>';
  114. }
  115. },
  116. {
  117. headerName: "사용자ID", field: "userId", width: 100, cellClass: 'text-center',
  118. cellRenderer: function(params) {
  119. return '<a href="javascript:void(0);" onclick="fnOpenUserDetailPopup(\'U\', \'' + params.data.userNo + '\');">' + params.value + '</a>';
  120. }
  121. },
  122. {headerName: "사용자명", field: "userNm", width: 150, cellClass: 'text-center'},
  123. {headerName: "권한코드", field: "roleCd", width: 100, hide: true},
  124. {
  125. headerName: "권한", field: "roleNm", width: 120, cellClass: 'text-center',
  126. cellRenderer: function (params) { return gagaAgGrid.lookupValue(roleList, params.data.roleCd); }
  127. },
  128. {headerName: "권한관련값", field: "roleRefVal", width: 150, cellClass: 'text-center', hide: true},
  129. // {headerName: "업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
  130. {headerName: "입점벤더", field: "supplyVendorNm", width: 150, cellClass: 'text-center'},
  131. {headerName: "외부몰벤더", field: "vendorNm", width: 150, cellClass: 'text-center'},
  132. {
  133. headerName: "제휴채널", field: "afLinkNm", width: 120, cellClass: 'text-center',
  134. cellRenderer: function(params) {
  135. return params.data.roleCd.indexOf('G001_D') > -1 ? params.data.afChannelNm + '-' + params.value : '';
  136. }
  137. },
  138. {headerName: "이메일", field: "email", width: 200, cellClass: 'text-center'},
  139. {headerName: "휴대전화번호", field: "cellPhnno", width: 150, cellClass: 'text-center'},
  140. {headerName: "IP주소", field: "ipAddr", width: 100, cellClass: 'text-center'},
  141. {headerName: "IP체크여부", field: "ipChkYn", width: 100, cellClass: 'text-center'},
  142. {headerName: "마스킹여부", field: "maskingYn", width: 100, cellClass: 'text-center'},
  143. {headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center'},
  144. {
  145. headerName: '비밀번호변경일시', field: 'passwdChgDt', width: 150, cellClass: 'text-center',
  146. cellRenderer: function(params) {
  147. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  148. }
  149. },
  150. {
  151. headerName: '최근로그인일시', field: 'loginLdt', width: 150, cellClass: 'text-center',
  152. cellRenderer: function(params) {
  153. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  154. }
  155. },
  156. {headerName: "최종수정자", field: "updNm", width: 100, cellClass: 'text-center'},
  157. {
  158. headerName: '최종수정일시', field: 'updDt', width: 150, cellClass: 'text-center',
  159. cellRenderer: function(params) {
  160. return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
  161. }
  162. }
  163. ];
  164. // Get GridOptions
  165. var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
  166. gridOptions.rowSelection = 'multiple';
  167. // 업체 조회 팝업에서 호출
  168. var fnSetSupplyCompInfo = function(result) {
  169. var arrSupplyComp = [];
  170. var supplyCompTxt = "";
  171. var sIndex = 0;
  172. $('#supplyCompTxt').html('');
  173. $('#searchForm input[name=supplyCompSearchTxt]').val('');
  174. result.forEach(function(supplyComp) {
  175. sIndex++;
  176. arrSupplyComp.push(supplyComp.supplyCompCd);
  177. });
  178. // 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
  179. if (sIndex == 1) {
  180. $('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
  181. } else {
  182. supplyCompTxt = sIndex + " 개";
  183. $('#supplyCompTxt').html(supplyCompTxt);
  184. }
  185. var jsonData = JSON.stringify(arrSupplyComp);
  186. $("#searchForm input[name=supplyCompList]").val(jsonData);
  187. }
  188. // 초기화 클릭시
  189. $('#btnInit').on('click', function() {
  190. $('#searchForm')[0].reset();
  191. $('#searchForm input[name=supplyCompList]').val('');
  192. $('#supplyCompTxt').html('');
  193. // 2021.12.08 card007 초기화 버튼 입점벤더 처리 추가
  194. $('#searchForm input[name=supplyVendorCd]').val('');
  195. $('#searchForm input[name=supplyVendorNm]').val('');
  196. });
  197. // 조회
  198. $('#btnSearch').on('click', function() {
  199. // Fetch data
  200. gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
  201. });
  202. // 삭제
  203. $('#btnDelete').on('click', function() {
  204. var removedData = gagaAgGrid.removeRowData(gridOptions);
  205. if (removedData.length == 0) {
  206. mcxDialog.alert('선택된 행이 없습니다.');
  207. return;
  208. }
  209. mcxDialog.confirm("사용안함으로 처리하시겠습니까?", {
  210. cancelBtnText: "취소",
  211. sureBtnText: "확인",
  212. sureBtnClick: function() {
  213. // delete 대신 update 처리해야 하므로 다음과 같이 useYn 값을 변환
  214. var updatedData = [];
  215. $.each(removedData, function(idx, item) {
  216. item.useYn = 'N';
  217. updatedData.push(item);
  218. });
  219. var jsonData = JSON.stringify(updatedData);
  220. gagajf.ajaxJsonSubmit('/system/user/list/delete'
  221. , jsonData
  222. , function() {
  223. $('#btnSearch').trigger('click');
  224. });
  225. }
  226. });
  227. });
  228. // 사용자 상세 팝업
  229. var fnOpenUserDetailPopup = function(mode, userNo) {
  230. var actionUrl = "/system/user/info/form?mode=" + mode;
  231. if (typeof(userNo) != 'undefined') actionUrl += "&userNo=" + userNo;
  232. cfnOpenModalPopup(actionUrl, "popupUser");
  233. }
  234. // 사용자 메뉴 팝업
  235. var fnOpenUserMenuPopup = function(userNo) {
  236. var actionUrl = "/system/user/menu/" + userNo;
  237. cfnOpenModalPopup(actionUrl, "popupUserMenu");
  238. }
  239. // 공급벤더 팝업
  240. var fnOpenSupplyVendorPopup = function(strReturnCode, strReturnName) {
  241. var oParam = new Object();
  242. oParam.returnCode = strReturnCode;
  243. oParam.returnName = strReturnName;
  244. cfnOpenSupplyVendorPopup($(strReturnName).val(), oParam);
  245. }
  246. $(document).ready(function() {
  247. // Create a agGrid
  248. gagaAgGrid.createGrid('gridList', gridOptions);
  249. });
  250. /*]]>*/
  251. </script>
  252. </html>