219 lines
8.8 KiB
Plaintext
219 lines
8.8 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>
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||
charset="utf-8"></script>
|
||
|
||
<script type="text/javascript">
|
||
var showPlan4SelectFun = function () {
|
||
$.post(ext.contextPath + '/plan/showPlan4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||
$("#plan4SelectDiv").html(data);
|
||
openModal('plan4SelectModal');
|
||
});
|
||
};
|
||
|
||
//布局选择
|
||
var showLayout4SelectFun = function () {
|
||
$.post(ext.contextPath + '/layout/showLayoutForSelect.do', { formId: "subForm", hiddenId: "layoutId", textId: "layoutName", id: "${id}", layoutId: $('#layoutId').val() }, function (data) {
|
||
$("#plan4SelectDiv").html(data);
|
||
openModal('layout4SelectModal');
|
||
});
|
||
};
|
||
|
||
function dosave() {
|
||
//if ($("#subForm").form('validate')) {
|
||
//console.log($("#subForm").serialize());
|
||
$.post(ext.contextPath + "/plan/savePlan.do", $("#subForm").serialize(), function (result) {
|
||
if (result == 1) {
|
||
initTreeView();
|
||
//showAlert('s','保存成功');
|
||
} else {
|
||
showAlert('d', '保存失败');
|
||
}
|
||
});
|
||
//}
|
||
}
|
||
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
_pname: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '上级列表不能为空'
|
||
}
|
||
}
|
||
},
|
||
layoutName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '布局不能为空'
|
||
}
|
||
}
|
||
},
|
||
|
||
}
|
||
});
|
||
|
||
function saveDefault() {
|
||
if ($("#location").val() == '') {
|
||
top.$.messager.alert('提示', '请先填写菜单地址', 'info');
|
||
} else {
|
||
if ($(".form").form('validate')) {
|
||
$.post(ext.contextPath + "/plan/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 + "/plan/deletePlan.do", $(".form").serialize(), function (result) {
|
||
if (result.res > 0) {
|
||
top.$.messager.alert('提示', "删除成功", 'info', function () {
|
||
//刷新树
|
||
parent.reloadTree();
|
||
parent.$("#mainFrame").attr("src", ext.contextPath + "/plan/showPlanAdd.do?pid=" + $("#pid").val());
|
||
});
|
||
} else {
|
||
top.$.messager.alert('提示', result.msg, 'info');
|
||
}
|
||
}, 'json');
|
||
}
|
||
});
|
||
}
|
||
$(function () {
|
||
//var active=$("#active").select2();
|
||
$("#active").select2({ minimumResultsForSearch: 10 }).val("启用").trigger("change");
|
||
$('#colorContainer').colorpicker({ format: null });
|
||
});
|
||
</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="${id}" />
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<div id="plan4SelectDiv"></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="${plan.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="showPlan4SelectFun();" 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="${plan.location}">
|
||
</div>
|
||
</div> -->
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">顺序</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
||
value="${plan.morder}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">启用</label>
|
||
<div class="col-sm-4">
|
||
<select id="active" name="active" class="form-control select2">
|
||
<option value="启用" selected>启用</option>
|
||
<option value="禁用">禁用</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">背景颜色</label>
|
||
<div class="col-sm-4">
|
||
<div class="input-group " id="colorContainer">
|
||
<input name="backgroundColor" id="backgroundColor" type="text" class="form-control">
|
||
<div class="input-group-addon">
|
||
<i></i>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">背景图路径</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="image" name="image" placeholder="背景图路径"
|
||
value="${plan.image}">
|
||
</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="layoutName" name="layoutName" placeholder="布局选择"
|
||
onclick="showLayout4SelectFun();" value="">
|
||
<input id="layoutId" name="layoutId" type="hidden" value="" />
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">类型</label>
|
||
<div class="col-sm-4">
|
||
<select id="type" name="type" class="form-control select2">
|
||
<option value="plan">方案</option>
|
||
<option value="node">节点</option>
|
||
</select>
|
||
</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="width" name="width" placeholder="宽" value="">
|
||
</div>
|
||
<label class="col-sm-2 control-label">高</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="height" name="height" placeholder="高" value="">
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
</div> |