123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- @extends('layouts.admin.app')
- @section('plug-css')
- <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
- @endsection
- @section('crumbs')
- <ol class="breadcrumb crumbs">
- <li><a href="{{ route('admin.index') }}#">后台导航</a></li>
- <li><a href="{{ route('admin.message.index') }}">后台留言首页</a></li>
- <li class="active">留言列表</li>
- </ol>
- @endsection
- @section('content')
- <form id="searchForm" class="form-inline">
- <div class="">
- <div class="form-group">
- <label for="name" class="label-css"> ID:</label>
- <input class="form-control" type="text" name="id">
- </div>
- <div class="form-group">
- <label for="username" class="label-css"> 会员账号:</label>
- <input class="form-control" type="text" name="username">
- </div>
- <div class="form-group">
- <label for="content" class="label-css"> 内容:</label>
- <input class="form-control" type="text" name="content">
- </div>
- <div class="form-group">
- <label for="reply" class="label-css"> 回复内容:</label>
- <input class="form-control" type="text" name="reply">
- </div>
-   <div class="form-group">
- <label for="start" class="label-css"> 开始时间:</label>
- <input class="form-control" type="date" placeholder="" name="start" value="">
- </div>
- <div class="form-group">
- <label for="end" class="label-css"> 结束时间:</label>
- <input class="form-control" type="date" placeholder="" name="end" value="">
- </div>
- <button type="button" class="btn btn-primary">查询</button>
- </div>
- </form>
- <hr class="hr-css">
- <div>
- <table id="ContentTable"></table>
- </div>
- @endsection
- @section('plug-js')
- <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
- <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
- <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
- <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
- <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
- @endsection
- @section('scripts')
- <script>
- $(function(){
- console.log('-------------------------');
- BootStrapInit.init('tableMessage','ContentTable',{
- searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
- url: "{{ route('admin.message.ajax.index') }}",
- method: 'post',
- toolbar: '#toolbar',
- idField: '', // 指定主键列
- uniqueId: "id", // 这里需要指定当前查询表唯一主键字段
- columns: [
- {
- checkbox: true,
- align: 'center',
- valign: 'middle'
- },
- {
- field: 'id',
- title: 'ID',
- align: 'center',
- valign: 'middle'
- },
- {
- field: 'username',
- title: '留言账号',
- align: 'center',
- valign: 'middle'
- },
- {
- field: 'content',
- title: '内容',
- align: 'center',
- valign: 'middle',
- formatter:qString
- },
- // {
- // field: 'msg_img',
- // title: '留言图片',
- // align: 'center',
- // valign: 'middle',
- // formatter:cthumbFormatter
- // },
- {
- field: 'reply',
- title: '回复内容',
- align: 'center',
- valign: 'middle',
- formatter:qStringOrTrim
- },
- {
- field: 'show',
- title: '显示',
- align: 'center',
- valign: 'middle',
- sortable: true,
- formatter:yesOrNo,
- bool_data:{
- 'class' : 'cursor',
- // 'url' : 'javascript:;',
- 'table' : 'messages'
- // 'pk' : 'id' // 主键名称不写默认id主键
- }
- },
- {
- field: 'created_at',
- title: '创建时间',
- align: 'center',
- valign: 'middle',
- sortable: true
- },
- {
- field: 'updated_at',
- title: '更新时间/回复时间',
- align: 'center',
- valign: 'middle',
- sortable: true
- },
- {
- pkId: 'id', // 当前主键id 兼容排序 field='id' 默认值id
- title: '操作',
- align: 'center',
- valign: 'middle',
- width: '185px',
- formatter:operateFormatter,
- btn_group:[
- {
- 'name' : '删除',
- 'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
- 'url' : 'javascript:;',
- 'confirm_url': '{{ route('admin.message.destroy', ['id'=>'-val-'])}}' // 选择按钮
- },
- {
- 'name' : '回复',
- 'class' : 'btn-primary createForm',
- 'url' : 'javascript:;',
- 'confirm_url': '{{ route('admin.message.edit', ['id'=>'-val-'])}}'
- },
- ]
- }
- ]
- });
- });
- </script>
- @endsection
|