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
7b4c8f89
Commit
7b4c8f89
authored
Jun 01, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增关闭左侧/关闭右侧/新窗口打开
parent
b1f4952c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
5 deletions
+64
-5
ruoyi-admin/src/main/resources/static/ruoyi/index.js
+64
-5
No files found.
ruoyi-admin/src/main/resources/static/ruoyi/index.js
View file @
7b4c8f89
...
...
@@ -91,6 +91,21 @@ $(function() {
});
return
width
;
}
// 激活指定选项卡
function
setActiveTab
(
element
)
{
if
(
!
$
(
element
).
hasClass
(
'active'
))
{
var
currentId
=
$
(
element
).
data
(
'id'
);
// 显示tab对应的内容区
$
(
'.RuoYi_iframe'
).
each
(
function
()
{
if
(
$
(
this
).
data
(
'id'
)
==
currentId
)
{
$
(
this
).
show
().
siblings
(
'.RuoYi_iframe'
).
hide
();
}
});
$
(
element
).
addClass
(
'active'
).
siblings
(
'.menuTab'
).
removeClass
(
'active'
);
scrollToTab
(
element
);
}
}
//滚动到指定选项卡
function
scrollToTab
(
element
)
{
...
...
@@ -344,7 +359,7 @@ $(function() {
scrollToTab
(
$
(
'.menuTab.active'
));
return
false
;
}
$
(
'.menuTabs'
).
on
(
'click'
,
'.menuTab i'
,
closeTab
);
//滚动到已激活的选项卡
...
...
@@ -473,30 +488,74 @@ $(function() {
},
"close_other"
:
{
name
:
"关闭其他"
,
icon
:
"fa-
close
"
,
icon
:
"fa-
window-close-o
"
,
callback
:
function
(
key
,
opt
)
{
setActiveTab
(
this
);
tabCloseOther
();
}
},
"close_left"
:
{
name
:
"关闭左侧"
,
icon
:
"fa-reply"
,
callback
:
function
(
key
,
opt
)
{
setActiveTab
(
this
);
this
.
prevAll
(
'.menuTab'
).
not
(
":last"
).
each
(
function
()
{
if
(
$
(
this
).
hasClass
(
'active'
))
{
setActiveTab
(
this
);
}
$
(
'.RuoYi_iframe[data-id="'
+
$
(
this
).
data
(
'id'
)
+
'"]'
).
remove
();
$
(
this
).
remove
();
});
$
(
'.page-tabs-content'
).
css
(
"margin-left"
,
"0"
);
}
},
"close_right"
:
{
name
:
"关闭右侧"
,
icon
:
"fa-share"
,
callback
:
function
(
key
,
opt
)
{
setActiveTab
(
this
);
this
.
nextAll
(
'.menuTab'
).
each
(
function
()
{
$
(
'.menuTab[data-id="'
+
$
(
this
).
data
(
'id'
)
+
'"]'
).
remove
();
$
(
this
).
remove
();
});
}
},
"close_all"
:
{
name
:
"全部关闭"
,
icon
:
"fa-close"
,
icon
:
"fa-
window-
close"
,
callback
:
function
(
key
,
opt
)
{
tabCloseAll
();
}
},
"step"
:
"---------"
,
"full"
:
{
name
:
"全屏显示"
,
icon
:
"fa-arrows-alt"
,
callback
:
function
(
key
,
opt
)
{
activeTabMax
();
setActiveTab
(
this
);
opt
.
$trigger
.
find
(
'i'
).
trigger
(
"dblclick"
);
}
},
"refresh"
:
{
name
:
"刷新页面"
,
icon
:
"fa-refresh"
,
callback
:
function
(
key
,
opt
)
{
refreshTab
();
setActiveTab
(
this
);
var
target
=
$
(
'.RuoYi_iframe[data-id="'
+
this
.
data
(
'id'
)
+
'"]'
);
var
url
=
target
.
attr
(
'src'
);
target
.
attr
(
'src'
,
url
).
ready
();
$
.
modal
.
loading
(
"数据加载中,请稍后..."
);
target
.
attr
(
'src'
,
url
).
load
(
function
()
{
$
.
modal
.
closeLoading
();
});
}
},
"open"
:
{
name
:
"新窗口打开"
,
icon
:
"fa-link"
,
callback
:
function
(
key
,
opt
)
{
var
target
=
$
(
'.RuoYi_iframe[data-id="'
+
this
.
data
(
'id'
)
+
'"]'
);
window
.
open
(
target
.
attr
(
'src'
));
}
},
}
...
...
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