You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.3 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <div class="page-header" data-fit-aside>
  2. <h1 class="page-title">관리자 관리</h1>
  3. </div>
  4. <div class="ax-button-group" data-fit-aside>
  5. <div class="left">
  6. <button type="button" class="btn btn-primary" onclick="grid.form()"><i class="fal fa-plus"></i> 관리자 추가</button>
  7. </div>
  8. </div>
  9. <div class="grid-wrapper" data-fit-content>
  10. <div class="grid-container" id="grid-container"></div>
  11. </div>
  12. <script>
  13. var grid = new GRID('#grid-container', {
  14. columns: [
  15. {caption:'순번', dataField:'nums', alignment:'right', dataType:'number', format:'fixedPoint', width:80},
  16. {caption:'아이디', dataField:'mem_userid', width:200},
  17. {caption:'이름', dataField:'mem_nickname', alignment:'center', width:80},
  18. {caption:'가입일시', dataField:'mem_regtime', alignment:'center', width:120},
  19. {caption:'가입IP', dataField:'regip', alignment:'center', width:120},
  20. {caption:'최근로그인', dataField:'mem_logtime', alignment:'center', width:120},
  21. {caption:'최근로그인IP', dataField:'logip', alignment:'center', width:120},
  22. {caption:'', calculateCellValue:function(e) {return ''}}
  23. ],
  24. dataSource: new DevExpress.data.DataSource({
  25. key : 'mem_idx',
  26. load: function(loadOptions) {
  27. var d = $.Deferred();
  28. var params = grid.getSearchParam(loadOptions);
  29. $.ajax({
  30. url : base_url + '/admin/ajax/setting/admins',
  31. type: 'GET',
  32. async: false,
  33. cache: false,
  34. data: params
  35. }).done(function(res) {
  36. d.resolve(res.lists, {
  37. totalCount : res.totalCount
  38. });
  39. });
  40. return d.promise();
  41. }
  42. }),
  43. onContextMenuPreparing: function(e) {
  44. if (e.row.rowType === "data") {
  45. e.items = [
  46. {
  47. icon : 'trash',
  48. text: "삭제",
  49. onItemClick: function () {
  50. grid.delete(e.row.data);
  51. }
  52. }
  53. ]
  54. }
  55. }
  56. });
  57. grid.form = function() {
  58. APP.MODAL.callback = function() {
  59. APP.MODAL.close();
  60. grid.refresh();
  61. };
  62. APP.MODAL.open({
  63. iframe : {
  64. url : base_url + '/admin/setting/admin_add'
  65. },
  66. header : {
  67. title : '관리자 추가'
  68. },
  69. width: 800,
  70. height:600
  71. })
  72. };
  73. grid.delete = function(data) {
  74. if( ! confirm('[' + data.mem_nickname + '] 님의 관리자 권한을 제거하고 권한레벨을 초기값으로 설정하시겠습니까?') ) return false;
  75. $.ajax({
  76. url : '/admin/ajax/setting/admins',
  77. type : 'DELETE',
  78. data : {
  79. mem_idx : data.mem_idx
  80. },
  81. success:function(res) {
  82. toastr.success('['+data.mem_nickname+'] 님의 관리자 권한을 제거하였습니다.');
  83. grid.refresh();
  84. }
  85. })
  86. };
  87. $(function() {
  88. grid.init();
  89. })
  90. </script>