mirror of https://gitee.com/y_project/RuoYi.git
支持iframe局部刷新页面
parent
01f40d91ec
commit
f9a2f9e0f4
|
@ -219,6 +219,7 @@ $(function() {
|
||||||
flag = true;
|
flag = true;
|
||||||
$(".nav ul li, .nav li").removeClass("selected");
|
$(".nav ul li, .nav li").removeClass("selected");
|
||||||
$(this).parent("li").addClass("selected");
|
$(this).parent("li").addClass("selected");
|
||||||
|
setIframeUrl($(this).attr("href"));
|
||||||
if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;
|
if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;
|
||||||
|
|
||||||
// 选项卡菜单已存在
|
// 选项卡菜单已存在
|
||||||
|
@ -469,6 +470,13 @@ $(function() {
|
||||||
$('#ax_close_max').show();
|
$('#ax_close_max').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置锚点
|
||||||
|
function setIframeUrl(href) {
|
||||||
|
var nowUrl = window.location.href;
|
||||||
|
var newUrl = nowUrl.substring(0, nowUrl.indexOf("#"));
|
||||||
|
window.location.href = newUrl + "#" + href;
|
||||||
|
}
|
||||||
|
|
||||||
$(window).keydown(function(event) {
|
$(window).keydown(function(event) {
|
||||||
if (event.keyCode == 27) {
|
if (event.keyCode == 27) {
|
||||||
$('#content-main').removeClass('max');
|
$('#content-main').removeClass('max');
|
||||||
|
@ -476,6 +484,12 @@ $(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.onhashchange = function() {
|
||||||
|
var hash = location.hash;
|
||||||
|
var url = hash.substring(1, hash.length);
|
||||||
|
$('a[href$="' + url + '"]').click();
|
||||||
|
};
|
||||||
|
|
||||||
// 右键菜单实现
|
// 右键菜单实现
|
||||||
$.contextMenu({
|
$.contextMenu({
|
||||||
selector: ".menuTab",
|
selector: ".menuTab",
|
||||||
|
|
|
@ -27,9 +27,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-collapse">
|
<div class="sidebar-collapse">
|
||||||
<ul class="nav" id="side-menu">
|
<ul class="nav" id="side-menu">
|
||||||
<li class="logo">
|
<a th:href="@{/index}">
|
||||||
<span class="logo-lg">RuoYi</span>
|
<li class="logo">
|
||||||
</li>
|
<span class="logo-lg" >RuoYi</span>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
<li>
|
<li>
|
||||||
<div class="user-panel">
|
<div class="user-panel">
|
||||||
<a class="menuItem" title="个人中心" th:href="@{/system/user/profile}">
|
<a class="menuItem" title="个人中心" th:href="@{/system/user/profile}">
|
||||||
|
@ -45,7 +47,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="active">
|
<li>
|
||||||
<a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
|
<a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-second-level">
|
<ul class="nav nav-second-level">
|
||||||
<li class="active"><a class="menuItem" th:href="@{/system/main}">了解若依</a></li>
|
<li class="active"><a class="menuItem" th:href="@{/system/main}">了解若依</a></li>
|
||||||
|
@ -272,6 +274,15 @@ function switchSkin() {
|
||||||
content : [ctx + "system/switchSkin", 'no']
|
content : [ctx + "system/switchSkin", 'no']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var hash = location.hash;
|
||||||
|
if (hash !== '') {
|
||||||
|
var url = hash.substring(1, hash.length);
|
||||||
|
$('a[href$="' + url + '"]').parent("li").addClass("selected").parents("li").addClass("active").end().parents("ul").addClass("in");
|
||||||
|
$('a[href$="' + url + '"]').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue