UserForm.html 10 KB

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