123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- @endsection
- @section('right')
- @php $hasEdit=0; @endphp
- @hasAuth('sites-links-edit')
- @php $hasEdit=1; @endphp
- @endHasAuth
- <form class="row" id="searchForm">
- @if($hasEdit)
- <div class="col-md-2">
- <div class="input-group">
- <span class="input-group-btn">
- {{--<button type="button" class="btn btn-md btn-info" id="on" ><span class="glyphicon glyphicon-hand-up"></span> 启用</button>--}}
- {{--<button type="button" class="btn btn-md btn-warning" id="off" style="margin-left: 10px"><span class="glyphicon glyphicon-hand-down"></span> 禁用</button>--}}
- <button type="button" class="btn btn-md btn-primary" onclick="units.save(0)"
- style="margin-left: 10px"> <span class="glyphicon glyphicon-plus"></span> 添加</button>
- <button type="button" class="btn btn-md btn-danger" onclick="units.delete()"
- style="margin-left: 10px"><span
- class="glyphicon glyphicon-remove"></span> 删除</button>
- </span>
- </div>
- </div>
- @endif
- <div class="col-md-8">
- <input type="hidden" name="status" id="status">
- <div class="btn-group" role="group">
- <button type="button" class="btn btn-info" onclick="units.status(0,this)">
- 全部
- </button>
- <button type="button" class="btn btn-info" style="margin-left: 10px"
- onclick="units.status(2,this)">
- 任务中
- </button>
- <button type="button" class="btn btn-info" style="margin-left: 10px"
- onclick="units.status(3,this)">
- 待审核
- </button>
- <button type="button" class="btn btn-info" style="margin-left: 10px"
- onclick="units.status(4,this)">
- 未通过
- </button>
- <button type="button" class="btn btn-info" style="margin-left: 10px"
- onclick="units.status(5,this)">
- 已通过
- </button>
- <button type="button" class="btn btn-warning"
- style="margin-left: 10px;display: none"
- onclick="units.translate()" id="auto-translate">
- 翻译
- </button>
- </div>
- </div>
- </form>
- <hr>
- <div class="table-responsive">
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- @endsection
- @section('footer_extend')
- <script>
- // parent.window.open('http://www.baidu.com', '_blank');
- var units = {
- getIdsBySelections: function () {
- var selections = $("#table").bootstrapTable('getSelections');
- var ids = [];
- $.each(selections, function (inx, val) {
- ids.push(val.id);
- });
- return ids;
- },
- save: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/link/task/' + id + '/save?siteId={{$siteId}}'],
- area: ['90%', '100%'],
- title: '保存'
- });
- },
- status: function (status, _this) {
- $(_this).addClass('dim');
- $(_this).siblings().removeClass('dim');
- $("#status").val(status);
- if (status === 1) {
- $("#auto-translate").css('display', '');
- } else {
- $("#auto-translate").css('display', 'none');
- }
- tips.tableRefresh();
- },
- delete: function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
- tips.ajax({url: '/admin/link/tasks', type: 'delete', data: {ids: ids}});
- tips.tableRefresh('#table');
- });
- },
- detail: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/link/task/' + id],
- area: ['90%', '100%'],
- title: '',
- closeBtn: 0
- });
- }
- };
- var config = {};
- config.url = '/admin/link/tasks?siteId=' + "{{$siteId}}";
- config.columns = [ //字段
- {checkbox: true},
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- }
- },
- {
- title: '标题', field: 'title', align: 'center',
- formatter: function (value, row) {
- return '<a href="javascript:;" onclick="units.detail(' + row.id + ')">' + value + '</a>'
- }
- },
- {title: '兼职人员', field: 'worker_name', align: 'center'},
- {title: '站点名称', field: 'site_title', align: 'center'},
- {title: '质量分', field: 'totalScore', align: 'center'},
- {title: '外链数', field: 'linkUrlsCount', align: 'center'},
- // {title: '平台链接', field: 'translate_words', align: 'center'},
- {title: '状态', field: 'status_title', align: 'center'},
- {title: '未发布', field: 'un_release_at', align: 'center'},
- {title: '审核时间', field: 'audit_at', align: 'center'},
- {title: '创建时间', field: 'created_at', align: 'center'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value, row) {
- var str = '', title = '查看';
- if (row.status === 1 || row.status === 2) {
- title = '编辑'
- }
- @if($hasEdit)
- str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>'+title+'</button>';
- @endif
- // }
- return str;
- }
- }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|