Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ce9f82c7
authored
2025-02-10 17:29:03 +0800
by
xukangle
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
9707d299
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
26 deletions
src/layouts/components/Tabbar/index.vue
src/views/data_transaction/entryManagement.vue
src/layouts/components/Tabbar/index.vue
View file @
ce9f82c
...
...
@@ -46,24 +46,24 @@ watch(
}
}
// isExist.length == 0 && list.push(newRouter);
list
.
map
(
item
=>
{
if
(
combPath
==
'app-scenes'
)
{
item
.
visible
=
item
.
fullPath
==
'/'
}
else
{
if
(
item
.
fullPath
.
split
(
'/'
)?.[
1
]
!=
combPath
)
{
item
.
visible
=
false
}
else
{
item
.
visible
=
true
}
}
})
//
list.map(item => {
//
if (combPath == 'app-scenes') {
//
item.visible = item.fullPath == '/'
//
} else {
//
if (item.fullPath.split('/')?.[1] != combPath) {
//
item.visible = false
//
} else {
//
item.visible = true
//
}
//
}
//
})
tabbarList
.
value
=
list
;
tabbarActive
.
value
=
newRouter
.
fullPath
;
userStore
.
setTabbar
(
tabbarList
.
value
);
userStore
.
setActiveTabbar
(
combPath
,
newRouter
.
fullPath
);
nextTick
(()
=>
{
setTabVisible
()
})
//
nextTick(() => {
//
setTabVisible()
//
})
},
{
immediate
:
true
}
);
...
...
@@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => {
userStore
.
setActiveTabbar
(
combPath
,
paneData
.
fullPath
);
};
const
removeTab
=
(
targetName
)
=>
{
const
tabs
=
tabbarList
.
value
.
filter
(
item
=>
item
.
visible
??
true
);
// const tabs = tabbarList.value.filter(item => item.visible ?? true);
const
tabs
=
tabbarList
.
value
;
let
activeName
=
tabbarActive
.
value
,
nextTab
:
any
=
{};
const
setTabs
=
(
activeTab
)
=>
{
tabbarActive
.
value
=
activeName
;
tabbarList
.
value
=
tabbarList
.
value
.
filter
((
tab
)
=>
tab
.
fullPath
!==
targetName
);
...
...
@@ -94,12 +96,12 @@ const removeTab = (targetName) => {
}
nextTick
(()
=>
{
nextTab
.
name
&&
router
.
push
({
name
:
nextTab
.
name
,
query
:
nextTab
.
query
});
setTabVisible
()
//
setTabVisible()
});
}
let
activeName
=
tabbarActive
.
value
;
let
nextTab
:
any
=
{};
//
let activeName = tabbarActive.value;
//
let nextTab: any = {};
if
(
tabbarActive
.
value
===
targetName
)
{
tabs
.
forEach
((
tab
,
index
)
=>
{
if
(
tab
.
fullPath
===
targetName
)
{
...
...
@@ -112,7 +114,7 @@ const removeTab = (targetName) => {
}
let
activeTab
:
any
=
tabs
.
find
(
t
=>
t
.
fullPath
===
targetName
);
if
(
activeTab
.
meta
.
editPage
)
{
if
(
activeTab
&&
activeTab
.
meta
.
editPage
)
{
ElMessageBox
.
confirm
(
"当前页面尚未保存,确定关闭吗?"
,
"提示"
,
...
...
@@ -140,13 +142,14 @@ const setTabVisible = () => {
const
tabpanes
:
any
=
document
.
querySelectorAll
(
'.tabbar-container .el-tabs__item'
)
let
list
:
any
=
[]
tabpanes
.
forEach
((
tab
,
i
)
=>
{
const
visible
=
tabbarList
.
value
[
i
].
visible
??
true
if
(
!
visible
)
{
tab
.
style
.
display
=
'none'
}
else
{
tab
.
style
.
display
=
'inherit'
// const visible = tabbarList.value[i].visible ?? true
// if (!visible) {
// tab.style.display = 'none'
// } else {
// tab.style.display = 'inherit'
// list.push(tabbarList.value[i].fullPath)
// }
list
.
push
(
tabbarList
.
value
[
i
].
fullPath
)
}
})
visibleTabs
.
value
=
list
}
...
...
@@ -159,7 +162,7 @@ onMounted(() => {
<div
class=
"tabbar-container"
>
<el-tabs
v-model=
"tabbarActive"
type=
"card"
@
tab-click=
"changeTab"
@
tab-remove=
"removeTab"
>
<el-tab-pane
v-for=
"(item, index) in tabbarList"
:key=
"item.fullPath + '_' + index"
:name=
"item.fullPath"
:closable=
"
visibleTabs
.length > 1"
>
:closable=
"
tabbarList
.length > 1"
>
<template
#
label
v-if=
"item.isHomePage"
>
<span
class=
"custom-tabs-label"
>
<el-icon>
...
...
src/views/data_transaction/entryManagement.vue
View file @
ce9f82c
This diff is collapsed.
Click to expand it.
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment