permission.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  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. {{ __('auto.权限') }}
  12. </h3>
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item"><a href="#">{{ __('auto.系统设置') }}</a></li>
  16. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.权限管理') }}</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">{{ __('auto.权限列表') }}</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. {{ __('auto.添加权限') }}
  29. </button>
  30. </p>
  31. <table class="table table-bordered">
  32. <thead>
  33. <tr>
  34. <th width="5%">ID</th>
  35. <th width="10%">{{ __('auto.权限名') }}</th>
  36. <th width="35%">{{ __('auto.路由') }}</th>
  37. <th width="15%">{{ __('auto.创建时间') }}</th>
  38. <th width="15%">{{ __('auto.更新时间') }}</th>
  39. <th width="20%">{{ __('auto.操作') }}</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. @foreach($list as $permission)
  44. <tr>
  45. <td>{{ $permission->id }}</td>
  46. <td>{{ $permission->name }}</td>
  47. <td style="word-wrap:break-word;word-break:break-all">
  48. @foreach($permission->routes as $route)
  49. <label class="badge badge-success">{{$route}}</label>
  50. @endforeach
  51. </td>
  52. <td>{{ $permission->created_at }}</td>
  53. <td>{{ $permission->updated_at }}</td>
  54. <td>
  55. <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{ $permission->id }})">
  56. {{ __('auto.修改') }}
  57. <i class="mdi mdi-file-check btn-icon-append"></i>
  58. </button>
  59. <button type="button" class="btn btn-sm btn-gradient-danger btn-icon-text" onclick="del({{ $permission->id }})">
  60. <i class="mdi mdi-delete btn-icon-prepend"></i>
  61. {{ __('auto.删除') }}
  62. </button>
  63. </td>
  64. </tr>
  65. @endforeach
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <script>
  75. function add(){
  76. layer.open({
  77. type: 2,
  78. title: '{{ __('auto.添加权限') }}',
  79. shadeClose: true,
  80. shade: 0.8,
  81. area: ['70%', '90%'],
  82. content: '/admin/permission/add'
  83. });
  84. }
  85. function update(id){
  86. var page = layer.open({
  87. type: 2,
  88. title: '{{ __('auto.修改权限') }}',
  89. shadeClose: true,
  90. shade: 0.8,
  91. area: ['70%', '90%'],
  92. content: '/admin/permission/update/'+id
  93. });
  94. }
  95. function del(id){
  96. myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?",function(){
  97. myRequest("/admin/permission/del/"+id,"post",{},function(res){
  98. layer.msg(res.msg)
  99. setTimeout(function(){
  100. window.location.reload();
  101. },1500)
  102. });
  103. });
  104. }
  105. </script>
  106. @endsection