customer_link_count.blade.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. @extends('admin/layout')
  2. @section('header')
  3. @endsection
  4. @section('content')
  5. <body class="gray-bg">
  6. <div class="wrapper wrapper-content animated fadeIn">
  7. <div class="ibox float-e-margins">
  8. <div class="ibox-content">
  9. <form class="row" id="searchForm">
  10. <div class="col-md-6 pull-right">
  11. <div class="input-group">
  12. <input type="text" placeholder="请输入平台链接" class="input-md form-control"
  13. name="keyword"
  14. id="keyword" style="width: 300px;float: right">
  15. <span class="input-group-btn">
  16. <button type="button" class="btn btn-md btn-primary" onclick="units.search()"> 搜索</button>
  17. <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px" name="btnReset"> 重置</button>
  18. <button type="button" class="btn btn-md btn-info" style="margin-left: 10px"
  19. onclick="units.exportExcel()"> 导出</button>
  20. </span>
  21. </div>
  22. </div>
  23. </form>
  24. <hr>
  25. <div class="table-responsive">
  26. <table id="table" class="table table-condensed"
  27. data-mobile-responsive="true">
  28. </table>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </body>
  34. @endsection
  35. @section('footer')
  36. <script>
  37. var units = {
  38. exportExcel: function () {
  39. var keyword = $("#keyword").val();
  40. window.open('/admin/link/export/{{$siteId}}?keyword=' + keyword);
  41. },
  42. search: function () {
  43. tips.selectPage();
  44. },
  45. importLink: function () {
  46. var str = '<div class="ibox-content" id="importLayer">' +
  47. '<form class="form-horizontal">' +
  48. '<div class="form-group">' +
  49. '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
  50. '<div class="col-sm-6">' +
  51. '<input type="file" id="excel_file" class="form-control">' +
  52. '<input type="hidden" id="excel_path">' +
  53. '</div>' +
  54. '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
  55. '</div>' +
  56. ' <div class="form-group">' +
  57. '<div class="col-sm-6 col-sm-offset-3">' +
  58. '<a href="{{asset('tpl/link_tpl.xlsx')}}">请下载导入模板</a>' +
  59. '</div>' +
  60. '</div>' +
  61. '</form>' +
  62. '</div>';
  63. var openIndex = layer.open({
  64. type: 1,
  65. content: str,
  66. area: ['60%', '40%'],
  67. btn: ['导入', '取消'],
  68. title: '导入外链',
  69. yes: function (index, layero) {
  70. var data = {excel_path: $("#excel_path").val(), siteId: "{{$siteId}}"};
  71. var config = {
  72. url: '/admin/link/import/{{$siteId}}',
  73. type: 'post',
  74. data: data,
  75. success: function (result) {
  76. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  77. layer.close(openIndex);
  78. tips.tableRefresh();
  79. });
  80. }
  81. };
  82. tips.ajax(config);
  83. }
  84. });
  85. },
  86. fileUpload: function () {
  87. var config = {
  88. url: '/admin/tool/excel-upload'
  89. };
  90. config.success = function (result) {
  91. $("#excel_path").val(result.data.file_url);
  92. layer.msg(result.message, {icon: 6, time: 1500});
  93. };
  94. tips.fileUpload($("#excel_file"), config);
  95. },
  96. getIdsBySelections: function () {
  97. var selections = $("#table").bootstrapTable('getSelections');
  98. var ids = [];
  99. $.each(selections, function (inx, val) {
  100. ids.push(val.id);
  101. });
  102. return ids;
  103. },
  104. delete: function () {
  105. var ids = units.getIdsBySelections();
  106. if (ids.length === 0) {
  107. layer.alert('请先选择您所要操作的对象', {icon: 0});
  108. return;
  109. }
  110. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
  111. tips.ajax({url: '/admin/link/link-detail', type: 'delete', data: {ids: ids}});
  112. tips.tableRefresh('#table');
  113. });
  114. },
  115. save: function (id) {
  116. layer.open({
  117. type: 2,
  118. content: ['/admin/link/link-count/' + id + '?siteId={{$siteId}}'],
  119. area: ['60%', '70%'],
  120. title: '保存'
  121. });
  122. }
  123. // detail: function (id) {
  124. // layer.open({
  125. // type: 2,
  126. // content: ['/admin/link/task/' + id],
  127. // area: ['90%', '100%'],
  128. // title: '',
  129. // closeBtn: 0
  130. // });
  131. // },
  132. };
  133. var config = {};
  134. config.url = '/admin/link/customer/link-count';
  135. config.pageSize=15;
  136. config.columns = [ //字段
  137. // {checkbox: true},
  138. {
  139. title: '序号', align: 'center', formatter: function (value, item, index) {
  140. return index + 1;
  141. }
  142. },
  143. {title: '类型', field: 'link_type_source', align: 'center'},
  144. {title: '平台链接', field: 'link_url_source', align: 'center'},
  145. {title: '关联外链标题', field: 'task_title', align: 'center'},
  146. {title: '用户名', field: 'username', align: 'center'},
  147. {title: '邮箱', field: 'email', align: 'center'},
  148. {title: '密码', field: 'password', align: 'center'},
  149. {title: 'profile演示地址', field: 'url', align: 'center'},
  150. {title: '页面演示地址数量', field: 'urls_count', align: 'center'},
  151. {title: '创建时间', field: 'created_at', align: 'center'}
  152. {{--{--}}
  153. {{--title: '操作', field: 'id', align: 'center',--}}
  154. {{--formatter: function (value, row) {--}}
  155. {{--var str = '';--}}
  156. {{--@if($hasEdit)--}}
  157. {{--str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>';--}}
  158. {{--@endif--}}
  159. {{--return str;--}}
  160. {{--}--}}
  161. {{--}--}}
  162. ];
  163. tips.bootstrapTable(config);
  164. </script>
  165. @endsection