| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 | @extends('admin/layout')@section('content')    <style>        .btn-success, .btn-primary {            background: #009688 !important;            border-color: #009688 !important;        }    </style>    <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">                        <div class="input-group">                                <span class="input-group-btn">                                    <button type="button" class="btn btn-md btn-success"                                            onclick="units.add(0,'{{$siteId}}','{{$advertId}}')" style="margin-left: 10px;"><span                                            class="glyphicon glyphicon-plus"></span> 添加</button>                                    <button type="button" class="btn btn-md btn-danger" onclick="units.del()"                                            style="margin-left: 10px"><span class="glyphicon glyphicon-remove"></span> 删除</button>                                </span>                        </div>                        <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>        var units = {            del: 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/advertise/delete-row/1',                        type: 'post',                        data: {ids: ids},                        tableRefresh: '#table'                    });                });            },            add: function (id, siteId, advertId) {                layer.open({                    type: 2,                    content: ['/admin/advertise/setting-edit/' + id + '/' + siteId + '/' + advertId],                    area: ['100%', '100%'],                    title: '编辑'                });            },            save: function (id, siteId, advertId) {                layer.open({                    type: 2,                    content: ['/admin/advertise/setting-edit/' + id + '/' + siteId + '/' + advertId],                    area: ['100%', '100%'],                    title: '编辑'                });            },            getIdsBySelections: function () {                var selections = $("#table").bootstrapTable('getSelections');                var ids = [];                $.each(selections, function (inx, val) {                    ids.push(val.id);                });                return ids;            }        };        var config = {};        config.url = '/admin/advertise/setting/{{$advertId}}/{{$siteId}}';        config.pageSize = 20;        config.showColumns = true;        config.columns = [ //字段            {checkbox: true},            {                title: '序号', align: 'center', formatter: function (value, item, index) {                    return index + 1;                },                width: '10px'            },            {title: '广告主题', field: 'theme', align: 'center'},            {title: '投放位置', field: 'advert', align: 'center'},            {title: '展现形式', field: 'type', align: 'center'},            {title: '投放时间', field: 'pushDate', align: 'center'},            {title: '状态', field: 'status', align: 'center'},            {                title: '操作', field: 'id', align: 'center',                formatter: function (value, row) {                    return '<button onclick="units.save(' + row.id + ',' + "{{$siteId}}" + ',' + "{{$advertId}}" + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>编辑</button> ';                }            }        ];        tips.bootstrapTable(config);    </script>@endsection
 |