2
0

administrator.blade.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. <div class="table-responsive">
  32. <table class="table table-bordered">
  33. <thead>
  34. <tr>
  35. <th>ID</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>{{ __('messages.状态') }}</th>
  49. <th width="15%">{{ __('messages.操作') }}</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. @foreach($admins as $admin)
  54. <tr>
  55. <td>{{ $admin->id }}</td>
  56. <td>
  57. @if($admin->avatar)
  58. <img class="avatar" src="{{ $admin->avatar ?? "" }}" alt="image">
  59. @endif
  60. </td>
  61. <td>{{ $admin->nickname }}</td>
  62. {{-- <td>{{ $admin->created_at }}</td>--}}
  63. {{-- <td>{{$admin->updated_at}}</td>--}}
  64. <td>{{ $admin->account }}</td>
  65. <td>
  66. @foreach($admin->roles as $role)
  67. {{ $role->name }}
  68. @endforeach
  69. </td>
  70. <td>{{$admin->locale}}</td>
  71. <td>{{$admin->lottery_amount}}</td>
  72. <td>{{$admin->history_lottery_amount}}</td>
  73. <td>{{$admin->recharge_amount}}</td>
  74. <td>{{$admin->history_recharge_amount}}</td>
  75. <td style=" word-wrap: break-word;
  76. word-break: break-all; /* 任何字符间换行 */
  77. white-space: normal; /* 允许自动换行 */
  78. max-width: 30%; /* 设置一个最大宽度,根据需要调整 */">{{implode(",",json_decode($admin->channel,true))}}</td>
  79. <td>
  80. @if ($admin->status == 1)
  81. {{ __('messages.正常') }}
  82. @else
  83. {{ __('messages.禁用') }}
  84. @endif
  85. </td>
  86. <td>
  87. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{ $admin->id }})">
  88. {{ __('messages.修改') }}
  89. <i class="mdi mdi-file-check btn-icon-append"></i>
  90. </button>
  91. <button type="button" class="btn btn-sm btn-gradient-danger btn-icon-text" onclick="del({{ $admin->id }})">
  92. <i class="mdi mdi-delete btn-icon-prepend"></i>
  93. {{ __('messages.删除') }}
  94. </button>
  95. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="block({{ $admin->id }})">
  96. @if ($admin->status == 1)
  97. {{ __('messages.禁用') }}
  98. @else
  99. {{ __('messages.启用') }}
  100. @endif
  101. <i class="mdi mdi-file-check btn-icon-append"></i>
  102. </button>
  103. </td>
  104. </tr>
  105. @endforeach
  106. </tbody>
  107. </table>
  108. </div>
  109. <div class="box-footer clearfix" id = "pages">
  110. {{ __('messages.总共') }} <b>{{ $admins->appends([
  111. ])->total() }}</b> {{ __('messages.条,分为') }}<b>{{ $admins->lastPage() }}</b> {{ __('messages.页') }}
  112. {!! $admins->links() !!}
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <script>
  121. function add(){
  122. layer.open({
  123. type: 2,
  124. title: '{{ __('messages.添加管理员') }}',
  125. shadeClose: true,
  126. shade: 0.8,
  127. area: ['100%', '100%'],
  128. content: '/admin/administrator/add'
  129. });
  130. }
  131. function update(id){
  132. var page = layer.open({
  133. type: 2,
  134. title: '{{ __('messages.修改管理员') }}',
  135. shadeClose: true,
  136. shade: 0.8,
  137. area: ['70%', '90%'],
  138. content: '/admin/administrator/update/'+id
  139. });
  140. }
  141. function del(id){
  142. myConfirm("{{ __('messages.删除操作不可逆,是否继续?') }}",function(){
  143. myRequest("/admin/administrator/del/"+id,"post",{},function(res){
  144. layer.msg(res.msg)
  145. setTimeout(function(){
  146. window.location.reload();
  147. },1500)
  148. });
  149. });
  150. }
  151. function block(id){
  152. myConfirm("{{ __('messages.是否继续?') }}",function(){
  153. myRequest("/admin/administrator/block/"+id,"post",{},function(res){
  154. layer.msg(res.msg)
  155. setTimeout(function(){
  156. window.location.reload();
  157. },1500)
  158. });
  159. });
  160. }
  161. </script>
  162. @endsection