task.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. @extends('admin/layout')
  2. @section('content')
  3. @php $notCustomerBool=false @endphp
  4. @notCustomer
  5. @php $notCustomerBool=true @endphp
  6. @endNotCustomer
  7. <body class="gray-bg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox">
  13. <div class="ibox-content">
  14. <form class="row" id="searchForm">
  15. @notCustomer
  16. <div class="col-md-2">
  17. <div class="input-group">
  18. <span class="input-group-btn">
  19. <button type="button" class="btn btn-md btn-primary" onclick="units.save(0)"
  20. style="margin-left: 10px;border-radius:2px;"> <span class="glyphicon glyphicon-plus"></span> 添加</button>
  21. <button type="button" class="btn btn-md btn-danger" onclick="units.delete()"
  22. style="margin-left: 10px;border-radius:2px;"><span
  23. class="glyphicon glyphicon-remove"></span> 删除</button>
  24. </span>
  25. </div>
  26. </div>
  27. @endNotCustomer
  28. <div class="col-md-8">
  29. <input type="hidden" name="status" id="status">
  30. <div class="btn-group" role="group">
  31. <button type="button" class="btn btn-primary" onclick="units.status(0,this)" style="border-radius:2px;">
  32. 全部
  33. </button>
  34. <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
  35. onclick="units.status(2,this)">
  36. 任务中
  37. </button>
  38. <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
  39. onclick="units.status(3,this)">
  40. 待审核
  41. </button>
  42. <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
  43. onclick="units.status(4,this)">
  44. 未通过
  45. </button>
  46. <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
  47. onclick="units.status(5,this)">
  48. 已通过
  49. </button>
  50. <button type="button" class="btn btn-primary"
  51. style="margin-left: 10px;;border-radius:2px;display: none"
  52. onclick="units.translate()" id="auto-translate">
  53. 翻译
  54. </button>
  55. </div>
  56. </div>
  57. </form>
  58. <hr>
  59. <div class="table-responsive">
  60. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </body>
  69. @endsection
  70. @section('footer')
  71. <script>
  72. // parent.window.open('http://www.baidu.com','_blank');
  73. var units = {
  74. getIdsBySelections: function () {
  75. var selections = $("#table").bootstrapTable('getSelections');
  76. var ids = [];
  77. $.each(selections, function (inx, val) {
  78. ids.push(val.id);
  79. });
  80. return ids;
  81. },
  82. save: function (id) {
  83. layer.open({
  84. type: 2,
  85. content: ['/admin/link/task/' + id + '/save'],
  86. area: ['90%', '100%'],
  87. title: '',
  88. closeBtn: 0
  89. });
  90. },
  91. status: function (status, _this) {
  92. $(_this).addClass('dim');
  93. $(_this).siblings().removeClass('dim');
  94. $("#status").val(status);
  95. if (status === 1) {
  96. $("#auto-translate").css('display', '');
  97. } else {
  98. $("#auto-translate").css('display', 'none');
  99. }
  100. tips.tableRefresh();
  101. },
  102. delete: function () {
  103. var ids = units.getIdsBySelections();
  104. if (ids.length === 0) {
  105. layer.alert('请先选择您所要操作的对象', {icon: 0});
  106. return;
  107. }
  108. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  109. layer.close(index);
  110. tips.ajax({
  111. url: '/admin/link/tasks',
  112. type: 'delete',
  113. data: {ids: ids},
  114. tableRefresh: '#table'
  115. });
  116. });
  117. },
  118. detail: function (id) {
  119. layer.open({
  120. type: 2,
  121. content: ['/admin/link/task/' + id],
  122. area: ['90%', '100%'],
  123. title: '',
  124. closeBtn: 0
  125. });
  126. }
  127. };
  128. var config = {};
  129. config.url = '/admin/link/tasks';
  130. config.columns = [ //字段
  131. {checkbox: true},
  132. {
  133. title: '序号', align: 'center', formatter: function (value, item, index) {
  134. return index + 1;
  135. }
  136. },
  137. {
  138. title: '标题', field: 'title', align: 'center',
  139. formatter: function (value, row) {
  140. return '<a href="javascript:;" onclick="units.detail(' + row.id + ')">' + value + '</a>'
  141. }
  142. },
  143. @if($notCustomerBool)
  144. {
  145. title: '兼职人员', field: 'worker_name', align: 'center'
  146. },
  147. @endif
  148. {
  149. title: '站点名称', field: 'site_title', align: 'center'
  150. },
  151. // {title: '平台链接', field: 'translate_words', align: 'center'},
  152. {title: '质量分', field: 'totalScore', align: 'center'},
  153. {title: '外链数', field: 'linkUrlsCount', align: 'center'},
  154. {title: '状态', field: 'status_title', align: 'center'},
  155. {title: '初次审核时间', field: 'first_audit_at', align: 'center'},
  156. {title: '审核时间', field: 'audit_at', align: 'center'},
  157. {title: '未发布', field: 'un_release_at', align: 'center'},
  158. {title: '创建时间', field: 'created_at', align: 'center'},
  159. {
  160. title: '操作', field: 'id', align: 'center',
  161. formatter: function (value, row) {
  162. var str = '';
  163. // if (row.status === 1) {
  164. str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看</button>';
  165. // }
  166. return str;
  167. }
  168. }
  169. ];
  170. tips.bootstrapTable(config);
  171. </script>
  172. @endsection