185 lines
7.4 KiB
Plaintext
185 lines
7.4 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single{
|
|||
|
|
height:34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
.select2-selection__arrow{
|
|||
|
|
margin-top:3px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var showMenu4SelectFun = function() {
|
|||
|
|
$.post(ext.contextPath + '/command/importantConfigure/showMenu4Select_new.do', {formId:"subForm",hiddenId:"pid",textId:"_pname"} , function(data) {
|
|||
|
|
$("#menu4SelectDiv").html(data);
|
|||
|
|
openModal('menu4SelectModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
function dosave() {
|
|||
|
|
//if ($("#subForm").form('validate')) {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
$.post(ext.contextPath + "/command/importantConfigure/saveMenu_new.do", $("#subForm").serialize(), function(result) {
|
|||
|
|
if (result == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
//showAlert('s','保存成功');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
var showUser4SelectsFun = function() {
|
|||
|
|
var userIds= $("#firstpersonid").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"firstpersonid",textId:"firstperson",userIds:userIds} , function(data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function saveDefault() {
|
|||
|
|
if($("#location").val()==''){
|
|||
|
|
top.$.messager.alert('提示','请先填写菜单地址','info');
|
|||
|
|
}else{
|
|||
|
|
if ($(".form").form('validate')) {
|
|||
|
|
$.post(ext.contextPath + "/user/saveDefaultFunc.do", $(".form").serialize(), function(result) {
|
|||
|
|
if (result > 0) {
|
|||
|
|
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
|||
|
|
$('#grid').datagrid('reload');
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function dodel() {
|
|||
|
|
top.$.messager.confirm('提示', '确定删除此菜单?', function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
$.post(ext.contextPath + "/user/deleteMenu.do", $(".form").serialize(), function(result) {
|
|||
|
|
if (result.res > 0) {
|
|||
|
|
top.$.messager.alert('提示', "删除成功", 'info', function() {
|
|||
|
|
//刷新树
|
|||
|
|
parent.reloadTree();
|
|||
|
|
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuAdd.do?pid="+$("#pid").val());
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
top.$.messager.alert('提示', result.msg, 'info');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
$(function() {
|
|||
|
|
//var active=$("#active").select2();
|
|||
|
|
$("#st").select2({minimumResultsForSearch: -1}).val("${menu.st}").trigger("change");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//提交验收判断
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
st: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '启用'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary" >
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">新增类别</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${menu.id}"/>
|
|||
|
|
<input id="tags" type="hidden" name="tags" value="${tags}">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="menu4SelectDiv"></div>
|
|||
|
|
<div id="user4SelectDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${menu.name }">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">上级菜单</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="_pname" name ="_pname" placeholder="上级菜单" onclick="showMenu4SelectFun();" value="${pname}">
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- <div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">地址</label>
|
|||
|
|
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="text" class="form-control" id="location" name ="location" placeholder="地址" value="${menu.location}">
|
|||
|
|
</div>
|
|||
|
|
</div> -->
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="ord" name ="ord" placeholder="顺序" value="${menu.ord}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id ="st" name="st" class="form-control select2">
|
|||
|
|
<option value="启用" >启用</option>
|
|||
|
|
<option value="禁用" >禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<c:if test="${tags=='2'}" >
|
|||
|
|
<label class="col-sm-2 control-label">等级</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="grade" name ="grade" placeholder="顺序" value="${menu.grade}">
|
|||
|
|
</div>
|
|||
|
|
</c:if>
|
|||
|
|
|
|||
|
|
<label class="col-sm-2 control-label">总负责人</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<!-- <input type="text" class="form-control" id="firstperson" name ="firstperson" placeholder="总负责人" value="${menu.firstperson}"> -->
|
|||
|
|
|
|||
|
|
<input type="text" class="form-control" id="firstperson" name ="firstperson" placeholder="总负责人" value="${menu.firstperson}" onclick="showUser4SelectsFun();">
|
|||
|
|
<input id="firstpersonid" name="firstpersonid" type="hidden" value="${menu.firstpersonid}" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">总体介绍</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<textarea name="memo" id="memo"
|
|||
|
|
class="form-control" value="${menu.memo }"></textarea>
|
|||
|
|
<!-- <input type="text" class="form-control" id="memo" name ="memo" placeholder="等级" value="${menu.memo}"> -->
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<label class="col-sm-2 control-label">启动条件</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<!-- <input type="text" class="form-control" id="startingcondition" name ="startingcondition" placeholder="总负责人" value="${menu.startingcondition}"> -->
|
|||
|
|
<textarea name="startingcondition"
|
|||
|
|
class="form-control" id="startingcondition" value="${menu.startingcondition }"
|
|||
|
|
></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|