spec.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. @extends('admin/layout')
  2. @section('content')
  3. <style>
  4. .btn-danger, .btn-primary, .btn-info {
  5. background: #009688 !important;
  6. border-color: #009688 !important;
  7. }
  8. .table-striped > tbody > tr:nth-of-type(odd) {
  9. background: #f8f8f8 !important;
  10. }
  11. .table-striped > tbody > tr .btn {
  12. background: none !important;
  13. }
  14. .table-striped > tbody > tr td {
  15. font-size: 14px !important;
  16. }
  17. .table-striped > tbody > tr:hover {
  18. background: #ffebd8 !important;
  19. }
  20. .table-striped > tbody > tr:hover .btn {
  21. background: #009688 !important;
  22. color: #fff !important;
  23. }
  24. .table-striped > tbody > tr:hover .btn .glyphicon {
  25. color: #fff !important;
  26. }
  27. </style>
  28. <body class="gray-bg">
  29. <div class="wrapper wrapper-content animated fadeInRight">
  30. <div class="row">
  31. <div class="col-sm-12">
  32. <div class="ibox float-e-margins">
  33. <div class="ibox-content">
  34. <div class="table-responsive">
  35. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </body>
  43. @endsection
  44. @section('footer')
  45. <script>
  46. var units = {
  47. search: function () {
  48. tips.selectPage();
  49. },
  50. getIdsBySelections: function () {
  51. var selections = $("#table").bootstrapTable('getSelections');
  52. var ids = [];
  53. $.each(selections, function (inx, val) {
  54. ids.push(val.id);
  55. });
  56. return ids;
  57. },
  58. save: function (id) {
  59. layer.open({
  60. type: 2,
  61. content: ['/admin/articles/' + id],
  62. area: ['100%', '100%'],
  63. title: '',
  64. closeBtn: 0
  65. });
  66. },
  67. status: function (status, _this) {
  68. $(_this).addClass('dim');
  69. $(_this).siblings().removeClass('dim');
  70. $("#status").val(status);
  71. if (status === 1) {
  72. $("#auto-translate").css('display', '');
  73. } else {
  74. $("#auto-translate").css('display', 'none');
  75. }
  76. tips.tableRefresh();
  77. },
  78. translate: function () {
  79. var ids = units.getIdsBySelections();
  80. if (ids.length === 0) {
  81. layer.alert('请先选择您所要操作的对象', {icon: 0});
  82. return;
  83. }
  84. layer.confirm('您确定要翻译以下内容吗?', {icon: 3, title: '有道翻译'}, function () {
  85. var config = {url: '/admin/articles/auto-translate', type: 'put', data: {ids: ids}};
  86. tips.ajax(config);
  87. });
  88. },
  89. delete: function () {
  90. var ids = units.getIdsBySelections();
  91. if (ids.length === 0) {
  92. layer.alert('请先选择您所要操作的对象', {icon: 0});
  93. return;
  94. }
  95. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  96. layer.close(index);
  97. tips.ajax({
  98. url: '/admin/articles',
  99. type: 'delete',
  100. data: {ids: ids},
  101. tableRefresh: '#table'
  102. });
  103. });
  104. },
  105. detail: function (id) {
  106. layer.open({
  107. type: 2,
  108. content: ['/admin/articles-detail/' + id],
  109. area: ['100%', '100%'],
  110. title: '',
  111. closeBtn: 0
  112. });
  113. }
  114. };
  115. var config = {};
  116. config.url = '/admin/articles/spec';
  117. config.columns = [ //字段
  118. {title: '公司', field: 'cn_title' },
  119. {title: '域名', field: 'domain'},
  120. {title: '项目阶段', field: 'status_title', align: 'center'},
  121. {title: '软文指标', field: 'article_goal', align: 'center'},
  122. {title: '撰写人员', field: 'editor', align: 'center'},
  123. {title: '软文发布量', field: 'articles_count', align: 'center'},
  124. ];
  125. tips.bootstrapTable(config);
  126. </script>
  127. @endsection