administrator.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. @extends('base.base')
  2. @section('base')
  3. <!-- {{ __('messages.内容区域') }} -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="page-header">
  7. <h3 class="page-title">
  8. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  9. <i class="mdi mdi-wrench"></i>
  10. </span>
  11. {{ __('messages.管理员') }}
  12. </h3>
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item"><a href="#">{{ __('messages.系统设置') }}</a></li>
  16. <li class="breadcrumb-item active" aria-current="page">{{ __('messages.管理员管理') }}</li>
  17. </ol>
  18. </nav>
  19. </div>
  20. <div class="row">
  21. <div class="col-lg-12 grid-margin stretch-card">
  22. <div class="card">
  23. <div class="card-body">
  24. <h4 class="card-title">{{ __('messages.管理员列表') }}</h4>
  25. <p class="card-description">
  26. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="add()">
  27. <i class="mdi mdi-plus btn-icon-prepend"></i>
  28. {{ __('messages.添加管理员') }}
  29. </button>
  30. </p>
  31. <table class="table table-bordered">
  32. <thead>
  33. <tr>
  34. <th>ID</th>
  35. <th>{{ __('messages.头像') }}</th>
  36. <th>{{ __('messages.昵称') }}</th>
  37. {{-- <th>{{ __('messages.创建时间') }}</th>--}}
  38. {{-- <th>{{ __('messages.更新时间') }}</th>--}}
  39. <th>{{ __('messages.账号') }}</th>
  40. <th>{{ __('messages.角色') }}</th>
  41. <th>{{ __('messages.语言') }}</th>
  42. <th>{{ __('messages.当前彩金额度') }}</th>
  43. <th>{{ __('messages.历史已消耗彩金额度') }}</th>
  44. <th>{{ __('messages.当前单控送金额度') }}</th>
  45. <th>{{ __('messages.历史单控送金额度') }}</th>
  46. <th>{{ __('messages.渠道号') }}</th>
  47. <th>{{ __('messages.状态') }}</th>
  48. <th width="15%">{{ __('messages.操作') }}</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. @foreach($admins as $admin)
  53. <tr>
  54. <td>{{ $admin->id }}</td>
  55. <td>
  56. @if($admin->avatar)
  57. <img class="avatar" src="{{ $admin->avatar ?? "" }}" alt="image">
  58. @endif
  59. </td>
  60. <td>{{ $admin->nickname }}</td>
  61. {{-- <td>{{ $admin->created_at }}</td>--}}
  62. {{-- <td>{{$admin->updated_at}}</td>--}}
  63. <td>{{ $admin->account }}</td>
  64. <td>
  65. @foreach($admin->roles as $role)
  66. {{ $role->name }}
  67. @endforeach
  68. </td>
  69. <td>{{$admin->locale}}</td>
  70. <td>{{$admin->lottery_amount}}</td>
  71. <td>{{$admin->history_lottery_amount}}</td>
  72. <td>{{$admin->recharge_amount}}</td>
  73. <td>{{$admin->history_recharge_amount}}</td>
  74. <td style=" word-wrap: break-word;
  75. word-break: break-all; /* 任何字符间换行 */
  76. white-space: normal; /* 允许自动换行 */
  77. max-width: 30%; /* 设置一个最大宽度,根据需要调整 */">{{implode(",",json_decode($admin->channel,true))}}</td>
  78. <td>
  79. @if ($admin->status == 1)
  80. {{ __('messages.正常') }}
  81. @else
  82. {{ __('messages.禁用') }}
  83. @endif
  84. </td>
  85. <td>
  86. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{ $admin->id }})">
  87. {{ __('messages.修改') }}
  88. <i class="mdi mdi-file-check btn-icon-append"></i>
  89. </button>
  90. <button type="button" class="btn btn-sm btn-gradient-danger btn-icon-text" onclick="del({{ $admin->id }})">
  91. <i class="mdi mdi-delete btn-icon-prepend"></i>
  92. {{ __('messages.删除') }}
  93. </button>
  94. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="block({{ $admin->id }})">
  95. @if ($admin->status == 1)
  96. {{ __('messages.禁用') }}
  97. @else
  98. {{ __('messages.启用') }}
  99. @endif
  100. <i class="mdi mdi-file-check btn-icon-append"></i>
  101. </button>
  102. </td>
  103. </tr>
  104. @endforeach
  105. </tbody>
  106. </table>
  107. <div class="box-footer clearfix" id = "pages">
  108. {{ __('messages.总共') }} <b>{{ $admins->appends([
  109. ])->total() }}</b> {{ __('messages.条,分为') }}<b>{{ $admins->lastPage() }}</b> {{ __('messages.页') }}
  110. {!! $admins->links() !!}
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <script>
  119. function add(){
  120. layer.open({
  121. type: 2,
  122. title: '{{ __('messages.添加管理员') }}',
  123. shadeClose: true,
  124. shade: 0.8,
  125. area: ['100%', '100%'],
  126. content: '/admin/administrator/add'
  127. });
  128. }
  129. function update(id){
  130. var page = layer.open({
  131. type: 2,
  132. title: '{{ __('messages.修改管理员') }}',
  133. shadeClose: true,
  134. shade: 0.8,
  135. area: ['70%', '90%'],
  136. content: '/admin/administrator/update/'+id
  137. });
  138. }
  139. function del(id){
  140. myConfirm("{{ __('messages.删除操作不可逆,是否继续?') }}",function(){
  141. myRequest("/admin/administrator/del/"+id,"post",{},function(res){
  142. layer.msg(res.msg)
  143. setTimeout(function(){
  144. window.location.reload();
  145. },1500)
  146. });
  147. });
  148. }
  149. function block(id){
  150. myConfirm("{{ __('messages.是否继续?') }}",function(){
  151. myRequest("/admin/administrator/block/"+id,"post",{},function(res){
  152. layer.msg(res.msg)
  153. setTimeout(function(){
  154. window.location.reload();
  155. },1500)
  156. });
  157. });
  158. }
  159. </script>
  160. @endsection