123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- @endsection
- @section('right')
- <div class="table-responsive">
- <button type="button" class="btn btn-md btn-primary"
- onclick="units.import()" style="margin-left: 10px">
- 导入记录
- </button>
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- @endsection
- @section('footer_extend')
- <script>
- 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.fileUploadExl()">上传</button></div>' +
- '</div>' +
- ' <div class="form-group">' +
- '<div class="col-sm-6 col-sm-offset-3">' +
- '<a href="{{asset('tpl/social_message_list.xlsx')}}">请下载导入模板</a>' +
- '</div>' +
- '</div>' +
- '</form>' +
- '</div>';
- openIndex = layer.open({
- type: 1,
- content: str,
- area: ['60%', '30%'],
- title: '导入关键词'
- });
- },
- fileUploadExl: 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/sites/' + {{$siteId}} +'/social-message-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);
- },
- detail: function (id) {
- var url = '/admin/sites/social-queue/' + id + '?siteId={{$siteId}}';
- layer.open({
- type: 2,
- content: url,
- area: ['70%', '90%'],
- title: '详情'
- });
- }
- };
- var config = {};
- config.url = '/admin/sites/' + "{{$siteId}}" + '/hootsuite-history';
- config.columns = [ //字段
- {title: '编号', field: 'id', align: 'center'},
- {title: '地址', field: 'url', align: 'center', width: '200px'},
- {
- title: '图片', field: 'media', align: 'center',
- formatter: function (value, rows) {
- if (value) {
- return (
- '<img src="' + value + '" height="40px"/>'
- );
- }
- }
- },
- {title: '内容概要', field: 'content', align: 'center'},
- {title: '发布时间', field: 'publish_at', align: 'center', width: '140px'},
- {title: '发布对象', field: 'profileStr', align: 'center'},
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|