project.blade.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. @extends('layout')
  2. @section('content')
  3. <body class="gray-bg">
  4. <div class="wrapper wrapper-content animated fadeInRight">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="ibox float-e-margins">
  8. <div class="ibox-title"></div>
  9. <div class="ibox-content">
  10. <form class="row" id="searchForm">
  11. <div class="col-md-4">
  12. <div class="input-group">
  13. <span class="input-group-btn">
  14. <button type="button" class="btn btn-md btn-info" id="on"><span
  15. class="glyphicon glyphicon-hand-up"></span> 启用</button>
  16. <button type="button" class="btn btn-md btn-warning" id="off"
  17. style="margin-left: 10px"><span
  18. class="glyphicon glyphicon-hand-down"></span> 禁用</button>
  19. <button type="button" class="btn btn-md btn-primary" id="add"
  20. style="margin-left: 10px"> <span class="glyphicon glyphicon-plus"></span> 添加</button>
  21. <button type="button" class="btn btn-md btn-danger" id="batchDelete"
  22. style="margin-left: 10px"><span
  23. class="glyphicon glyphicon-remove"></span> 删除</button>
  24. </span>
  25. </div>
  26. </div>
  27. <div class="col-md-6 pull-right">
  28. <div class="input-group">
  29. <input type="text" placeholder="请输入关键词" class="input-md form-control" name="keyWord"
  30. id="keyWord">
  31. <span class="input-group-btn">
  32. <button type="button" class="btn btn-md btn-primary"
  33. onclick="refresh()"> 搜索</button>
  34. <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"
  35. name="resetBtn"> 重置</button> </span>
  36. </div>
  37. </div>
  38. {{--<div class="col-sm-2 pull-right" style="text-align: right">--}}
  39. {{--<button type="button" class="btn btn-md btn-primary" id="addBtn"> 添加</button>--}}
  40. {{--</div>--}}
  41. </form>
  42. <hr>
  43. <div class="table-responsive">
  44. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </body>
  52. @endsection
  53. @section('footer')
  54. <script>
  55. var units = {
  56. getIdsBySelections: function () {
  57. var selections = $("#table").bootstrapTable('getSelections');
  58. var ids = [];
  59. $.each(selections, function (inx, val) {
  60. ids.push(val.id);
  61. });
  62. return ids;
  63. },
  64. edit: function (id) {
  65. layer.open({
  66. type: 2,
  67. content: ['/project/show/' + id],
  68. area: ['60%', '70%'],
  69. title: '修改'
  70. });
  71. },
  72. detail: function (id) {
  73. layer.open({
  74. type: 2,
  75. content: ['/system/user/' + id],
  76. area: ['50%', '60%'],
  77. title: '详情'
  78. });
  79. }
  80. };
  81. var config = {};
  82. config.url = '/projects';
  83. config.columns = [ //字段
  84. {checkbox: true},
  85. {
  86. title: '序号', align: 'center', formatter: function (value, item, index) {
  87. return index + 1;
  88. }
  89. },
  90. {title: '项目名称', field: 'title', align: 'center'},
  91. {title: '域名', field: 'domain', align: 'center'},
  92. {title: 'ae人员', field: 'ae_name', align: 'center'},
  93. {title: '状态', field: 'status_title', align: 'center'},
  94. {title: '创建时间', field: 'created_at', align: 'center'},
  95. {
  96. title: '操作', field: 'id', align: 'center',
  97. formatter: function (value) {
  98. return (
  99. '<button onclick="units.edit(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>&nbsp;' +
  100. '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button>'
  101. );
  102. }
  103. }
  104. ];
  105. tips.bootstrapTable(config);
  106. $(document).on('click', '#on', function () {
  107. var ids = units.getIdsBySelections();
  108. if (ids.length === 0) {
  109. layer.alert('请先选择您所要操作的对象');
  110. return;
  111. }
  112. tips.ajax({url: '/system/users/on', type: 'put', data: {ids: ids}});
  113. tips.tableRefresh('#table');
  114. });
  115. $(document).on('click', '#off', function () {
  116. var ids = units.getIdsBySelections();
  117. if (ids.length === 0) {
  118. layer.alert('请先选择您所要操作的对象');
  119. return;
  120. }
  121. tips.ajax({url: '/system/users/off', type: 'put', data: {ids: ids}});
  122. tips.tableRefresh('#table');
  123. });
  124. $(document).on('click', '#batchDelete', function () {
  125. var ids = units.getIdsBySelections();
  126. if (ids.length === 0) {
  127. layer.alert('请先选择您所要操作的对象');
  128. return;
  129. }
  130. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
  131. tips.ajax({url: '/system/users', type: 'delete', data: {ids: ids}});
  132. tips.tableRefresh('#table');
  133. });
  134. });
  135. $(document).on('click', '#add', function () {
  136. layer.open({
  137. type: 2,
  138. content: ['/project/show/0'],
  139. area: ['60%', '70%'],
  140. title: '添加'
  141. });
  142. });
  143. </script>
  144. @endsection