| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <!DOCTYPE html>
- <html lang="ko"
- xmlns:th="http://www.thymeleaf.org">
- <!--
- *******************************************************************************
- * @source : UserForm.html
- * @desc : 사용자관리 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER DATE AUTHOR DESCRIPTION
- * === =========== ========== =============================================
- * 1.0 2020.10.07 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="@{'/system/user/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
- <table class="frmStyle" aria-describedby="검색조건">
- <colgroup>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- <col style="width:10%;"/>
- <col style="width:20%;"/>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- <col style="width:10%;"/>
- <col style="width:10%;"/>
- </colgroup>
- <tr>
- <th>입점벤더</th>
- <td>
- <!-- <select name="supplyCompCd"> -->
- <!-- <option th:if="${sessionInfo.supplyCompCd == null}" value="">[전체]</option> -->
- <!-- <option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option> -->
- <!-- </select> -->
- <input type="text" class="w100" name="supplyVendorCd" id="supplyCompSearchTxt" maxlength="20"/>
- <button type="button" class="btn icn" onclick="fnOpenSupplyVendorPopup('input[name=supplyVendorCd]', 'M');"><i class="fa fa-search"></i></button>
- <!-- <span id="supplyCompTxt"></span>-->
- <!-- <input type="hidden" name="supplyCompList"/>-->
- </td>
- <th>권한</th>
- <td>
- <select name="roleCd">
- <option value="">[전체]</option>
- <option th:if="${roleList}" th:each="oneData, status : ${roleList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
- </select>
- </td>
- <th>구분</th>
- <td>
- <select name="searchGb">
- <option value="">[선택]</option>
- <option value="userId">사용자ID</option>
- <option value="userNm">사용자명</option>
- </select>
- <input type="text" class="w100" name="searchTxt" placeholder="" maxlength="20"/>
- </td>
- <th>사용여부</th>
- <td>
- <select name="useYn">
- <option value="">[전체]</option>
- <option value="Y" selected="selected">[Y] Yes</option>
- <option value="N">[N] No</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" id="btnInit">초기화</button>
- </li>
- </ul>
- </form>
- </div>
- <!-- //검색조건 영역 -->
-
- <!-- 리스트 영역 -->
- <div class="panelStyle">
- <!-- 버튼 배치 영역 -->
- <ul class="panelBar">
- <li class="right">
- <button type="button" class="btn btn-info btn-lg" onclick="fnOpenUserDetailPopup('N');">등록</button>
- <button type="button" class="btn btn-danger btn-lg" id="btnDelete">사용안함</button>
- </li>
- </ul>
- <!-- //버튼 배치 영역 -->
-
- <div id="gridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
- </div>
- <!-- //리스트 영역 -->
- </div>
- <script th:inline="javascript">
- /*<![CDATA[*/
- var roleList = gagajf.convertToArray([[${roleList}]]);
-
- // specify the columns
- var columnDefs = [
- {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
- {headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
- {headerName: "사용자번호", field: "userNo", width: 100, cellClass: 'text-center', hide: true},
- {
- headerName: "메뉴", field: "btnMenu", width: 100, cellClass: 'text-center',
- cellRenderer: function(params) {
- return '<button type="button" class="btn btn-success btn-sm" onclick="fnOpenUserMenuPopup(\'' + params.data.userNo + '\');">메뉴관리</button>';
- }
- },
- {
- headerName: "사용자ID", field: "userId", width: 100, cellClass: 'text-center',
- cellRenderer: function(params) {
- return '<a href="javascript:void(0);" onclick="fnOpenUserDetailPopup(\'U\', \'' + params.data.userNo + '\');">' + params.value + '</a>';
- }
- },
- {headerName: "사용자명", field: "userNm", width: 150, cellClass: 'text-center'},
- {headerName: "권한코드", field: "roleCd", width: 100, hide: true},
- {
- headerName: "권한", field: "roleNm", width: 120, cellClass: 'text-center',
- cellRenderer: function (params) { return gagaAgGrid.lookupValue(roleList, params.data.roleCd); }
- },
- {headerName: "권한관련값", field: "roleRefVal", width: 150, cellClass: 'text-center', hide: true},
- // {headerName: "업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
- {headerName: "입점벤더", field: "supplyVendorNm", width: 150, cellClass: 'text-center'},
- {headerName: "외부몰벤더", field: "vendorNm", width: 150, cellClass: 'text-center'},
- {
- headerName: "제휴채널", field: "afLinkNm", width: 120, cellClass: 'text-center',
- cellRenderer: function(params) {
- return params.data.roleCd.indexOf('G001_D') > -1 ? params.data.afChannelNm + '-' + params.value : '';
- }
- },
- {headerName: "이메일", field: "email", width: 200, cellClass: 'text-center'},
- {headerName: "휴대전화번호", field: "cellPhnno", width: 150, cellClass: 'text-center'},
- {headerName: "IP주소", field: "ipAddr", width: 100, cellClass: 'text-center'},
- {headerName: "IP체크여부", field: "ipChkYn", width: 100, cellClass: 'text-center'},
- {headerName: "마스킹여부", field: "maskingYn", width: 100, cellClass: 'text-center'},
- {headerName: "사용여부", field: "useYn", width: 100, cellClass: 'text-center'},
- {
- headerName: '비밀번호변경일시', field: 'passwdChgDt', width: 150, cellClass: 'text-center',
- cellRenderer: function(params) {
- return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
- }
- },
- {
- headerName: '최근로그인일시', field: 'loginLdt', width: 150, cellClass: 'text-center',
- cellRenderer: function(params) {
- return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
- }
- },
- {headerName: "최종수정자", field: "updNm", width: 100, cellClass: 'text-center'},
- {
- headerName: '최종수정일시', field: 'updDt', width: 150, cellClass: 'text-center',
- cellRenderer: function(params) {
- return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
- }
- }
- ];
-
- // Get GridOptions
- var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
-
- gridOptions.rowSelection = 'multiple';
-
- // 업체 조회 팝업에서 호출
- var fnSetSupplyCompInfo = function(result) {
- var arrSupplyComp = [];
- var supplyCompTxt = "";
- var sIndex = 0;
- $('#supplyCompTxt').html('');
- $('#searchForm input[name=supplyCompSearchTxt]').val('');
-
- result.forEach(function(supplyComp) {
- sIndex++;
- arrSupplyComp.push(supplyComp.supplyCompCd);
- });
- // 조회 값이 하나일 경우 화면에 코드 노출. 그 외는 갯수 처리
- if (sIndex == 1) {
- $('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
- } else {
- supplyCompTxt = sIndex + " 개";
- $('#supplyCompTxt').html(supplyCompTxt);
- }
-
- var jsonData = JSON.stringify(arrSupplyComp);
- $("#searchForm input[name=supplyCompList]").val(jsonData);
- }
-
- // 초기화 클릭시
- $('#btnInit').on('click', function() {
- $('#searchForm')[0].reset();
- $('#searchForm input[name=supplyCompList]').val('');
- $('#supplyCompTxt').html('');
- });
-
- // 조회
- $('#btnSearch').on('click', function() {
- // Fetch data
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
- });
-
- // 삭제
- $('#btnDelete').on('click', function() {
- var removedData = gagaAgGrid.removeRowData(gridOptions);
-
- if (removedData.length == 0) {
- mcxDialog.alert('선택된 행이 없습니다.');
- return;
- }
-
- mcxDialog.confirm("사용안함으로 처리하시겠습니까?", {
- cancelBtnText: "취소",
- sureBtnText: "확인",
- sureBtnClick: function() {
- // delete 대신 update 처리해야 하므로 다음과 같이 useYn 값을 변환
- var updatedData = [];
-
- $.each(removedData, function(idx, item) {
- item.useYn = 'N';
- updatedData.push(item);
- });
-
- var jsonData = JSON.stringify(updatedData);
- gagajf.ajaxJsonSubmit('/system/user/list/delete'
- , jsonData
- , function() {
- $('#btnSearch').trigger('click');
- });
- }
- });
- });
-
- // 사용자 상세 팝업
- var fnOpenUserDetailPopup = function(mode, userNo) {
- var actionUrl = "/system/user/info/form?mode=" + mode;
- if (typeof(userNo) != 'undefined') actionUrl += "&userNo=" + userNo;
- cfnOpenModalPopup(actionUrl, "popupUser");
- }
-
- // 사용자 메뉴 팝업
- var fnOpenUserMenuPopup = function(userNo) {
- var actionUrl = "/system/user/menu/" + userNo;
- cfnOpenModalPopup(actionUrl, "popupUserMenu");
- }
- // 공급벤더 팝업
- var fnOpenSupplyVendorPopup = function(strReturnCode, strReturnName) {
- var oParam = new Object();
- oParam.returnCode = strReturnCode;
- oParam.returnName = strReturnName;
- cfnOpenSupplyVendorPopup($(strReturnName).val(), oParam);
- }
-
- $(document).ready(function() {
- // Create a agGrid
- gagaAgGrid.createGrid('gridList', gridOptions);
- });
- /*]]>*/
- </script>
- </html>
|