@extends('vip.layouts')
@section('content')

<form class="layui-form" action="/admin/system/add" id="submitForm" name="submitForm" method="post" eventType=eventAjaxForm>
{!! csrf_field() !!}
  <div class="layui-form-item">
    <label class="layui-form-label">菜单名称</label>
    <div class="layui-input-block">
      <input type="text" name="menu_name" required  lay-verify="required" placeholder="请输入菜单名称" autocomplete="off" class="layui-input" value="">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">链接地址</label>
    <div class="layui-input-block">
    <input type="text" name="menu_url"   lay-verify="" placeholder="请输入链接地址" autocomplete="off" class="layui-input" value="">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">ICON图标</label>
    <div class="layui-input-inline">
    <input type="text" name="menu_icon"   lay-verify="" placeholder="请输入ICON图标" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">专用的图标代码</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">上级菜单</label>
    <div class="layui-input-block">
      <select name="parent_id" >
        <option value="0"></option>
        <option value=""></option>
      </select>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
    <input type="text" name="menu_sort"   lay-verify="" placeholder="请输入序号" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">序号</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-block">
      <input type="radio" name="type" value="1" title="顶部菜单">
      <input type="radio" name="type" value="0" title="左侧菜单" checked>
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>

<script>
//Demo
layui.use(['form'], function(){
  var form = layui.form;

  //监听提交
  form.on('submit(submitForm)', function(data){
    return true;
  });
});
function cbFormSuccess(data){
	layer.msg(data.msg);
	setTimeout(function(){
		window.history.go(-1);//返回上一页
	},2500);
}
</script>
@endsection
