index.blade.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @extends('layouts.admin.app_iframe')
  2. @section('plug-css')
  3. <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <form id="searchForm" class="form-inline">
  7. {{-- <div class="">--}}
  8. {{-- <div class="form-group">--}}
  9. {{-- <label for="name" class="label-css"> ID:</label>--}}
  10. {{-- <input class="form-control" type="text" name="id">--}}
  11. {{-- </div>--}}
  12. {{-- &ensp;&ensp;--}}
  13. {{-- <button type="button" class="btn btn-primary">查询</button>--}}
  14. {{-- </div>--}}
  15. </form>
  16. <span>角色名称:<span style="color: orangered;">{{$role->name}}</span></span>
  17. <hr class="hr-css">
  18. <div>
  19. <div id="toolbar">
  20. <div class="columns columns-left btn-group pull-left">
  21. <a class="createForm" data-url="{{ route('admin.permission.store', array('id' => $id)) }}" data-title="create" data-area-width="100%" data-area-height="100%">
  22. <button class="btn btn-default" type="button">
  23. <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;添加权限
  24. </button>
  25. </a>
  26. </div>
  27. </div>
  28. <table id="ContentTable"></table>
  29. </div>
  30. @endsection
  31. @section('plug-js')
  32. <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
  33. <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
  34. <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
  35. <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
  36. <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
  37. @endsection
  38. @section('scripts')
  39. <script>
  40. $(function(){
  41. BootStrapInit.init('tablePermission','ContentTable',{
  42. searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
  43. url: "{{ route('admin.permission.ajax.index', array('id' => $id)) }}",
  44. method: 'post',
  45. toolbar: '#toolbar',
  46. idField: '', // 指定主键列
  47. uniqueId: "id", // 这里需要指定当前查询表唯一主键字段
  48. columns: [
  49. {
  50. checkbox: true,
  51. align: 'center',
  52. valign: 'middle'
  53. },
  54. {
  55. field: 'name',
  56. title: '权限名称',
  57. align: 'center',
  58. valign: 'middle'
  59. },
  60. // {
  61. // field: 'routes',
  62. // title: '路由路径',
  63. // align: 'center',
  64. // valign: 'middle'
  65. // },
  66. // {
  67. // field: 'created_at',
  68. // title: '创建时间',
  69. // align: 'center',
  70. // valign: 'middle'
  71. // },
  72. // {
  73. // field: 'updated_at',
  74. // title: '更新时间',
  75. // align: 'center',
  76. // valign: 'middle'
  77. // },
  78. {
  79. pkId: 'id', // 当前主键id 兼容排序 field='id' 默认值id
  80. title: '操作',
  81. align: 'center',
  82. valign: 'middle',
  83. width: '185px',
  84. formatter:operateFormatter,
  85. btn_group:[
  86. {
  87. 'name' : '取消权限',
  88. 'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
  89. 'url' : 'javascript:;',
  90. 'confirm_url': '{{ route('admin.permission.destroy', ['id'=>'-val-'])}}' // 选择按钮
  91. }
  92. ]
  93. }
  94. ]
  95. });
  96. });
  97. </script>
  98. @endsection