| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 | @extends('admin/layout')@section('content')    <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-content">                        <form class="form-inline" id="searchForm" onsubmit="units.search();return false;">                            <div class="form-group" style="margin-top: 5px;">                                <div class="input-group">                                    <input type="text" placeholder="请输入项目名称" class="input-md form-control"                                           name="keyword"                                           id="keyword">                                    <span class="input-group-btn">                                        <button type="button" class="btn btn-md btn-primary"                                                onclick="units.search()"> 搜索</button>                                        <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"                                                name="resetBtn"> 重置</button>{{--                                         <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"--}}{{--                                                 name="resetBtn" id="edit_status"> 同步勾选项</button>--}}                                    </span>                                </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>    </body>@endsection@section('footer')    <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>    <script>        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,type_status) {                layer.open({                    type: 2,                    content: ['/admin/sites/' + id + '/keyword'],                    area: ['90%', '80%'],                    title: '信息详情'                });            },            search: function () {                tips.selectPage();            },            bindDate: function (that) {                var routeTime = {                    type: 'datetime',                    elem: that                };                laydate.render(routeTime);            },            save_time:function (id) {                var sync_time= $('#sync_time_'+id).val();                var next_sync_time=$('#next_sync_time_'+id).val();                    var ajaxConfig = {                        url: '/admin/sites/keyword_save',                        type: 'post',                        data: {                            //sync_time: sync_time,                            //next_sync_time: next_sync_time,                            id: id,                            status:1,                        },                        success: function (result) {                            if(result.code=='200'){                                layer.msg(result.message, {icon: 6, time: 1500}, function () {                                    tips.closeParentLayer();                                    tips.tableRefresh('#table');                                });                            }else if(result.code=='400'){                                layer.msg(result.message, {icon: 5, time: 1500}, function () {                                    tips.closeParentLayer();                                    tips.tableRefresh('#table');                                });                            }                        }                    };                    tips.ajax(ajaxConfig);            }        };        var config = {};        config.url = '/admin/sites/keyword_list';        config.columns = [ //字段            // {checkbox: true},            {                title: '序号', align: 'center', formatter: function (value, item, index) {                    return index + 1;                }            },            {title: '项目名称', field: 'name', align: 'center'},            {title: '域名', field: 'domain', align: 'center'},            {title: '项目状态', field: 'project_status_text', align: 'center'},            {title: '数据同步时间', field: 'time', align: 'center',sortable: true},            {title: '下次同步时间', field: 'next_time', align: 'center', sortable: true},            // {title: '数据同步时间', field: 'time', align: 'center',            //     formatter: function (value, row) {            //         var str = '';            //         str += '<input class="form-control my-date"' +            //             'onclick="units.bindDate(this)" id="sync_time_'+row.id+'" autocomplete="off"' +            //             'name="initial_date" value="' + value + '"  >';            //         return str;            //     },            //     sortable: true},            // {title: '下次同步时间', field: 'next_time', align: 'center',            //     formatter: function (value, row) {            //         var str = '';            //         str += '<input class="form-control my-date"' +            //             'onclick="units.bindDate(this)" id="next_sync_time_'+row.id+'" autocomplete="off"' +            //             'name="initial_date" value="' + value + '">';            //            //         return str;            //     },            //     sortable: true},            {title: '排名系统', field: 'number_title', align: 'center', sortable: true},            {                title: '插队', field: 'site_id', align: 'center',                formatter: function (value, row) {                    var str = '';                    str +='<button type="button" class="btn btn-success" onclick="units.save_time('+row.id+')">插队' +                        '</button>'                    return str;                }            },            {                title: '操作', field: 'site_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);        $(document).on('click', '#edit_status', function () {            var ids = units.getIdsBySelections();            if (ids.length === 0) {                layer.alert('请先选择您所要操作的对象', {icon: 0});                return;            }            tips.ajax({url: '/admin/sites/keyword_save', type: 'post', data: {ids: ids,status:2}});            tips.tableRefresh('#table');        });        config.onLoadSuccess = function (data) {             $("#sum_total").text(data.sum_total);        };        laydate.render({            elem: '#start_at', //指定元素            type: 'datetime'        });        laydate.render({            elem: '#end_at', //指定元素            type: 'datetime'        });    </script>@endsection
 |