...
|
...
|
@@ -15,6 +15,41 @@ |
|
|
|
|
|
<script>
|
|
|
$(function() {
|
|
|
function menuClickInit() {
|
|
|
$('.menuClass').each( function( index, item) {
|
|
|
var url = $(item).attr('url');
|
|
|
var name = $(item).html();
|
|
|
var menu_id = $(item).attr('menu_id');
|
|
|
$(item).click(function(){
|
|
|
if ($("#right").tabs("exists", name)) {
|
|
|
$("#right").tabs("select", name);
|
|
|
} else {
|
|
|
var iframeId = "iframe_" + menu_id;
|
|
|
var iframe = $("<iframe>").attr({
|
|
|
width : "100%",
|
|
|
height : "100%",
|
|
|
frameborder : 0,
|
|
|
id : iframeId
|
|
|
});
|
|
|
if (url.indexOf("?") > 0) {
|
|
|
iframe.attr("src", contextPath + url + "&menuId=" + menu_id + "&iframeId=" + iframeId);
|
|
|
} else {
|
|
|
iframe.attr("src", contextPath + url + "?menuId=" + menu_id + "&iframeId=" + iframeId);
|
|
|
}
|
|
|
|
|
|
|
|
|
$("#right").tabs("add", {
|
|
|
title : name,
|
|
|
content : iframe,
|
|
|
closable : true,
|
|
|
selected : true,
|
|
|
cache : true
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$.post(contextPath + "/loginController/getLoginUserMenu.do", function(data) {
|
|
|
data = data.data;
|
|
|
for (var key in data) {
|
...
|
...
|
@@ -23,13 +58,15 @@ |
|
|
var subMenuDiv = '';
|
|
|
var subMenuHeight = 0;
|
|
|
for (var subMenu in dataList) {
|
|
|
subMenuDiv += '<p url="';
|
|
|
subMenuDiv += '<p class="menuClass" url="';
|
|
|
subMenuDiv += dataList[subMenu]['menu_url'];
|
|
|
subMenuDiv += '" menu_id="';
|
|
|
subMenuDiv += dataList[subMenu]['id'];
|
|
|
subMenuDiv += '">';
|
|
|
subMenuDiv += dataList[subMenu]['menu_name'];
|
|
|
subMenuDiv += '</p>';
|
|
|
|
|
|
subMenuHeight = subMenu * 30;
|
|
|
subMenuHeight = subMenu * 30 + 30;
|
|
|
}
|
|
|
|
|
|
var divGroup = '<div class="panel" style="width: 498px;">';
|
...
|
...
|
@@ -50,6 +87,9 @@ |
|
|
$('.easyui-accordion').append(divGroup);
|
|
|
}
|
|
|
//$("#leftMenu").myTabs("select", 0);
|
|
|
|
|
|
|
|
|
menuClickInit();
|
|
|
});
|
|
|
})
|
|
|
</script> |
|
|
\ No newline at end of file |
...
|
...
|
|