| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 | @extends('admin/layout')@section('content')    <div class="wrapper wrapper-content animated fadeInRight">        <form class="row" id="searchForm">            <div class="col-md-6">                <div class="input-group" style="display: flex">                    <select name="status" id="status" title="" class="form-control"                            style="width: 150px;float: inherit;margin-left: 10px;position: relative;"                            onchange="tips.selectPage();">                        <option value="">请选择发布状态</option>                        <option value="1" >待翻译</option>                    </select>                    <select name="beApplicable" id="beApplicable" title="" class="form-control"                            style="width: 150px;float: inherit;margin-left: 10px;position: relative;"                            onchange="tips.selectPage();">                        <option value="">请选择审核状态</option>                        <option value="0" selected="selected">待定</option>                        <option value="1">适用</option>                        <option value="2">不适用</option>                    </select>                    <div class="input-group">                        <input type="text" placeholder="请输入软文标题" class="input-md form-control"                               name="title"                               id="title" style="width: 300px;float: right">                        <span class="input-group-btn">                        <button type="button" class="btn btn-md btn-primary" onclick="units.search()"> 搜索</button>                        <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px" name="btnReset"> 重置</button>                        </span>                    </div>                </div>            </div>        </form>        <hr>    </div>    <div class="table-responsive">        <table id="table" class="table table-condensed"               data-mobile-responsive="true"></table>    </div>@endsection@section('footer')    <script>        $('#bzx').click(function () {            $('.toggle-x-box').toggle();        });        var units = {            search: function () {                tips.selectPage();            },            getIdsBySelections: function () {                var selections = $("#table").bootstrapTable('getSelections');                var ids = [];                $.each(selections, function (inx, val) {                    ids.push(val.id);                });                return ids;            },            add: function (id) {                var url = '/admin/articles/' + id + '?siteId={{$siteId}}';                layer.open({                    type: 2,                    content: [url],                    area: ['100%', '100%'],                    title: '',                    closeBtn: 0                });            },            save: function (id, status) {                if (status !== 1) {                    layer.alert('只允许修改待翻译状态文章', {icon: 0});                    return;                }                var url = '/admin/articles/' + id + '?siteId={{$siteId}}';                layer.open({                    type: 2,                    content: [url],                    area: ['100%', '100%'],                    title: '',                    closeBtn: 0                });            },            toBeDetermined: function (id, status) {                if (status !== 1) {                    layer.alert('只允许修改待翻译状态文章', {icon: 0});                    return;                }                layer.confirm('确定待定吗?', {icon: 3, title: '删除信息'}, function (index, layero) {                    layer.close(index);                    tips.ajax({                        url: '/admin/articles/to-be-determined/{{$siteId}}',                        type: 'get',                        data: {id: id, type: 0},                        tableRefresh: '#table'                    });                });            },            beApplicable: function (id, status) {                if (status !== 1) {                    layer.alert('只允许修改待翻译状态文章', {icon: 0});                    return;                }                layer.confirm('确定适用吗?', {icon: 3, title: '删除信息'}, function (index, layero) {                    layer.close(index);                    tips.ajax({                        url: '/admin/articles/to-be-determined/{{$siteId}}',                        type: 'get',                        data: {id: id, type: 1},                        tableRefresh: '#table'                    });                });            },            notApplicable: function (id, status) {                if (status !== 1) {                    layer.alert('只允许修改待翻译状态文章', {icon: 0});                    return;                }                layer.confirm('确定不适用吗?', {icon: 3, title: '删除信息'}, function (index, layero) {                    layer.close(index);                    tips.ajax({                        url: '/admin/articles/to-be-determined/{{$siteId}}',                        type: 'get',                        data: {id: id, type: 2},                        tableRefresh: '#table'                    });                });            },            notApplicableWherefore: function (id, status) {                if (status !== 1) {                    layer.alert('只允许修改待翻译状态文章', {icon: 0});                    return;                }                var notBeApplicableInfo = $('#not_be_applicable_info' + id).val();                if (notBeApplicableInfo.length > 250) {                    layer.msg('字符长度过长,请控制在250字符以内');                    return;                }                tips.ajax({                    url: '/admin/articles/not-applicable-wherefore/{{$siteId}}',                    type: 'get',                    data: {id: id, notBeApplicableInfo: notBeApplicableInfo},                    tableRefresh: '#table'                });            }        };        var config = {};        config.url = '/admin/sites/' + "{{$siteId}}" + '/articles-find';        config.columns = [ //字段            {                title: '序号', align: 'center', formatter: function (value, item, index) {                    return index + 1;                },                width: '120px'            },            {                title: '标题', field: 'title', align: 'center',                formatter: function (value, row) {                    return '<a href="javascript:;" onclick="units.save(' + row.id + ',' + row.status + ')">' + value + '</a>'                }            },            {title: '发布状态', field: 'status_title', align: 'center'},            {title: '审核状态', field: 'check', align: 'center'},            {                title: '操作', field: '', align: 'center',                formatter: function (value, row) {                    var str = '';                    if (row.be_applicable === 0) {                        //熄灭                        str += '<button onclick="units.toBeDetermined(' + row.id + ',' + row.status + ')" class="btn btn-md btn-info" style="display: none">待定</button> ';                        //高亮                        str += '<button onclick="units.beApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-success">适用</button> ';                        //高亮                        str += '<button onclick="units.notApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-danger">不适用</button> ';                    } else if (row.be_applicable === 1) {                        //高亮                        str += '<button onclick="units.toBeDetermined(' + row.id + ',' + row.status + ')" class="btn btn-md btn-info">待定</button> ';                        //熄灭                        str += '<button onclick="units.beApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-success" style="display: none">适用</button> ';                        //高亮                        str += '<button onclick="units.notApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-danger">不适用</button> ';                    } else {                        //高亮                        str += '<button onclick="units.toBeDetermined(' + row.id + ',' + row.status + ')" class="btn btn-md btn-info">待定</button> ';                        //高亮                        str += '<button onclick="units.beApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-success">适用</button> ';                        //熄灭                        str += '<button onclick="units.notApplicable(' + row.id + ',' + row.status + ')" class="btn btn-md btn-danger" style="display: none">不适用</button> ';                    }                    return str;                }            },            {title: '更新时间', field: 'updated_at', align: 'center'},            {                title: '不适用原因', field: 'not_be_applicable_info', align: 'center',                formatter: function (value, row) {                    var str = '';                    if (row.be_applicable === 2) {                        str += '<input type="text" class="form-control" id="not_be_applicable_info' + row.id + '" name="not_be_applicable_info" value="' + row.not_be_applicable_info + '">';                        str += '<button onclick="units.notApplicableWherefore(' + row.id + ',' + row.status + ')" class="btn btn-md btn-success">确定</button>';                    }                    return str;                },                cellStyle: function () {                    return {css: {'display': 'flex'}};                }            }        ];        tips.bootstrapTable(config);    </script>@endsection
 |