index.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. @extends('layouts.admin.app')
  2. @section('plug-css')
  3. <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
  4. @endsection
  5. @section('crumbs')
  6. <ol class="breadcrumb crumbs">
  7. <li><a href="{{ route('admin.index') }}#">后台导航</a></li>
  8. <li><a href="{{ route('admin.user.index') }}">后台账号首页</a></li>
  9. <li class="active">账号列表</li>
  10. </ol>
  11. @endsection
  12. @section('content')
  13. <form id="searchForm" class="form-inline">
  14. <div class="">
  15. {{-- <div class="form-group">--}}
  16. {{-- <label for="name" class="label-css"> ID:</label>--}}
  17. {{-- <input class="form-control" type="text" name="id">--}}
  18. {{-- </div>--}}
  19. {{-- &ensp;&ensp;--}}
  20. {{-- <button type="button" class="btn btn-primary">查询</button>--}}
  21. </div>
  22. </form>
  23. <hr class="hr-css">
  24. <div>
  25. <div id="toolbar">
  26. <div class="columns columns-left btn-group pull-left">
  27. <a class="createForm" data-url="{{ route('admin.user.store') }}" data-title="create">
  28. <button class="btn btn-default" type="button">
  29. <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;新增账号
  30. </button>
  31. </a>
  32. </div>
  33. </div>
  34. <table id="ContentTable"></table>
  35. </div>
  36. @endsection
  37. @section('plug-js')
  38. <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
  39. <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
  40. <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
  41. <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
  42. <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
  43. @endsection
  44. @section('scripts')
  45. <script>
  46. $(function(){
  47. BootStrapInit.init('tableUser','ContentTable',{
  48. searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
  49. url: "{{ route('admin.user.ajax.index') }}",
  50. method: 'post',
  51. toolbar: '#toolbar',
  52. idField: '', // 指定主键列
  53. uniqueId: "id", // 这里需要指定当前查询表唯一主键字段
  54. columns: [
  55. {
  56. checkbox: true,
  57. align: 'center',
  58. valign: 'middle'
  59. },
  60. {
  61. field: 'name',
  62. title: '账号名称',
  63. align: 'center',
  64. valign: 'middle'
  65. },
  66. {
  67. field: 'email',
  68. title: '账号(邮箱)',
  69. align: 'center',
  70. valign: 'middle'
  71. },
  72. {
  73. field: 'role_name',
  74. title: '角色',
  75. align: 'center',
  76. valign: 'middle'
  77. },
  78. {
  79. field: 'created_at',
  80. title: '创建时间',
  81. align: 'center',
  82. valign: 'middle'
  83. },
  84. {
  85. field: 'updated_at',
  86. title: '更新时间',
  87. align: 'center',
  88. valign: 'middle'
  89. },
  90. {
  91. pkId: 'id', // 当前主键id 兼容排序 field='id' 默认值id
  92. title: '操作',
  93. align: 'center',
  94. valign: 'middle',
  95. width: '185px',
  96. formatter:operateFormatter,
  97. btn_group:[
  98. {
  99. 'name' : '编辑',
  100. 'class' : 'btn-primary createForm',
  101. 'url' : 'javascript:;',
  102. 'confirm_url': '{{ route('admin.user.edit', ['id'=>'-val-'])}}'
  103. },
  104. {
  105. 'name' : '删除',
  106. 'class' : 'btn-danger deleteBtn',
  107. 'url' : 'javascript:;',
  108. 'confirm_url': '{{ route('admin.user.destroy', ['id'=>'-val-'])}}'
  109. }
  110. ]
  111. }
  112. ]
  113. });
  114. });
  115. </script>
  116. @endsection