123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- @extends('admin/layout')
- @section('content')
- @php $notCustomerBool=false @endphp
- @notCustomer
- @php $notCustomerBool=true @endphp
- @endNotCustomer
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox">
- <div class="ibox-content">
- <form class="row" id="searchForm">
- @notCustomer
- <div class="col-md-2">
- <div class="input-group">
- <span class="input-group-btn">
- <button type="button" class="btn btn-md btn-primary" onclick="units.save(0)"
- style="margin-left: 10px;border-radius:2px;"> <span class="glyphicon glyphicon-plus"></span> 添加</button>
- <button type="button" class="btn btn-md btn-danger" onclick="units.delete()"
- style="margin-left: 10px;border-radius:2px;"><span
- class="glyphicon glyphicon-remove"></span> 删除</button>
- </span>
- </div>
- </div>
- @endNotCustomer
- <div class="col-md-8">
- <input type="hidden" name="status" id="status">
- <div class="btn-group" role="group">
- <button type="button" class="btn btn-primary" onclick="units.status(0,this)" style="border-radius:2px;">
- 全部
- </button>
- <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
- onclick="units.status(2,this)">
- 任务中
- </button>
- <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
- onclick="units.status(3,this)">
- 待审核
- </button>
- <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
- onclick="units.status(4,this)">
- 未通过
- </button>
- <button type="button" class="btn btn-primary" style="margin-left: 10px;border-radius:2px;"
- onclick="units.status(5,this)">
- 已通过
- </button>
- <button type="button" class="btn btn-primary"
- style="margin-left: 10px;;border-radius:2px;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>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <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'],
- area: ['90%', '100%'],
- title: '',
- closeBtn: 0
- });
- },
- 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 (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/link/tasks',
- type: 'delete',
- data: {ids: ids},
- 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';
- 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>'
- }
- },
- @if($notCustomerBool)
- {
- title: '兼职人员', field: 'worker_name', align: 'center'
- },
- @endif
- {
- title: '站点名称', field: 'site_title', align: 'center'
- },
- // {title: '平台链接', field: 'translate_words', align: 'center'},
- {title: '质量分', field: 'totalScore', align: 'center'},
- {title: '外链数', field: 'linkUrlsCount', align: 'center'},
- {title: '状态', field: 'status_title', align: 'center'},
- {title: '初次审核时间', field: 'first_audit_at', align: 'center'},
- {title: '审核时间', field: 'audit_at', align: 'center'},
- {title: '未发布', field: 'un_release_at', align: 'center'},
- {title: '创建时间', field: 'created_at', align: 'center'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value, row) {
- var str = '';
- // if (row.status === 1) {
- str += '<button onclick="units.save(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看</button>';
- // }
- return str;
- }
- }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|