Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
wangtao
2 years ago
Commit
92ba8c1906315b7b1e9230cb714cee760e687a73
1 parent
f522995d
页签展示问题;标题设置
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
hg-monitor-web-base/src/main/resources/static/src/index.js
hg-monitor-web-base/src/main/resources/static/src/views/business/index.html
hg-monitor-web-base/src/main/resources/static/src/index.js
View file @
92ba8c1
...
...
@@ -101,6 +101,13 @@ layui.extend({
}
//请求视图渲染
view
().
render
(
path
.
join
(
'/'
)).
then
(
function
(
res
)
{
let
pageId
=
pathURL
;
// 如果地址是通用页面,business/index/redirectUrl
if
(
router
.
href
.
indexOf
(
'business/index/redirectUrl'
)
!=
-
1
){
pageId
=
router
.
href
;
}
//遍历页签选项卡
var
matchTo
,
tabs
=
$
(
'#LAY_app_tabsheader>li'
);
...
...
@@ -108,7 +115,7 @@ layui.extend({
tabs
.
each
(
function
(
index
)
{
var
li
=
$
(
this
)
,
layid
=
li
.
attr
(
'lay-id'
);
if
(
layid
===
pa
thURL
)
{
if
(
layid
===
pa
geId
)
{
matchTo
=
true
;
tabsPage
.
index
=
index
;
}
...
...
@@ -130,10 +137,14 @@ layui.extend({
}
catch
(
e
)
{
}
if
(
!
tabName
)
{
// 获取路由页面名称
let
name
=
router
.
search
.
name
;
//lsq 页面刷新后名称改变 2022-03-30
if
(
routerPath
.
indexOf
(
'ajConfig'
)
!=
-
1
&&
routerPath
.
indexOf
(
'view'
)
!=
-
1
)
{
tabName
=
localStorage
.
getItem
(
router
.
search
.
ajConfig
);
}
else
{
}
else
if
(
name
){
tabName
=
name
;
}
else
{
tabName
=
res
.
title
}
...
...
@@ -144,9 +155,10 @@ layui.extend({
if
(
!
matchTo
)
{
$
(
APP_BODY
).
append
(
'<div class="layadmin-tabsbody-item layui-show"></div>'
);
tabsPage
.
index
=
tabs
.
length
;
element
.
tabAdd
(
FILTER_TAB_TBAS
,
{
title
:
'<span>'
+
(
tabName
||
'新标签页'
)
+
'</span>'
,
id
:
pa
thURL
,
id
:
pa
geId
,
attr
:
router
.
href
});
}
...
...
@@ -156,9 +168,9 @@ layui.extend({
setter
.
pageTabs
||
this
.
container
.
scrollTop
(
0
);
//如果不开启标签页,则跳转时重置滚动条
//定位当前tabs
element
.
tabChange
(
FILTER_TAB_TBAS
,
pa
thURL
);
element
.
tabChange
(
FILTER_TAB_TBAS
,
pa
geId
);
// 修改为当前菜单名称
$
(
'* [lay-id="'
+
pa
thURL
+
'"] span'
).
text
(
tabName
)
$
(
'* [lay-id="'
+
pa
geId
+
'"] span'
).
text
(
tabName
)
admin
.
tabsBodyChange
(
tabsPage
.
index
);
}).
done
(
function
()
{
...
...
hg-monitor-web-base/src/main/resources/static/src/views/business/index.html
View file @
92ba8c1
<title
id=
"indexTitle"
>
</title>
<title
id=
"indexTitle"
>
</title>
<script
template
type=
"text/html"
>
{{
#
...
...
@@ -8,7 +8,10 @@
var
pageVersion
=
router
.
search
.
pageVersion
;
if
(
label
){
$
(
'#indexTitle span'
).
val
(
label
);
setTimeout
(()
=>
{
$
(
'.layui-this span'
).
text
(
decodeURIComponent
(
label
));
$
(
'#indexTitle'
).
text
(
label
);
},
200
);
}
if
(
redirectUrl
){
redirectUrl
=
redirectUrl
.
replace
(
"$$"
,
"#/"
).
replace
(
/
[
$
]
/g
,
'/'
);
...
...
Please
register
or
login
to post a comment