articles_overview.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. <style>
  4. .ul-content {
  5. margin: 0;
  6. padding: 0;
  7. list-style-type: none;
  8. }
  9. .ul-content li {
  10. padding: 20px 10px 10px;
  11. display: none;
  12. }
  13. .ul-content .active {
  14. display: block;
  15. }
  16. .my-input {
  17. padding: 4px 2px;
  18. width: 100%;
  19. }
  20. .my-table {
  21. width: 100%;
  22. }
  23. .my-table td {
  24. border: 1px solid #E5E6E7;
  25. padding: 8px;
  26. }
  27. .my-table tr td:last-child {
  28. cursor: pointer;
  29. text-align: center;
  30. }
  31. .you-table {
  32. width: 100%;
  33. }
  34. .you-table td {
  35. padding: 8px;
  36. }
  37. .you-table tr td:last-child {
  38. width: 80px;
  39. cursor: pointer;
  40. text-align: center;
  41. }
  42. .you-table2 {
  43. width: 100%;
  44. }
  45. .you-table2 td {
  46. padding: 8px;
  47. }
  48. .you-table2 tr td:last-child {
  49. width: 180px;
  50. }
  51. .subInput {
  52. box-sizing: border-box;
  53. width: 92%;
  54. border: 1px dashed #999;
  55. padding: 4px 2px;
  56. margin-right: 5px;
  57. }
  58. </style>
  59. @endsection
  60. @section('right')
  61. <div class="col-sm-10" style="float: inherit">
  62. <div class="ibox-content">
  63. <div id="bqFlow" style="width: 100%;height: 400px;"></div>
  64. </div>
  65. </div>
  66. <ul class="ul-content">
  67. <li class="active">
  68. <table class="my-table">
  69. {{--<caption style="font-size: 20px;font-weight: 600">文章要求备注</caption>--}}
  70. <h3>文章要求备注</h3>
  71. <thead>
  72. <tr>
  73. <td>
  74. 内容
  75. </td>
  76. <td onclick="utils.addOptimizeDataScope(1)" style="width: 140px">
  77. 添加
  78. </td>
  79. </tr>
  80. </thead>
  81. <tbody id="optimizeDataScopeBody1">
  82. @foreach($result['optimizeDataScopeList1'] as $item)
  83. <tr>
  84. <td>
  85. <input style="border-style: none" type="text" value="{{$item}}" class="my-input"
  86. name="optimizeDataScopeText">
  87. </td>
  88. <td>
  89. {{-- <a href="javascript:;" onclick="utils.addTo('{{$item}}')"
  90. style="padding-right: 20px">追加</a>--}}
  91. <a href="javascript:;" onclick="utils.delOptimizeDataScope(this)">删除</a>
  92. </td>
  93. </tr>
  94. @endforeach
  95. </tbody>
  96. </table>
  97. <table class="my-table">
  98. {{--<caption style="font-size: 20px;font-weight: 600">参考网站(中文网/同行/行业网站)</caption>--}}
  99. <h3>参考网站</h3>
  100. <thead>
  101. <tr>
  102. <td>
  103. 内容 (中文网/同行/行业网站/公众号)
  104. </td>
  105. <td onclick="utils.addOptimizeDataScope(2)" style="width: 140px">
  106. 添加
  107. </td>
  108. </tr>
  109. </thead>
  110. <tbody id="optimizeDataScopeBody2">
  111. @foreach($result['optimizeDataScopeList2'] as $item)
  112. <tr>
  113. <td>
  114. <input style="border-style: none" type="text" value="{{$item}}" class="my-input"
  115. name="optimizeDataScopeText">
  116. </td>
  117. <td>
  118. {{-- <a href="javascript:;" onclick="utils.addTo('{{$item}}')"
  119. style="padding-right: 20px">追加</a>--}}
  120. <a href="javascript:;" onclick="utils.delOptimizeDataScope(this)">删除</a>
  121. </td>
  122. </tr>
  123. @endforeach
  124. </tbody>
  125. </table>
  126. <button type="button" class="btn btn-success" style="margin: 10px 0"
  127. onclick="utils.saveOptimizeDataScope()">保存
  128. </button>
  129. </li>
  130. </ul>
  131. @endsection
  132. @section('footer_extend')
  133. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  134. <script src="{{asset('js/plugins/echarts/echarts.min.js')}}"></script>
  135. <script src="{{asset('js/plugins/wonderland/wonderland.js')}}"></script>
  136. <script>
  137. var utils = {
  138. addTo: function (text = '') {
  139. utils.addHtml(text);
  140. },
  141. addHtml: function (text) {
  142. var str = '<tr>' +
  143. '<td><input type="text" class="my-input" value="' + text + '"></td>' +
  144. '<td class="you-del">删除</td>' +
  145. '</tr>';
  146. $(".you-table tbody").append(str);
  147. },
  148. delOptimizeDataScope: function (_this) {
  149. $(_this).parent().parent().remove();
  150. },
  151. saveOptimizeDataScope: function () {
  152. var dataList1 = [];
  153. $("#optimizeDataScopeBody1").find("[name=optimizeDataScopeText]").each(function () {
  154. var val = $(this).val();
  155. if (val.length > 0) {
  156. dataList1.push(val)
  157. }
  158. });
  159. var dataList2 = [];
  160. $("#optimizeDataScopeBody2").find("[name=optimizeDataScopeText]").each(function () {
  161. var val = $(this).val();
  162. if (val.length > 0) {
  163. dataList2.push(val)
  164. }
  165. });
  166. var ajaxConfig = {
  167. url: '/admin/articles/article-overview-update/{{$siteId}}',
  168. type: 'post',
  169. data: {
  170. dataList1: dataList1,
  171. dataList2: dataList2,
  172. },
  173. success: function (result) {
  174. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  175. window.location.reload();
  176. });
  177. }
  178. };
  179. tips.ajax(ajaxConfig);
  180. },
  181. addOptimizeDataScope: function (id) {
  182. var str = '<tr>' +
  183. '<td>' +
  184. '<input style="border-style: none" type="text" value="" class="my-input" name="optimizeDataScopeText">' +
  185. '</td>' +
  186. '<td>' +
  187. /*'<a href="javascript:;" onclick="utils.addTo()" style="padding-right: 20px">追加</a>' +*/
  188. '<a href="javascript:;" onclick="utils.delOptimizeDataScope(this)">删除</a>' +
  189. '</td>' +
  190. '</tr>';
  191. $("#optimizeDataScopeBody" + id).append(str);
  192. },
  193. };
  194. var bqFlowChart = echarts.init(document.getElementById('bqFlow'), 'wonderland');
  195. var bqFlowOption = {
  196. title: {
  197. text: '软文数据汇总'
  198. },
  199. tooltip: {
  200. },
  201. legend: {
  202. data: ['软文']
  203. },
  204. xAxis: {
  205. data: JSON.parse('{!!json_encode($data['xAxis'])!!}'),
  206. axisLabel: {
  207. interval: 0, //强制文字产生间隔
  208. rotate: 20 //文字逆时针旋转45°
  209. }
  210. },
  211. yAxis: {},
  212. series: [{
  213. name: '篇幅',
  214. type: 'bar',
  215. data: JSON.parse('{!!json_encode($data['yAxis'])!!}'),
  216. itemStyle: {
  217. normal: {
  218. label: {
  219. show: true, //开启显示
  220. position: 'top', //在上方显示
  221. }
  222. }
  223. }
  224. }]
  225. };
  226. bqFlowChart.setOption(bqFlowOption);
  227. </script>
  228. @endsection