<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css"
href="jquery-easyui-1.4.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
href="jquery-easyui-1.4.4/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.4.4/jquery.min.js"></script>
<script type="text/javascript"
src="jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
src="jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/login.js"></script>
<script type="text/javascript">
$(function() {
var treeData = [ {
text : '系统管理',
iconCls : 'icon-save',
collapse : false,
state : 'closed',
children : [ {
text : "用户管理",
iconCls : "icon-add",
attributes : {
url : "user.jsp"
}
}, {
text : "部门管理",
iconCls : "icon-add",
attributes : {
url : "dept.jsp"
}
}, {
text : "角色管理",
iconCls : "icon-add",
attributes : {
url : "roles.jsp"
}
}, {
text : "权限管理",
iconCls : "icon-add",
attributes : {
url : "limit.jsp"
}
} ]
}, {
text : 'Item2'
} ];
$('#tree').tree({
data : treeData,
onClick : function(node) {
if (node.attributes) {
openTab(node.text, node.attributes.url);
}
}
});
function openTab(title, url) {
//判断是否已存在
alert("info-select" + title + "URL:" + url);
if ($('#tab-list').tabs('exists', title)) {
$('#tab-list').tabs('select', title);
} else {
//新增tab
$('#tab-list').tabs('add', {
title : title,
content : createTabContent(url)
});
$("#tab-list").tabs('add', {
title : 'new tab',
selected : false
});
}
}
/* 生成tab内容 */
function createTabContent(url) {
return '<iframe style="width:100%;height:98%;" scrolling="auto" frameborder="0" src="'
+ url + '"></iframe>';
}
});
</script>
</head>
<body id="cc" class="easyui-layout" style="width:100%;height:100%">
<div id="tab-list1"
data-options="region:'north',title:'信息提示',split:false"
style="height:100px;"></div>
<div id="tab-list2"
data-options="region:'west',title:'导航菜单',split:true"
style="width:200px;">
<ul id="tree"></ul>
</div>
<div id="tab-list" data-options="region:'center',title:'首页'"
style="padding:5px;background:#eee;"></div>
</body>
</html>