Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-web-vue
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
isc-v3.1-tmp
isc-web-vue
Commits
f6d550cb
Commit
f6d550cb
authored
Oct 24, 2024
by
李少勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理路由报错问题
parent
e476c783
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
MenuTabs.vue
src/page/Home/aside/MenuTabs.vue
+15
-12
index.vue
src/page/index.vue
+4
-2
No files found.
src/page/Home/aside/MenuTabs.vue
View file @
f6d550cb
...
...
@@ -297,33 +297,36 @@ export default {
return
newObj
;
},
setDefaultTabs
()
{
// 页签拷贝
this
.
defaultTabList
.
forEach
((
item
,
index
)
=>
{
let
newItem
=
this
.
deepCloneObj
(
item
);
if
(
item
.
path
==
"/home"
)
{
newItem
[
"width"
]
=
this
.
homeTagWidth
;
newItem
[
"hidden"
]
=
false
;
}
this
.
tabList
.
push
(
newItem
);
});
// 处理刷新页签不显示问题
let
curRoute
=
this
.
$route
let
flag
=
this
.
defaultTabList
.
some
((
item
)
=>
{
return
item
.
path
==
curRoute
.
path
})
if
(
curRoute
.
meta
.
keepAlive
&&
!
flag
)
{
this
.
defaultT
abList
.
push
({
this
.
t
abList
.
push
({
name
:
curRoute
.
name
,
path
:
curRoute
.
fullPath
,
text
:
curRoute
.
meta
.
title
||
'no-title'
,
hidden
:
false
,
routePath
:
curRoute
.
path
,
routeName
:
curRoute
.
name
routeName
:
curRoute
.
name
,
route
:
curRoute
})
}
// 页签拷贝
this
.
defaultTabList
.
forEach
((
item
,
index
)
=>
{
let
newItem
=
this
.
deepCloneObj
(
item
);
if
(
item
.
path
==
"/home"
)
{
newItem
[
"width"
]
=
this
.
homeTagWidth
;
newItem
[
"hidden"
]
=
false
;
}
this
.
tabList
.
push
(
newItem
);
if
(
item
.
path
!=
"/home"
)
{
this
.
tabList
.
map
((
ite
,
index
)
=>
{
if
(
ite
.
path
!=
"/home"
)
{
this
.
calcTagsWidth
(
index
,
"+"
,
true
);
}
});
})
this
.
$store
.
commit
(
"setTagsArry"
,
this
.
tabList
);
},
calcTagsWidth
(
index
,
calc
,
callback
)
{
...
...
src/page/index.vue
View file @
f6d550cb
...
...
@@ -581,8 +581,10 @@ export default {
let
orgObj
=
this
.
header
.
orgList
.
find
(
item
=>
item
.
id
===
param
)
let
roleObj
=
this
.
header
.
roleTypeList
.
find
(
item
=>
item
.
key
===
this
.
header
.
curRole
.
id
+
""
)
this
.
initRoleList
(
orgObj
);
if
(
this
.
header
.
roleList
&&
this
.
header
.
roleList
.
length
>
0
&&
((
orgObj
.
departmentNumber
===
"1000"
&&
roleObj
.
value
!==
"HEAD"
)
||
(
orgObj
.
departmentNumber
!==
"1000"
&&
roleObj
.
value
===
"HEAD"
))){
if
(
this
.
header
.
roleList
&&
this
.
header
.
roleList
.
length
>
0
&&
((
orgObj
.
departmentNumber
===
"1000"
&&
roleObj
&&
roleObj
.
value
!==
"HEAD"
)
||
(
orgObj
.
departmentNumber
!==
"1000"
&&
(
roleObj
&&
roleObj
.
value
===
"HEAD"
)))
){
this
.
changeRoles
(
this
.
header
.
roleList
[
0
].
id
);
sessionStorage
.
setItem
(
'curRole'
,
JSON
.
stringify
(
this
.
header
.
roleList
[
0
]));
}
...
...
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