vaeThink2/app/admin/template/menu/add.html

80 lines
2.4 KiB
HTML
Raw Permalink Normal View History

2020-04-01 09:59:41 +08:00
{include file="common/head"}
<form class="layui-form" style="padding: 20px 70px 0 0;">
<div class="layui-form-item">
<label class="layui-form-label">父级</label>
<div class="layui-input-block">
<select name="pid" lay-verify="required" lay-search="">
<option value="0">顶级菜单</option>
{volist name=":vae_set_recursion($menu)" id="v"}
<option value="{$v.id}">{$v.title}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入名称" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
<div class="layui-input-block">
<input type="text" name="src" placeholder="请输入链接" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<input type="checkbox" name="is_menu" lay-skin="switch" value="1" lay-text="权限+菜单|仅权限">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-block">
<input type="text" name="icon" placeholder="仅在开启左侧菜单状态下有效,目前仅支持layui内置图标" autocomplete="off" class="layui-input">
</div>
</div>
{:token_meta()}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="vaeform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
{include file="common/foot"}
<script>
layui.config({
base: '__AVIEW__/module/'
}).use(['form','vae'], function(){
var form = layui.form
,layer = layui.layer
,$ = layui.$
,vae = layui.vae;
//监听提交
form.on('submit(vaeform)', function(data){
vae.ajax({
url:"{:url('admin/menu/add')}",
headers:{'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
type:'post',
data:data.field,
success:function(res){
layer.msg(res.msg);
if(res.code == 200){
vae.close();
}
}
})
return false;
});
});
</script>
</body>
</html>