@extends('vip.layouts')
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }
    </style>
    <!---注单管理-->
    <script type="text/html" id="waterTool">
        @if(checkRriv('/admin/User/setPwdview'))<a href="/admin/Banner/index/?id=@{{d.id}}&type=@{{d.typeid}}" class="layui-btn layui-btn-sm" style="margin-bottom:5px;margin-left:0px;">查看</a>@endif
       <a href="/admin/Advert/view/?id=@{{d.id}}" class="layui-btn layui-btn-sm">修改信息</a>
    </script>
    <div class="layui-row">

        <!-- <div class="layui-col-xs12 layui-col-sm2 layui-col-md2">
            <ul id="tree" class="tree-table-tree-box"></ul>
        </div>-->
        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">

            <form class="layui-form rewrite" eventType="eventForm" action="">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('notice.title') }}</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title" id="title" eventType="event-query"  value="{{ $title }}" lay-verify="required" autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('notice.type') }}</label>
                        <div class="layui-input-inline">
                            <select name="type" id="type" lay-verify="" autocomplete="off" eventType="event-query"  value="{{ $type }}" class="layui-input">
                                <option value="">{{ trans('menu.select_menutype') }}</option>
                                @foreach(trans('status.advert') as $k=>$v):
                                @if($k == $type)
                                    <option selected = "selected" value="{{$k}}">{{$v}}</option>
                                @else
                                    <option value="{{$k}}">{{$v}}</option>
                                @endif
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-sm lay-btn-diy" data-type="reload" eventType="event-query-submit"
                           style="opacity: 1; pointer-events: auto;">提交</a>
                        <a class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload"
                           style="opacity: 1; pointer-events: auto;">重置</a>
                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload"
                           style="opacity: 1; pointer-events: auto;" href="javascript:window.location.reload()"><i class="layui-icon">ဂ</i></a>
                    </div>
                    @if(checkRriv('/admin/Advert/addNotice'))<div class="layui-inline">
                        <a href="/admin/Advert/addNotice" class="layui-btn layui-btn-sm  ">添加</a>

                    </div>@endif
                    @if(checkRriv('/admin/Advert/delete'))<div class="layui-inline"><a href="javascript:delWin('/admin/Advert/delete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a></div>@endif
                </div>
            </form>
        </div>
        @push('dataTableJS')

            //重置表单
            $('.reset').on('click',function(){
            $('input').val('');
            $('#type').val('');
            // var type = $(this).data('type');
            // active[type] ? active[type].call(this) : '';
            });

            //刷新表单
            //  $('.set').on('click',function(){
            //   var type = $(this).data('type');
            //    active[type] ? active[type].call(this) : '';
            //    });

        @endpush

        @include('vip.datatable')
        <link rel="stylesheet" href="{{ asset('/css/untablelist.css') }}"  />
    </div>
    </div>

@endsection
