index.blade.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @extends('admin/layout')
  2. @section('content')
  3. <style>
  4. .btn-primary, .btn-info {
  5. background: #009688 !important;
  6. border-color: #009688 !important;
  7. }
  8. </style>
  9. <body class="gray-bg">
  10. <div class="wrapper wrapper-content animated fadeInRight">
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <div class="ibox float-e-margins">
  14. <div class="ibox-content">
  15. <form class="row" id="searchForm">
  16. <div class="col-md-6 pull-right">
  17. <div class="input-group">
  18. <input type="text" placeholder="请输入查询内容" class="input-md form-control"
  19. name="keyword" style="float: right;width: 150px;"
  20. id="keyWord" >
  21. <span class="input-group-btn">
  22. <button type="button" class="btn btn-md btn-primary"
  23. onclick="units.search()"> 搜索</button>
  24. <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"
  25. name="resetBtn"> 重置</button> </span>
  26. </div>
  27. </div>
  28. </form>
  29. <hr>
  30. <div class="table-responsive">
  31. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </body>
  39. @endsection
  40. @section('footer')
  41. <script>
  42. var units = {
  43. search: function () {
  44. tips.selectPage();
  45. },
  46. getIdsBySelections: function () {
  47. var selections = $("#table").bootstrapTable('getSelections');
  48. var ids = [];
  49. $.each(selections, function (inx, val) {
  50. ids.push(val.id);
  51. });
  52. return ids;
  53. },
  54. permission: function (roleId) {
  55. var params = '?roleIds[]=' + roleId;
  56. layer.open({
  57. type: 2,
  58. content: ['/admin/system/roles/allot-permissions' + params],
  59. area: ['40%', '100%'],
  60. title: '分配权限'
  61. });
  62. },
  63. saveView: function (id) {
  64. layer.open({
  65. type: 2,
  66. content: ['/admin/system/roles/' + id],
  67. area: ['60%', '40%'],
  68. title: '保存'
  69. });
  70. }
  71. };
  72. var config = {};
  73. config.url = '/admin/logs';
  74. config.columns = [ //字段
  75. // {checkbox: true},
  76. {
  77. title: '序号', align: 'center', formatter: function (value, item, index) {
  78. return index + 1;
  79. }
  80. },
  81. {title: '内容', field: 'content', align: 'center'},
  82. {title: '附加', field: 'addition', align: 'center'},
  83. {title: '操作人', field: 'operator_name', align: 'center'},
  84. {title: '时间', field: 'created_at', align: 'center'},
  85. // {
  86. // title: '操作', field: 'id', align: 'center',
  87. // formatter: function (value) {
  88. // return (
  89. // '<button onclick="units.saveView(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>&nbsp;' +
  90. // '<button onclick="units.permission(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>权限</button>'
  91. // );
  92. // }
  93. // }
  94. ];
  95. tips.bootstrapTable(config);
  96. $(document).on('click', '#batchDelete', function () {
  97. var ids = units.getIdsBySelections();
  98. if (ids.length === 0) {
  99. layer.alert('请先选择您所要操作的对象');
  100. return;
  101. }
  102. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
  103. tips.ajax({url: '/admin/system/roles', type: 'delete', data: {ids: ids}, tableRefresh: '#table'});
  104. });
  105. });
  106. </script>
  107. @endsection