123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
- @endsection
- @section('right')
- @php $hasEdit=0; @endphp
- @hasAuth('sites-rank-edit')
- @php $hasEdit=1; @endphp
- @endHasAuth
- <div class="row">
- <form id="searchForm">
- @if($hasEdit)
- <div class="col-md-3">
- {{--<input type="hidden" name="status" id="status">--}}
- <div class="btn-group" role="group">
- <button type="button" class="btn btn-info" onclick="units.import()">
- 导入关键词
- </button>
- <button type="button" class="btn btn-info" style="margin-left: 10px"
- onclick="units.add()">
- 单个关键词添加
- </button>
- {{--<button type="button" class="btn btn-info" style="margin-left: 10px"--}}
- {{--onclick="units.clear()">--}}
- {{--清空关键词--}}
- {{--</button>--}}
- </div>
- </div>
- <div class="col-md-7">
- <label>关键词排名:</label>
- <input type="checkbox" class="js-switch" title="" id="isAllow"
- @if(!empty($old->allow_googlerank)) checked @endif >
- <label for="cloud_type">排名系统:</label>
- <select name="cloud_type" id="cloud_type" style="height:30px;width:120px;">
- <option value="">请选择</option>
- <option value="1" @if(($old->number??0)==1) selected @endif>排名系统【1】</option>
- <option value="2" @if(($old->number??0)==2) selected @endif>排名系统【2】</option>
- <option value="3" @if(($old->number??0)==3) selected @endif>排名系统【3】</option>
- <option value="4" @if(($old->number??0)==4) selected @endif >排名系统【4】</option>
- </select>
- <label style="padding-left: 20px">查询间隔时间:</label>
- <select style="height:30px;width:80px;" id="interval_time" name="interval_time">
- <option value="0" @if(($old->interval_time??0)==0) selected @endif>0</option>
- <option value="5" @if(($old->interval_time??0)==5) selected @endif>5</option>
- <option value="7" @if(($old->interval_time??0)==7) selected @endif >7</option>
- <option value="15" @if(($old->interval_time??0)==15) selected @endif >15</option>
- <option value="30" @if(($old->interval_time??0)==30) selected @endif >30</option>
- </select>
- <button class="btn btn-success" type="button" onclick="units.save()"> 确认</button>
- </div>
- @endif
- <div class="col-md-2">
- <label for="cloud_type">关键词总数:</label>
- <span>{{$keywordCount}}</span><br>
- <label for="cloud_type">查询关键词数:</label>
- <span>{{$keywordCount-$keywordCountNotRun}}</span><br>
- <label for="cloud_type">暂停关键词数:</label>
- <span>{{$keywordCountNotRun}}</span>
- </div>
- </form>
- </div>
- <hr>
- <div class="row">
- <iframe
- src="https://rank.yinqingli.cn/report/keyword/id--{{md5($site->old_id??0)}}--sortby--google_rank.html"
- frameborder="0" width="100%" height="800px"></iframe>
- </div>
- @endsection
- @section('footer_extend')
- <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
- <script>
- // parent.window.open('http://www.baidu.com', '_blank');
- var jsSwitch = document.querySelector(".js-switch");
- new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
- var openIndex;
- var units = {
- import: function () {
- var str = '<div class="ibox-content" id="importLayer">' +
- '<form class="form-horizontal">' +
- '<div class="form-group">' +
- '<label class="col-sm-3 control-label">请选择excel文件:</label>' +
- '<div class="col-sm-6">' +
- '<input type="file" id="excel_file" class="form-control">' +
- '<input type="hidden" id="excel_path">' +
- '</div>' +
- '<div class="col-sm-2"><button class="btn btn-info" type="button" onclick="units.fileUpload()">上传</button></div>' +
- '</div>' +
- ' <div class="form-group">' +
- '<div class="col-sm-6 col-sm-offset-3">' +
- '<a href="{{asset('keyword.xlsx')}}">请下载导入模板</a>' +
- '</div>' +
- '</div>' +
- '</form>' +
- '</div>';
- openIndex = layer.open({
- type: 1,
- content: str,
- area: ['60%', '30%'],
- title: '导入关键词'
- });
- },
- fileUpload: function () {
- var config = {
- url: '/admin/tool/excel-upload'
- };
- config.success = function (result) {
- var data = {excel_path: result.data.file_url, siteId: "{{$siteId}}"};
- var config = {
- url: '/admin/rank/keyword/import',
- type: 'post',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- layer.close(openIndex);
- window.location.reload();
- });
- }
- };
- tips.ajax(config);
- };
- tips.fileUpload($("#excel_file"), config);
- },
- add: function () {
- layer.open({
- type: 2,
- content: ['/admin/rank/site/' + "{{$siteId}}" + '/keyword-save'],
- area: ['60%', '50%'],
- title: '添加关键词'
- });
- },
- clear: function () {
- layer.confirm('您确定要清空全部关键词吗?', {icon: 3, title: '清空'}, function () {
- var config = {
- url: '/admin/rank/site/{{$siteId}}/keyword/all',
- type: 'delete'
- };
- tips.ajax(config);
- });
- },
- save: function () {
- var config = {
- type: 'put',
- url: '/admin/rank/allow-rank/{{$site->old_id??0}}',
- data: {isAllow: jsSwitch.checked ? 1 : 0, number: $("#cloud_type").val(),interval_time:$("#interval_time").val()}
- };
- tips.ajax(config);
- }
- };
- </script>
- @endsection
|