Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
829dfafd
Commit
829dfafd
authored
Jun 24, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增isLinkage支持页签与菜单联动
parent
5a596701
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
ruoyi-admin/src/main/resources/static/ruoyi/index.js
+6
-3
ruoyi-admin/src/main/resources/templates/index.html
+15
-0
No files found.
ruoyi-admin/src/main/resources/static/ruoyi/index.js
View file @
829dfafd
...
...
@@ -239,9 +239,12 @@ $(function() {
dataIndex
=
$
(
this
).
data
(
'index'
),
menuName
=
$
.
trim
(
$
(
this
).
text
()),
flag
=
true
;
$
(
".nav ul li, .nav li"
).
removeClass
(
"selected"
);
$
(
this
).
parent
(
"li"
).
addClass
(
"selected"
);
setIframeUrl
(
$
(
this
).
attr
(
"href"
));
if
(
!
$
(
'a[href$="'
+
dataUrl
+
'"]'
).
hasClass
(
"noactive"
))
{
$
(
".nav ul li, .nav li"
).
removeClass
(
"selected"
);
$
(
this
).
parent
(
"li"
).
addClass
(
"selected"
);
}
setIframeUrl
(
dataUrl
);
if
(
dataUrl
==
undefined
||
$
.
trim
(
dataUrl
).
length
==
0
)
return
false
;
// 选项卡菜单已存在
...
...
ruoyi-admin/src/main/resources/templates/index.html
View file @
829dfafd
...
...
@@ -258,6 +258,8 @@ var skin = storage.get("skin");
var
mode
=
"history"
;
// 历史访问路径缓存
var
historyPath
=
storage
.
get
(
"historyPath"
);
// 是否页签与菜单联动
var
isLinkage
=
true
;
// 本地主题优先,未设置取系统配置
if
(
$
.
common
.
isNotEmpty
(
skin
)){
...
...
@@ -305,6 +307,19 @@ $(function() {
applyPath
(
url
);
}
}
if
(
isLinkage
)
{
$
(
".menuTabs"
).
on
(
"click"
,
".menuTab"
,
function
()
{
var
dataId
=
$
(
this
).
attr
(
"data-id"
);
var
$dataObj
=
$
(
'a[href$="'
+
decodeURI
(
dataId
)
+
'"]'
);
if
(
!
$dataObj
.
hasClass
(
"noactive"
))
{
$
(
'.nav ul'
).
removeClass
(
"in"
);
$dataObj
.
parents
(
"ul"
).
addClass
(
"in"
)
$dataObj
.
parents
(
"li"
).
addClass
(
"active"
).
siblings
().
removeClass
(
"active"
).
find
(
'li'
).
removeClass
(
"active"
);
$dataObj
.
parents
(
"ul"
).
css
(
'height'
,
'auto'
).
height
();
$
(
'a[href$="'
+
decodeURI
(
dataId
)
+
'"]'
).
click
();
}
})
}
});
</script>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment