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
bb0e7bd5
Commit
bb0e7bd5
authored
Jun 28, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
右键页签操作实现与菜单联动
parent
7bca4fcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
ruoyi-admin/src/main/resources/static/ruoyi/index.js
+15
-16
ruoyi-admin/src/main/resources/templates/index.html
+0
-6
No files found.
ruoyi-admin/src/main/resources/static/ruoyi/index.js
View file @
bb0e7bd5
...
...
@@ -71,16 +71,20 @@ $(window).bind("load resize", function() {
}
}
});
function
syncMenuTab
(
dataId
)
{
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
();
$dataObj
.
click
();
}
if
(
isLinkage
)
{
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
();
$dataObj
.
click
();
}
}
}
function
NavToggle
()
{
$
(
'.navbar-minimalize'
).
trigger
(
'click'
);
}
...
...
@@ -128,6 +132,7 @@ $(function() {
function
setActiveTab
(
element
)
{
if
(
!
$
(
element
).
hasClass
(
'active'
))
{
var
currentId
=
$
(
element
).
data
(
'id'
);
syncMenuTab
(
currentId
);
// 显示tab对应的内容区
$
(
'.RuoYi_iframe'
).
each
(
function
()
{
if
(
$
(
this
).
data
(
'id'
)
==
currentId
)
{
...
...
@@ -395,8 +400,6 @@ $(function() {
});
}
scrollToTab
(
$
(
'.menuTab.active'
));
setIframeUrl
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
syncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
return
false
;
}
...
...
@@ -413,6 +416,7 @@ $(function() {
function
activeTab
()
{
if
(
!
$
(
this
).
hasClass
(
'active'
))
{
var
currentId
=
$
(
this
).
data
(
'id'
);
syncMenuTab
(
currentId
);
// 显示tab对应的内容区
$
(
'.mainContent .RuoYi_iframe'
).
each
(
function
()
{
if
(
$
(
this
).
data
(
'id'
)
==
currentId
)
{
...
...
@@ -455,7 +459,6 @@ $(function() {
$
(
this
).
remove
();
});
$
(
'.page-tabs-content'
).
css
(
"margin-left"
,
"0"
);
setIframeUrl
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
// 关闭全部选项卡
...
...
@@ -469,7 +472,7 @@ $(function() {
$
(
this
).
addClass
(
"active"
);
});
$
(
'.page-tabs-content'
).
css
(
"margin-left"
,
"0"
);
s
etIframeUrl
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
s
yncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
...
...
@@ -562,7 +565,6 @@ $(function() {
callback
:
function
(
key
,
opt
)
{
setActiveTab
(
this
);
tabCloseOther
();
syncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
},
"close_left"
:
{
...
...
@@ -578,7 +580,6 @@ $(function() {
$
(
this
).
remove
();
});
$
(
'.page-tabs-content'
).
css
(
"margin-left"
,
"0"
);
syncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
},
"close_right"
:
{
...
...
@@ -590,7 +591,6 @@ $(function() {
$
(
'.menuTab[data-id="'
+
$
(
this
).
data
(
'id'
)
+
'"]'
).
remove
();
$
(
this
).
remove
();
});
syncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
},
"close_all"
:
{
...
...
@@ -598,7 +598,6 @@ $(function() {
icon
:
"fa-window-close"
,
callback
:
function
(
key
,
opt
)
{
tabCloseAll
();
syncMenuTab
(
$
(
'.page-tabs-content'
).
find
(
'.active'
).
attr
(
'data-id'
));
}
},
"step"
:
"---------"
,
...
...
ruoyi-admin/src/main/resources/templates/index.html
View file @
bb0e7bd5
...
...
@@ -307,12 +307,6 @@ $(function() {
applyPath
(
url
);
}
}
if
(
isLinkage
)
{
$
(
".menuTabs"
).
on
(
"click"
,
".menuTab"
,
function
()
{
var
dataId
=
$
(
this
).
attr
(
"data-id"
);
syncMenuTab
(
dataId
);
})
}
});
</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