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.

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