social_queue.blade.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. <link rel="stylesheet" href="{{asset('js/plugins/zTree_v3-master/css/zTreeStyle/zTreeStyle.css')}}">
  4. <style type="text/css">
  5. .ztree li span.button.add {
  6. margin-left: 2px;
  7. margin-right: -1px;
  8. background-position: -144px 0;
  9. vertical-align: top;
  10. *vertical-align: middle
  11. }
  12. .ztree li span.button.reset {
  13. margin-right: 2px;
  14. background-position: -110px -48px;
  15. vertical-align: top;
  16. *vertical-align: middle
  17. }
  18. .btn-primary {
  19. background: #2a94e0 !important;
  20. }
  21. </style>
  22. @endsection
  23. @section('right')
  24. <form class="row" id="searchForm">
  25. {{--<div class="col-md-6">--}}
  26. {{--<select name="socialIds" id="socialIds" class="form-control" multiple>--}}
  27. {{--@foreach($socialList as $item)--}}
  28. {{--<option value="{{$item["id"]}}">[{{$item["type"]}}]{{$item["socialNetworkUsername"]}}</option>--}}
  29. {{--@endforeach--}}
  30. {{--</select>--}}
  31. {{--<button type="button" class="btn btn-md btn-primary"--}}
  32. {{--onclick="units.saveSocialIds(0)" style="margin-left: 10px">保存--}}
  33. {{--</button>--}}
  34. {{--</div>--}}
  35. <div class="col-md-4">
  36. <div class="input-group">
  37. <span class="input-group-btn">
  38. <button type="button" class="btn btn-md btn-primary"
  39. onclick="units.save(0)" style="margin-left: 10px">
  40. <span class="glyphicon glyphicon-plus"></span> 添加
  41. </button>
  42. <button type="button" class="btn btn-md btn-primary"
  43. onclick="units.metastasis({{$siteId}})" style="margin-left: 10px">
  44. <span class="glyphicon glyphicon-plus"></span> 批量转移到hootsuite记录
  45. </button>
  46. {{--<button type="button" class="btn btn-md btn-danger"--}}
  47. {{--onclick="units.delete()" style="margin-left: 10px">--}}
  48. {{--<span class="glyphicon glyphicon-remove"></span> 删除--}}
  49. {{--</button>--}}
  50. </span>
  51. </div>
  52. </div>
  53. </form>
  54. <hr>
  55. <div class="table-responsive">
  56. <table id="table" class="table table-condensed"
  57. data-mobile-responsive="true"></table>
  58. </div>
  59. @endsection
  60. @section('footer_extend')
  61. <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.core.min.js')}}"></script>
  62. {{--<script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.exedit.min.js')}}"></script>--}}
  63. <script src="{{asset('js/plugins/zTree_v3-master/js/jquery.ztree.excheck.min.js')}}"></script>
  64. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  65. <script>
  66. var units = {
  67. saveSocialIds: function () {
  68. var ajaxConfig = {
  69. url: '/admin/hootsuite/bind-socialIds',
  70. type: 'post',
  71. data: {
  72. socialIds: $("#socialIds").val(),
  73. siteId: "{{$siteId}}"
  74. }
  75. };
  76. tips.ajax(ajaxConfig);
  77. },
  78. save: function (id) {
  79. var url = '/admin/sites/social-queue/' + id + '?siteId={{$siteId}}';
  80. layer.open({
  81. type: 2,
  82. content: url,
  83. area: ['70%', '90%'],
  84. title: '保存'
  85. });
  86. },
  87. remove: function (id) {
  88. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  89. layer.close(index);
  90. tips.ajax({
  91. url: '/admin/sites/social-queue/' + id,
  92. type: 'delete',
  93. tableRefresh: '#table'
  94. });
  95. });
  96. },
  97. detail: function (id) {
  98. var url = '/admin/sites/social-queue/' + id + '?siteId={{$siteId}}';
  99. layer.open({
  100. type: 2,
  101. content: url,
  102. area: ['70%', '90%'],
  103. title: '详情'
  104. });
  105. },
  106. metastasis: function (id) {
  107. layer.confirm('您确定要全部转移吗?', {icon: 3, title: '转移'}, function (index, layero) {
  108. layer.close(index);
  109. tips.ajax({
  110. url: '/admin/sites/' + id + '/social-metastasis',
  111. type: 'get',
  112. tableRefresh: '#table'
  113. });
  114. });
  115. },
  116. };
  117. var config = {};
  118. config.url = '/admin/sites/' + "{{$siteId}}" + '/social-queue';
  119. config.columns = [ //字段
  120. // {checkbox: true},
  121. {title: '编号', field: 'id', align: 'center'},
  122. /*{title: '地址', field: 'url', align: 'center', width: '200px'},*/
  123. {
  124. title: '图片', field: 'media', align: 'center',
  125. formatter: function (value, rows) {
  126. if (value) {
  127. return (
  128. '<img src="' + value + '" height="40px"/>'
  129. );
  130. }
  131. }
  132. },
  133. {title: '内容概要', field: 'content', align: 'center'},
  134. {title: '发布时间', field: 'publish_at', align: 'center', width: '140px'},
  135. {title: '是否发布社交', field: 'is_published', align: 'center', width: '80px'},
  136. {title: '发布结果', field: 'published_result', align: 'center'},
  137. {title: '创建时间', field: 'created_at', align: 'center', width: '140px'},
  138. {
  139. title: '操作', field: 'id', align: 'center',
  140. formatter: function (value, rows) {
  141. if (!rows.social_sync_at) {
  142. return (
  143. '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>&nbsp;' +
  144. '<button onclick="units.remove(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-remove"></span>删除</button>&nbsp;'
  145. );
  146. }
  147. return (
  148. '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>详情</button>&nbsp;'
  149. );
  150. }
  151. }
  152. ];
  153. tips.bootstrapTable(config);
  154. </script>
  155. @endsection