index.blade.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 class="active">路由地址列表</li>
  9. </ol>
  10. @endsection
  11. @section('content')
  12. <form id="searchForm" class="form-inline">
  13. <div class="">
  14. <div class="form-group">
  15. <label for="name" class="label-css"> 地址名称:</label>
  16. <input class="form-control" type="text" name="url_name">
  17. </div>
  18. &ensp;&ensp;
  19. <button type="button" class="btn btn-primary">查询</button>
  20. </div>
  21. </form>
  22. <hr class="hr-css">
  23. <div>
  24. <div id="toolbar">
  25. <div class="columns columns-left btn-group pull-left">
  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('tableMenuUrl','ContentTable',{
  42. searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
  43. url: "{{ route('admin.menuUrl.ajax.index') }}",
  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: 'id',
  56. title: 'ID',
  57. align: 'center',
  58. valign: 'middle',
  59. },
  60. {
  61. field: 'url_name',
  62. title: '地址名称',
  63. align: 'center',
  64. },
  65. {
  66. field: 'url',
  67. title: 'url地址',
  68. align: 'center',
  69. },
  70. {
  71. field: 'menu_name',
  72. title: '所属菜单',
  73. align: 'center',
  74. },
  75. {
  76. field: 'created_at',
  77. title: '创建时间',
  78. align: 'center',
  79. valign: 'middle',
  80. },
  81. {
  82. field: 'updated_at',
  83. title: '更新时间',
  84. align: 'center',
  85. valign: 'middle',
  86. },
  87. {
  88. pkId: 'id', // 当前主键id 兼容排序 field='id' 默认值id
  89. title: '操作',
  90. align: 'center',
  91. valign: 'middle',
  92. width: '185px',
  93. formatter:operateFormatter,
  94. btn_group:[
  95. {
  96. 'name' : '编辑',
  97. 'class' : 'btn-primary createForm',
  98. 'url' : 'javascript:;',
  99. 'confirm_url': '{{ route('admin.menuUrl.edit', ['id'=>'-val-'])}}'
  100. }
  101. ]
  102. }
  103. ]
  104. });
  105. });
  106. </script>
  107. @endsection