Authored by kun

Merge remote-tracking branch 'origin/master'

... ... @@ -74,39 +74,9 @@
maxSizeAble : true
});
});
//打开页面
function addTab(item) {
//if (item.menu_url.indexOf(".html") >= 0) {
//新的页面
if ($("#right").tabs("exists", item.menu_name)) {
$("#right").tabs("select", item.menu_name);
} else {
var iframeId = "iframe_" + item.id;
var iframe = $("<iframe>").attr({
width : "100%",
height : "100%",
frameborder : 0,
id : iframeId
});
if (item.menu_url.indexOf("?") > 0) {
iframe.attr("src", contextPath + item.menu_url + "&menuId=" + item.id + "&iframeId=" + iframeId);
} else {
iframe.attr("src", contextPath + item.menu_url + "?menuId=" + item.id + "&iframeId=" + iframeId);
}
$("#right").tabs("add", {
title : item.menu_name,
content : iframe,
closable : true,
selected : true,
cache : true
});
}
//} else {
//老页面
// window.open(adminPortalUrl + item.menu_url);
//}
}
</script>
</body>
</html>
... ...
... ... @@ -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
... ...