index.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. @extends('layouts.admin.app')
  2. @section('plug-css')
  3. <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
  4. <link href="https://jqueryvalidation.org/files/demo/site-demos.css" rel="stylesheet">
  5. @endsection
  6. @section('crumbs')
  7. <ol class="breadcrumb crumbs">
  8. <li><a href="{{ route('admin.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="value" class="label-css"> 标题:</label>
  17. <input class="form-control" type="text" name="title">
  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.notice.store') }}" data-title="create" data-area-width="100%" data-area-height="100%">
  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/Ueditor/ueditor.config.js') }}" type="text/javascript"></script>
  39. <script src="{{ asset('js/Ueditor/ueditor.all.min.js') }}" type="text/javascript"></script>
  40. <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
  41. <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
  42. <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
  43. <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
  44. <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
  45. @endsection
  46. @section('scripts')
  47. <script>
  48. $(function(){
  49. BootStrapInit.init('tableNotice','ContentTable',{
  50. searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
  51. url: "{{ route('admin.notice.ajax.index') }}",
  52. method: 'post',
  53. toolbar: '#toolbar',
  54. idField: '', // 指定主键列
  55. uniqueId: "id", // 这里需要指定当前查询表唯一主键字段
  56. columns: [
  57. {
  58. checkbox: true,
  59. align: 'center',
  60. valign: 'middle'
  61. },
  62. {
  63. field: 'title',
  64. title: '标题',
  65. align: 'center',
  66. valign: 'middle'
  67. },
  68. {
  69. field: 'show',
  70. title: '显示',
  71. align: 'center',
  72. valign: 'middle',
  73. formatter:yesOrNo,
  74. bool_data:{
  75. 'class' : 'cursor',
  76. // 'url' : 'javascript:;',
  77. 'table' : 'notices'
  78. // 'pk' : 'id' // 主键名称不写默认id主键
  79. }
  80. },
  81. {
  82. field: 'new',
  83. title: '最新',
  84. align: 'center',
  85. valign: 'middle',
  86. formatter:yesOrNo,
  87. bool_data:{
  88. 'class' : 'cursor',
  89. // 'url' : 'javascript:;',
  90. 'table' : 'notices'
  91. // 'pk' : 'id' // 主键名称不写默认id主键
  92. }
  93. },
  94. {
  95. field: 'sort',
  96. title: '排序',
  97. align: 'center',
  98. valign: 'middle',
  99. formatter:inputData,
  100. input_data: {
  101. // 'class' : 'cursor', // 当前样式
  102. // 'url' : 'javascript', // url存在 及请求指定地址修改数据
  103. 'table' : 'notices' // url为空时采用,
  104. // 'pk' : 'id' // 默认修改主键名称 不写 默认id为主键
  105. }
  106. },
  107. {
  108. field: 'created_at',
  109. title: '创建时间',
  110. align: 'center',
  111. valign: 'middle'
  112. },
  113. {
  114. pkId: 'id', // 当前主键id 兼容排序 field='id' 默认值id
  115. title: '操作',
  116. align: 'center',
  117. valign: 'middle',
  118. width: '320px',
  119. formatter:operateFormatter,
  120. btn_group:[
  121. {{--{--}}
  122. {{-- 'name' : '复制链接',--}}
  123. {{-- 'class' : 'btn-info copyNoticeLink',--}}
  124. {{-- 'url' : 'javascript:;',--}}
  125. {{-- 'confirm_url': '{{ url('n', ['id'=>'-val-']) }}'--}}
  126. {{--},--}}
  127. {
  128. 'name' : '编辑',
  129. 'class' : 'btn-primary createForm',
  130. 'url' : 'javascript:;',
  131. 'areaWidth' : '100%',
  132. 'areaHeight' : '100%',
  133. 'confirm_url': '{{ route('admin.notice.edit', ['id'=>'-val-'])}}'
  134. },
  135. {
  136. 'name' : '删除',
  137. 'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
  138. 'url' : 'javascript:;',
  139. 'confirm_url': '{{ route('admin.notice.destroy', ['id'=>'-val-'])}}' // 选择按钮
  140. }
  141. ]
  142. }
  143. ]
  144. });
  145. });
  146. </script>
  147. @endsection