b4Button.jsp
2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- jsp文件头和头部 -->
<%@ include file="../index/top.jsp"%>
<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
<link type="text/css" rel="stylesheet" href="plugins/zTree/2.6/zTreeStyle.css"/>
<script type="text/javascript" src="plugins/zTree/2.6/jquery.ztree-2.6.min.js"></script>
<style type="text/css">
footer{height:50px;position:fixed;bottom:0px;left:0px;width:100%;text-align: center;}
</style>
<body>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
<!-- /section:basics/sidebar -->
<div class="main-content">
<div class="main-content-inner">
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<div id="zhongxin">
<div style="overflow: scroll; scrolling: yes;height:415px;width: 319px;">
<ul id="tree" class="tree" style="overflow:auto;"></ul>
</div>
</div>
<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">正在保存...</h4></div>
</div>
<!-- /.col -->
</div>
</div>
<!-- /.row -->
</div>
<!-- /.page-content -->
</div>
</div>
<!-- /.main-content -->
<div style="width: 100%;padding-top: 5px;" class="center">
<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
</div>
<script type="text/javascript">
$(top.hangge());
var zTree;
$(document).ready(function(){
var setting = {
showLine: true,
checkable: true
};
var zn = '${zTreeNodes}';
var zTreeNodes = eval(zn);
zTree = $("#tree").zTree(setting, zTreeNodes);
});
//保存
function save(){
var nodes = zTree.getCheckedNodes();
var tmpNode;
var ids = "";
for(var i=0; i<nodes.length; i++){
tmpNode = nodes[i];
if(i!=nodes.length-1){
ids += tmpNode.id+",";
}else{
ids += tmpNode.id;
}
}
var msg = "${msg}";
var ROLE_ID = "${ROLE_ID}";
var url = "<%=basePath%>role/saveB4Button.do";
var postData;
postData = {"ROLE_ID":ROLE_ID,"menuIds":ids,"msg":msg};
$("#zhongxin").hide();
$("#zhongxin2").show();
$.post(url,postData,function(data){
top.Dialog.close();
});
}
</script>
</body>
</html>