Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
4e566ea6
Commit
4e566ea6
authored
Jun 22, 2020
by
ZhengJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[代码优化](v2.5): 优化角色分配菜单
close
https://github.com/elunez/eladmin/issues/413
parent
99097018
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
src/views/system/role/index.vue
+3
-10
No files found.
src/views/system/role/index.vue
View file @
4e566ea6
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<
script
>
<
script
>
import
crudRoles
from
'@/api/system/role'
import
crudRoles
from
'@/api/system/role'
import
{
getDepts
,
getDeptSuperior
}
from
'@/api/system/dept'
import
{
getDepts
,
getDeptSuperior
}
from
'@/api/system/dept'
import
{
getMenusTree
,
getMenuSuperior
}
from
'@/api/system/menu'
import
{
getMenusTree
}
from
'@/api/system/menu'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'@crud/crud'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'@crud/crud'
import
rrOperation
from
'@crud/RR.operation'
import
rrOperation
from
'@crud/RR.operation'
import
crudOperation
from
'@crud/CRUD.operation'
import
crudOperation
from
'@crud/CRUD.operation'
...
@@ -227,24 +227,17 @@ export default {
...
@@ -227,24 +227,17 @@ export default {
// 触发单选
// 触发单选
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
if
(
val
)
{
if
(
val
)
{
// 先将保存按钮置灰
this
.
showButton
=
false
const
_this
=
this
const
_this
=
this
// 清空菜单的选中
// 清空菜单的选中
this
.
$refs
.
menu
.
setCheckedKeys
([])
this
.
$refs
.
menu
.
setCheckedKeys
([])
// 保存当前的角色id
// 保存当前的角色id
this
.
currentId
=
val
.
id
this
.
currentId
=
val
.
id
// 初始化
// 初始化
默认选中的key
this
.
menuIds
=
[]
this
.
menuIds
=
[]
// 菜单数据需要特殊处理
val
.
menus
.
forEach
(
function
(
data
)
{
val
.
menus
.
forEach
(
function
(
data
)
{
_this
.
menuIds
.
push
(
data
.
id
)
_this
.
menuIds
.
push
(
data
.
id
)
})
})
getMenuSuperior
(
this
.
menuIds
).
then
(
res
=>
{
this
.
showButton
=
true
this
.
menus
=
res
// 待所有菜单加载完再允许点击保存按钮
this
.
showButton
=
this
.
level
<=
val
.
level
})
}
}
},
},
menuChange
(
menu
)
{
menuChange
(
menu
)
{
...
...
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