@extends('admin.layout-content')

@section('header')
    <style>

    </style>
@endsection

@section('content')
    <div class="layui-container sg-create-container">
        <div class="layui-col-sm8 layui-col-sm-offset2">
            <form class="layui-form" method="POST" action="{{ $pre_uri . 'store' }}">

                {{ csrf_field() }}
                @include('share.layui-form-item', ['type' => 'input', 'name' => 'name', 'label' => '名称', 'required' => true, 'value' => (old('data') ? old('data')['name'] : '')])
                @include('share.layui-form-item', ['type' => 'input', 'name' => 'sort', 'label' => '排序', 'required' => true, 'value' => (old('data') ? old('data')['sort'] : '')])
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
                <div class="layui-form-item">
                </div>
            </form>
        </div>
    </div>
@endsection

@section('footer')
    <script>
        $(function () {
            layui.use(['form', 'laydate'], function(){
                var form = layui.form;
                var laydate = layui.laydate;

                // form.verify({
                //     integer: function (value) {
                //         var pattern = /^[1-9]\d*$/;
                //         if(!(pattern.test(value) || value === '0')) {
                //             return '组员人数必须为大于等于0的整数';
                //         }
                //     }
                // });

                laydate.render({
                    elem: '.sg-select-date'
                });
            });
        })
    </script>
@endsection