keyword_for_site.blade.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('right')
  6. @php $hasEdit=0; @endphp
  7. @hasAuth('sites-rank-edit')
  8. @php $hasEdit=1; @endphp
  9. @endHasAuth
  10. <div class="row">
  11. <form id="searchForm">
  12. @if($hasEdit)
  13. <div class="col-md-3">
  14. {{--<input type="hidden" name="status" id="status">--}}
  15. <div class="btn-group" role="group">
  16. <button type="button" class="btn btn-info" onclick="units.import()">
  17. 导入关键词
  18. </button>
  19. <button type="button" class="btn btn-info" style="margin-left: 10px"
  20. onclick="units.add()">
  21. 单个关键词添加
  22. </button>
  23. {{--<button type="button" class="btn btn-info" style="margin-left: 10px"--}}
  24. {{--onclick="units.clear()">--}}
  25. {{--清空关键词--}}
  26. {{--</button>--}}
  27. </div>
  28. </div>
  29. <div class="col-md-7">
  30. <label>关键词排名:</label>
  31. <input type="checkbox" class="js-switch" title="" id="isAllow"
  32. @if(!empty($old->allow_googlerank)) checked @endif >
  33. <label for="cloud_type">排名系统:</label>
  34. <select name="cloud_type" id="cloud_type" style="height:30px;width:120px;">
  35. <option value="">请选择</option>
  36. <option value="1" @if(($old->number??0)==1) selected @endif>排名系统【1】</option>
  37. <option value="2" @if(($old->number??0)==2) selected @endif>排名系统【2】</option>
  38. <option value="3" @if(($old->number??0)==3) selected @endif>排名系统【3】</option>
  39. <option value="4" @if(($old->number??0)==4) selected @endif >排名系统【4】</option>
  40. </select>
  41. <label style="padding-left: 20px">查询间隔时间:</label>
  42. <select style="height:30px;width:80px;" id="interval_time" name="interval_time">
  43. <option value="0" @if(($old->interval_time??0)==0) selected @endif>0</option>
  44. <option value="5" @if(($old->interval_time??0)==5) selected @endif>5</option>
  45. <option value="7" @if(($old->interval_time??0)==7) selected @endif >7</option>
  46. <option value="15" @if(($old->interval_time??0)==15) selected @endif >15</option>
  47. <option value="30" @if(($old->interval_time??0)==30) selected @endif >30</option>
  48. </select>
  49. <button class="btn btn-success" type="button" onclick="units.save()"> 确认</button>
  50. </div>
  51. @endif
  52. <div class="col-md-2">
  53. <label for="cloud_type">关键词总数:</label>
  54. <span>{{$keywordCount}}</span><br>
  55. <label for="cloud_type">查询关键词数:</label>
  56. <span>{{$keywordCount-$keywordCountNotRun}}</span><br>
  57. <label for="cloud_type">暂停关键词数:</label>
  58. <span>{{$keywordCountNotRun}}</span>
  59. </div>
  60. </form>
  61. </div>
  62. <hr>
  63. <div class="row">
  64. <iframe
  65. src="https://rank.yinqingli.cn/report/keyword/id--{{md5($site->old_id??0)}}--sortby--google_rank.html"
  66. frameborder="0" width="100%" height="800px"></iframe>
  67. </div>
  68. @endsection
  69. @section('footer_extend')
  70. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  71. <script>
  72. // parent.window.open('http://www.baidu.com', '_blank');
  73. var jsSwitch = document.querySelector(".js-switch");
  74. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  75. var openIndex;
  76. var units = {
  77. import: function () {
  78. var str = '<div class="ibox-content" id="importLayer">' +
  79. '<form class="form-horizontal">' +
  80. '<div class="form-group">' +
  81. '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
  82. '<div class="col-sm-6">' +
  83. '<input type="file" id="excel_file" class="form-control">' +
  84. '<input type="hidden" id="excel_path">' +
  85. '</div>' +
  86. '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
  87. '</div>' +
  88. ' <div class="form-group">' +
  89. '<div class="col-sm-6 col-sm-offset-3">' +
  90. '<a href="{{asset('keyword.xlsx')}}">请下载导入模板</a>' +
  91. '</div>' +
  92. '</div>' +
  93. '</form>' +
  94. '</div>';
  95. openIndex = layer.open({
  96. type: 1,
  97. content: str,
  98. area: ['60%', '30%'],
  99. title: '导入关键词'
  100. });
  101. },
  102. fileUpload: function () {
  103. var config = {
  104. url: '/admin/tool/excel-upload'
  105. };
  106. config.success = function (result) {
  107. var data = {excel_path: result.data.file_url, siteId: "{{$siteId}}"};
  108. var config = {
  109. url: '/admin/rank/keyword/import',
  110. type: 'post',
  111. data: data,
  112. success: function (result) {
  113. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  114. layer.close(openIndex);
  115. window.location.reload();
  116. });
  117. }
  118. };
  119. tips.ajax(config);
  120. };
  121. tips.fileUpload($("#excel_file"), config);
  122. },
  123. add: function () {
  124. layer.open({
  125. type: 2,
  126. content: ['/admin/rank/site/' + "{{$siteId}}" + '/keyword-save'],
  127. area: ['60%', '50%'],
  128. title: '添加关键词'
  129. });
  130. },
  131. clear: function () {
  132. layer.confirm('您确定要清空全部关键词吗?', {icon: 3, title: '清空'}, function () {
  133. var config = {
  134. url: '/admin/rank/site/{{$siteId}}/keyword/all',
  135. type: 'delete'
  136. };
  137. tips.ajax(config);
  138. });
  139. },
  140. save: function () {
  141. var config = {
  142. type: 'put',
  143. url: '/admin/rank/allow-rank/{{$site->old_id??0}}',
  144. data: {isAllow: jsSwitch.checked ? 1 : 0, number: $("#cloud_type").val(),interval_time:$("#interval_time").val()}
  145. };
  146. tips.ajax(config);
  147. }
  148. };
  149. </script>
  150. @endsection