123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- @endsection
- @section('right')
- <div>
- <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="table-responsive">
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- @endsection
- @section('footer_extend')
- <script>
- 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('tpl/keyword_extend.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/keyword-extend-import/sites/{{$siteId}}',
- 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/keyword-extend-clear/sites/{{$siteId}}',
- type: 'delete',
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- window.location.reload();
- });
- }
- };
- 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()}--}}
- {{--};--}}
- {{--tips.ajax(config);--}}
- {{--}--}}
- };
- var config = {};
- config.url = '/admin/keyword-extend/sites/' + "{{$siteId}}";
- config.columns = [ //字段
- // {checkbox: true},
- {title: '编号', field: 'id', align: 'center'},
- {title: '月份', field: 'ym', align: 'center'},
- {title: '推荐关键词', field: 'keyword', align: 'center'},
- {title: '年搜索量', field: 'search_num', align: 'center'},
- {title: '索引量', field: 'index_num', align: 'center'},
- {title: '着陆页', field: 'land_page', align: 'center'},
- {title: '创建时间', field: 'created_at', align: 'center'},
- // {
- // title: '操作', field: 'id', align: 'center',
- // formatter: function (value) {
- // var str = '';
- // str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button> ';
- // return str;
- //
- // }
- // }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|