{{csrf_field()}}
<div class="layui-form-item">
    <label for="" class="layui-form-label">名称</label>
    <div class="layui-input-inline">
        <input type="text" name="gname" value="{{ $gmenu->gname ?? old('gname') }}" lay-verify="required" placeholder="请输入名称" class="layui-input" >
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">PID</label>
    <div class="layui-input-inline">
        <input type="text" name="parent_id" value="{{$gmenu->parent_id??old('parent_id')}}" required="required" placeholder="请输入PID" class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">排序</label>
    <div class="layui-input-inline">
        <input type="text" name="sort" value="{{ $gmenu->sort ?? old('sort',500) }}" lay-verify="required"  placeholder="排序" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">数字小排前面,默认500</div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">图标URL</label>
    <div class="layui-input-inline">
        <input type="text" name="iconUrl" id="iconUrl" value="{{ $gmenu->iconUrl ?? old('iconUrl') }}" lay-verify="required"  placeholder="图标URL" class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">目标</label>
    <div class="layui-input-inline">
        <input type="text" name="gaction" value="{{ $gmenu->gaction ?? old('gaction') }}"  placeholder="目标" class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">状态</label>
    <div class="layui-input-inline">
        <input type="text" name="status"  value="{{ $gmenu->status ?? old('status',1) }}"  placeholder="状态" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">1代表启用 0代表禁用</div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">节点</label>
    <div class="layui-input-inline">
        <input type="text" name="isleaf"  value="{{ $gmenu->isleaf ?? old('isleaf',0) }}"  placeholder="节点" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">1代表节点  0代表还有子节点</div>
</div>


<div class="layui-form-item">
    <label for="" class="layui-form-label">图片上传</label>
    <div class="layui-input-block">
        <div class="layui-upload">
            <button type="button" class="layui-btn" id="uploadPic"><i class="layui-icon">&#xe67c;</i>图片上传</button>
            <div class="layui-upload-list" >
                <ul id="layui-upload-box" class="layui-clear">
                    @if(isset($gmenu->iconUrl))
                        <li><img src="{{ $gmenu->iconUrl }}" /><p>上传成功</p></li>
                    @endif
                </ul>
                <input type="hidden" name="UpiconUrl" id="UpiconUrl" value="{{ $gmenu->iconUrl??'' }}">
            </div>
        </div>
    </div>
</div>


<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
        <a  class="layui-btn" href="{{route('admin.gmenu')}}" >返 回</a>
    </div>
</div>