2025-11-27 16:55:35 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../css/font-awesome/css/font-awesome.css">
|
2025-12-15 15:23:57 +08:00
|
|
|
<style>
|
|
|
|
|
@media (min-width:768px){.form-horizontal .control-label{padding-top:20px;margin-bottom:0;text-align:right}}
|
|
|
|
|
</style>
|
2025-11-27 16:55:35 +08:00
|
|
|
</head>
|
2025-12-15 15:23:57 +08:00
|
|
|
<body >
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding: 0 24px 0 24px;">
|
2025-11-27 16:55:35 +08:00
|
|
|
<form class="form-horizontal" onsubmit="return false" id="form">
|
|
|
|
|
<fieldset>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">上级菜单</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<select id="parentId" name="parentId" class="form-control input-sm"></select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">名称</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="名称" type="text" name="name" id="name"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="名称 不能为空">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">样式</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<button onclick="selectCss()" class="btn btn-primary">选择</button>
|
|
|
|
|
<input type="hidden" name="css" id="css" /><i id="cssImg" class="fa"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">链接</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="链接" name="href" id="href"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">类型</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<select name="type" class="form-control input-sm">
|
|
|
|
|
<option value="1">菜单</option>
|
|
|
|
|
<option value="2">按钮</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">权限</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="权限" name="permission" id="permission" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">排序</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="排序" name="sort" id="sort" type="number" value="100"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="排序 不能为空">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label">资源类型</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<select id="permissionType" class="form-control input-sm " name="permissionType">
|
|
|
|
|
<option value="后台">后台</option>
|
|
|
|
|
<option value="自有人员后台">自有人员后台</option>
|
|
|
|
|
<option value="APP">APP</option>
|
|
|
|
|
<option value="自有人员APP">自有人员APP</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<div class="row" align="center">
|
|
|
|
|
<div class="col-md-12">
|
2025-12-15 15:23:57 +08:00
|
|
|
<button class="btn btn-primary" onclick="cancel()">返回</button>
|
2025-11-27 16:55:35 +08:00
|
|
|
<button class="btn btn-primary" type="submit" onclick="add()">
|
2025-12-15 15:23:57 +08:00
|
|
|
保存
|
2025-11-27 16:55:35 +08:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="../../js/libs/jquery-3.6.0.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/jq.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/common.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/my/ztree-menu.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../layui/layui.js"></script>
|
2025-12-09 18:44:29 +08:00
|
|
|
<script type="text/javascript" src="../../../public/public.js"></script>
|
2025-11-27 16:55:35 +08:00
|
|
|
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
layui.use('layer', function(){
|
|
|
|
|
var layer = layui.layer;
|
|
|
|
|
});
|
2025-12-15 15:23:57 +08:00
|
|
|
|
|
|
|
|
|
2025-11-27 16:55:35 +08:00
|
|
|
initParentMenuSelect();
|
2025-12-15 15:23:57 +08:00
|
|
|
|
2025-11-27 16:55:35 +08:00
|
|
|
function add() {
|
|
|
|
|
$('#form').bootstrapValidator();
|
|
|
|
|
var bootstrapValidator = $("#form").data('bootstrapValidator');
|
|
|
|
|
bootstrapValidator.validate();
|
|
|
|
|
if(!bootstrapValidator.isValid()){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-12-15 15:23:57 +08:00
|
|
|
|
2025-11-27 16:55:35 +08:00
|
|
|
var formdata = $("#form").serializeObject();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'post',
|
2025-12-09 18:44:29 +08:00
|
|
|
url : smz_ht_url + '/permissions',
|
2025-12-15 15:23:57 +08:00
|
|
|
contentType: "application/json; charset=utf-8",
|
2025-11-27 16:55:35 +08:00
|
|
|
data : JSON.stringify(formdata),
|
|
|
|
|
success : function(data) {
|
|
|
|
|
layer.msg("添加成功", {shift: -1, time: 1000}, function(){
|
2025-12-15 15:23:57 +08:00
|
|
|
setTimeout("reloading()", 2100);
|
2025-11-27 16:55:35 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-12-15 15:23:57 +08:00
|
|
|
|
2025-11-27 16:55:35 +08:00
|
|
|
function selectCss(){
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: "样式",
|
|
|
|
|
area: ['800px', '400px'],
|
|
|
|
|
maxmin: true,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
content: ['icon.html']
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-12-15 15:23:57 +08:00
|
|
|
|
|
|
|
|
//设置弹窗关闭
|
|
|
|
|
function reloading() {
|
|
|
|
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
|
|
|
|
parent.layer.close(index); //再执行关闭
|
|
|
|
|
window.parent.refreshMenuList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cancel(){
|
|
|
|
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
|
|
|
|
parent.layer.close(index); //再执行关闭
|
|
|
|
|
}
|
2025-11-27 16:55:35 +08:00
|
|
|
</script>
|
|
|
|
|
</body>
|
2025-12-15 15:23:57 +08:00
|
|
|
</html>
|