| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 | @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-title"></div>--}}                    <div class="ibox-content">                        <div class="input-group">                            <button type="button" class="btn btn-md btn-primary"                                    style="margin-left: 10px"                                    onclick="units.add(0)"> <span                                    class="glyphicon glyphicon-plus"></span> 添加                            </button>                        </div>                        <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>        var units = {            search: function () {                tips.selectPage();            },            add: function () {                layer.open({                    type: 2,                    content: ['/admin/classroom/social-media-update/0'],                    area: ['60%', '100%'],                    title: '添加'                });            },            update: function (id) {                layer.open({                    type: 2,                    content: ['/admin/classroom/social-media-update/' + id],                    area: ['60%', '100%'],                    title: '编辑'                });            },            del: function (id) {                tips.ajax({                    url: ['/admin/classroom/social-media-delete/' + id],                    type: 'get'                });                window.location.reload();            },        };        var config = {};        config.url = '/admin/classroom/social-media';        config.columns = [ //字段            {                title: '序号', align: 'center', formatter: function (value, item, index) {                    return index + 1;                },                width: '20px'            },            {title: '标题', field: 'title', align: 'center', width: '200px'},            {title: '内容', field: 'content', align: 'center', width: '300px'},            {                title: '图片', field: 'image', align: 'center', formatter: function (value, item) {                    return '<img src="' + value + '" style="width:80px">';                }            },            {title: '创建时间', field: 'created_at', align: 'center', width: '100px'},            {                title: '操作', field: 'id', align: 'center',                formatter: function (value, rows) {                    var str = '<button onclick="units.update(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button> ';                    str += '<button onclick="units.del(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>删除</button> ';                    return str;                }            }        ];        tips.bootstrapTable(config);    </script>@endsection
 |