keyword_list.blade.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. @extends('admin/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-content">
  9. <form class="form-inline" id="searchForm" onsubmit="units.search();return false;">
  10. <div class="form-group" style="margin-top: 5px;">
  11. <div class="input-group">
  12. <input type="text" placeholder="请输入项目名称" class="input-md form-control"
  13. name="keyword"
  14. id="keyword">
  15. <span class="input-group-btn">
  16. <button type="button" class="btn btn-md btn-primary"
  17. onclick="units.search()"> 搜索</button>
  18. <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"
  19. name="resetBtn"> 重置</button>
  20. {{-- <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"--}}
  21. {{-- name="resetBtn" id="edit_status"> 同步勾选项</button>--}}
  22. </span>
  23. </div>
  24. </div>
  25. </form>
  26. <hr>
  27. <div class="table-responsive">
  28. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </body>
  36. @endsection
  37. @section('footer')
  38. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  39. <script>
  40. var units = {
  41. getIdsBySelections: function () {
  42. var selections = $("#table").bootstrapTable('getSelections');
  43. var ids = [];
  44. $.each(selections, function (inx, val) {
  45. ids.push(val.id);
  46. });
  47. return ids;
  48. },
  49. save: function (id,type_status) {
  50. layer.open({
  51. type: 2,
  52. content: ['/admin/sites/' + id + '/keyword'],
  53. area: ['90%', '80%'],
  54. title: '信息详情'
  55. });
  56. },
  57. search: function () {
  58. tips.selectPage();
  59. },
  60. bindDate: function (that) {
  61. var routeTime = {
  62. type: 'datetime',
  63. elem: that
  64. };
  65. laydate.render(routeTime);
  66. },
  67. save_time:function (id) {
  68. var sync_time= $('#sync_time_'+id).val();
  69. var next_sync_time=$('#next_sync_time_'+id).val();
  70. var ajaxConfig = {
  71. url: '/admin/sites/keyword_save',
  72. type: 'post',
  73. data: {
  74. //sync_time: sync_time,
  75. //next_sync_time: next_sync_time,
  76. id: id,
  77. status:1,
  78. },
  79. success: function (result) {
  80. if(result.code=='200'){
  81. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  82. tips.closeParentLayer();
  83. tips.tableRefresh('#table');
  84. });
  85. }else if(result.code=='400'){
  86. layer.msg(result.message, {icon: 5, time: 1500}, function () {
  87. tips.closeParentLayer();
  88. tips.tableRefresh('#table');
  89. });
  90. }
  91. }
  92. };
  93. tips.ajax(ajaxConfig);
  94. }
  95. };
  96. var config = {};
  97. config.url = '/admin/sites/keyword_list';
  98. config.columns = [ //字段
  99. // {checkbox: true},
  100. {
  101. title: '序号', align: 'center', formatter: function (value, item, index) {
  102. return index + 1;
  103. }
  104. },
  105. {title: '项目名称', field: 'name', align: 'center'},
  106. {title: '域名', field: 'domain', align: 'center'},
  107. {title: '项目状态', field: 'project_status_text', align: 'center'},
  108. {title: '数据同步时间', field: 'time', align: 'center',sortable: true},
  109. {title: '下次同步时间', field: 'next_time', align: 'center', sortable: true},
  110. // {title: '数据同步时间', field: 'time', align: 'center',
  111. // formatter: function (value, row) {
  112. // var str = '';
  113. // str += '<input class="form-control my-date"' +
  114. // 'onclick="units.bindDate(this)" id="sync_time_'+row.id+'" autocomplete="off"' +
  115. // 'name="initial_date" value="' + value + '" >';
  116. // return str;
  117. // },
  118. // sortable: true},
  119. // {title: '下次同步时间', field: 'next_time', align: 'center',
  120. // formatter: function (value, row) {
  121. // var str = '';
  122. // str += '<input class="form-control my-date"' +
  123. // 'onclick="units.bindDate(this)" id="next_sync_time_'+row.id+'" autocomplete="off"' +
  124. // 'name="initial_date" value="' + value + '">';
  125. //
  126. // return str;
  127. // },
  128. // sortable: true},
  129. {title: '排名系统', field: 'number_title', align: 'center', sortable: true},
  130. {
  131. title: '插队', field: 'site_id', align: 'center',
  132. formatter: function (value, row) {
  133. var str = '';
  134. str +='<button type="button" class="btn btn-success" onclick="units.save_time('+row.id+')">插队' +
  135. '</button>'
  136. return str;
  137. }
  138. },
  139. {
  140. title: '操作', field: 'site_id', align: 'center',
  141. formatter: function (value, row) {
  142. var str = '';
  143. // if (row.status === 1) {
  144. str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看详情</button>';
  145. // }
  146. return str;
  147. }
  148. },
  149. ];
  150. tips.bootstrapTable(config);
  151. $(document).on('click', '#edit_status', function () {
  152. var ids = units.getIdsBySelections();
  153. if (ids.length === 0) {
  154. layer.alert('请先选择您所要操作的对象', {icon: 0});
  155. return;
  156. }
  157. tips.ajax({url: '/admin/sites/keyword_save', type: 'post', data: {ids: ids,status:2}});
  158. tips.tableRefresh('#table');
  159. });
  160. config.onLoadSuccess = function (data) {
  161. $("#sum_total").text(data.sum_total);
  162. };
  163. laydate.render({
  164. elem: '#start_at', //指定元素
  165. type: 'datetime'
  166. });
  167. laydate.render({
  168. elem: '#end_at', //指定元素
  169. type: 'datetime'
  170. });
  171. </script>
  172. @endsection