Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
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
liyang
sts网站
Commits
0bf7457e
Commit
0bf7457e
authored
Nov 25, 2024
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
0f77f524
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
index.vue
ruoyi-ui/src/components/Breadcrumb/index.vue
+11
-8
SidebarItem.vue
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
+3
-4
cache.js
ruoyi-ui/src/plugins/cache.js
+2
-0
index.vue
ruoyi-ui/src/views/system/role/index.vue
+2
-2
No files found.
ruoyi-ui/src/components/Breadcrumb/index.vue
View file @
0bf7457e
...
@@ -41,14 +41,15 @@ export default {
...
@@ -41,14 +41,15 @@ export default {
if
(
index
!==
0
)
item
=
item
.
slice
(
1
)
if
(
index
!==
0
)
item
=
item
.
slice
(
1
)
return
item
return
item
})
})
this
.
getMatched
(
pathList
,
this
.
$store
.
getters
.
sidebarRouter
s
,
matched
)
this
.
getMatched
(
pathList
,
this
.
$store
.
getters
.
defaultRoute
s
,
matched
)
}
else
{
}
else
{
matched
=
router
.
matched
.
filter
(
(
item
)
=>
item
.
meta
&&
item
.
meta
.
title
)
matched
=
router
.
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
)
}
}
// 判断是否为首页
if
(
!
this
.
isDashboard
(
matched
[
0
]))
{
if
(
!
this
.
isDashboard
(
matched
[
0
]))
{
matched
=
[{
path
:
"/index"
,
meta
:
{
title
:
"首页"
}
}].
concat
(
matched
)
matched
=
[{
path
:
"/index"
,
meta
:
{
title
:
"首页"
}
}].
concat
(
matched
)
}
}
this
.
levelList
=
matched
.
filter
(
(
item
)
=>
item
.
meta
&&
item
.
meta
.
title
&&
item
.
meta
.
breadcrumb
!==
false
)
this
.
levelList
=
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
&&
item
.
meta
.
breadcrumb
!==
false
)
},
},
findPathNum
(
str
,
char
=
"/"
)
{
findPathNum
(
str
,
char
=
"/"
)
{
let
index
=
str
.
indexOf
(
char
)
let
index
=
str
.
indexOf
(
char
)
...
@@ -60,11 +61,13 @@ export default {
...
@@ -60,11 +61,13 @@ export default {
return
num
return
num
},
},
getMatched
(
pathList
,
routeList
,
matched
)
{
getMatched
(
pathList
,
routeList
,
matched
)
{
let
data
=
routeList
.
find
((
item
)
=>
item
.
path
==
pathList
[
0
])
let
data
=
routeList
.
find
(
item
=>
item
.
path
==
pathList
[
0
]
||
(
item
.
name
+=
''
).
toLowerCase
()
==
pathList
[
0
])
matched
.
push
(
data
)
if
(
data
)
{
if
(
data
.
children
&&
pathList
.
length
)
{
matched
.
push
(
data
)
pathList
.
shift
()
if
(
data
.
children
&&
pathList
.
length
)
{
this
.
getMatched
(
pathList
,
data
.
children
,
matched
)
pathList
.
shift
()
this
.
getMatched
(
pathList
,
data
.
children
,
matched
)
}
}
}
},
},
isDashboard
(
route
)
{
isDashboard
(
route
)
{
...
...
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
View file @
0bf7457e
...
@@ -62,11 +62,10 @@ export default {
...
@@ -62,11 +62,10 @@ export default {
const
showingChildren
=
children
.
filter
(
item
=>
{
const
showingChildren
=
children
.
filter
(
item
=>
{
if
(
item
.
hidden
)
{
if
(
item
.
hidden
)
{
return
false
return
false
}
else
{
// Temp set(will be used if only has one showing child)
this
.
onlyOneChild
=
item
return
true
}
}
// Temp set(will be used if only has one showing child)
this
.
onlyOneChild
=
item
return
true
})
})
// When there is only one child router, the child router is displayed by default
// When there is only one child router, the child router is displayed by default
...
...
ruoyi-ui/src/plugins/cache.js
View file @
0bf7457e
...
@@ -26,6 +26,7 @@ const sessionCache = {
...
@@ -26,6 +26,7 @@ const sessionCache = {
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
return
JSON
.
parse
(
value
)
return
JSON
.
parse
(
value
)
}
}
return
null
},
},
remove
(
key
)
{
remove
(
key
)
{
sessionStorage
.
removeItem
(
key
);
sessionStorage
.
removeItem
(
key
);
...
@@ -59,6 +60,7 @@ const localCache = {
...
@@ -59,6 +60,7 @@ const localCache = {
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
return
JSON
.
parse
(
value
)
return
JSON
.
parse
(
value
)
}
}
return
null
},
},
remove
(
key
)
{
remove
(
key
)
{
localStorage
.
removeItem
(
key
);
localStorage
.
removeItem
(
key
);
...
...
ruoyi-ui/src/views/system/role/index.vue
View file @
0bf7457e
...
@@ -522,8 +522,8 @@ export default {
...
@@ -522,8 +522,8 @@ export default {
})
})
});
});
});
});
this
.
title
=
"修改角色"
;
});
});
this
.
title
=
"修改角色"
;
},
},
/** 选择角色权限范围触发 */
/** 选择角色权限范围触发 */
dataScopeSelectChange
(
value
)
{
dataScopeSelectChange
(
value
)
{
...
@@ -543,8 +543,8 @@ export default {
...
@@ -543,8 +543,8 @@ export default {
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
checkedKeys
);
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
checkedKeys
);
});
});
});
});
this
.
title
=
"分配数据权限"
;
});
});
this
.
title
=
"分配数据权限"
;
},
},
/** 分配用户操作 */
/** 分配用户操作 */
handleAuthUser
:
function
(
row
)
{
handleAuthUser
:
function
(
row
)
{
...
...
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