Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-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
tianzhuanghu
ant-design-pro-vue
Commits
83f779ac
Commit
83f779ac
authored
Dec 18, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update RoleList2
parent
d860f308
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
router.config.js
src/config/router.config.js
+0
-0
permission.js
src/utils/helper/permission.js
+11
-10
RoleList.vue
src/views/role/RoleList.vue
+0
-0
No files found.
src/config/router.config.js
View file @
83f779ac
This diff is collapsed.
Click to expand it.
src/utils/helper/permission.js
View file @
83f779ac
...
@@ -8,46 +8,46 @@ const PERMISSION_ENUM = {
...
@@ -8,46 +8,46 @@ const PERMISSION_ENUM = {
'disable'
:
{
key
:
'disable'
,
label
:
'禁用'
},
'disable'
:
{
key
:
'disable'
,
label
:
'禁用'
},
'import'
:
{
key
:
'import'
,
label
:
'导入'
},
'import'
:
{
key
:
'import'
,
label
:
'导入'
},
'export'
:
{
key
:
'import'
,
label
:
'导入'
},
'export'
:
{
key
:
'import'
,
label
:
'导入'
},
}
;
}
function
plugin
(
Vue
)
{
function
plugin
(
Vue
)
{
if
(
plugin
.
installed
)
{
if
(
plugin
.
installed
)
{
return
;
return
}
}
!
Vue
.
prototype
.
$auth
&&
Object
.
defineProperties
(
Vue
.
prototype
,
{
!
Vue
.
prototype
.
$auth
&&
Object
.
defineProperties
(
Vue
.
prototype
,
{
$auth
:
{
$auth
:
{
get
()
{
get
()
{
const
_this
=
this
;
const
_this
=
this
return
(
permissions
)
=>
{
return
(
permissions
)
=>
{
let
[
permission
,
action
]
=
permissions
.
split
(
'.'
);
const
[
permission
,
action
]
=
permissions
.
split
(
'.'
)
const
permissionList
=
_this
.
$store
.
getters
.
roles
.
permissions
;
const
permissionList
=
_this
.
$store
.
getters
.
roles
.
permissions
permissionList
.
find
((
val
)
=>
{
permissionList
.
find
((
val
)
=>
{
return
val
.
permissionId
===
permission
return
val
.
permissionId
===
permission
}).
actionList
.
findIndex
((
val
)
=>
{
}).
actionList
.
findIndex
((
val
)
=>
{
return
val
===
action
return
val
===
action
})
;
})
return
false
return
false
}
}
}
}
}
}
})
;
})
!
Vue
.
prototype
.
$enum
&&
Object
.
defineProperties
(
Vue
.
prototype
,
{
!
Vue
.
prototype
.
$enum
&&
Object
.
defineProperties
(
Vue
.
prototype
,
{
$enum
:
{
$enum
:
{
get
()
{
get
()
{
// const _this = this;
// const _this = this;
return
(
val
)
=>
{
return
(
val
)
=>
{
let
result
=
PERMISSION_ENUM
;
let
result
=
PERMISSION_ENUM
val
&&
val
.
split
(
'.'
).
forEach
(
v
=>
{
val
&&
val
.
split
(
'.'
).
forEach
(
v
=>
{
result
=
result
&&
result
[
v
]
||
null
result
=
result
&&
result
[
v
]
||
null
})
;
})
return
result
return
result
}
}
}
}
}
}
})
;
})
}
}
export
default
plugin
export
default
plugin
\ No newline at end of file
src/views/role/RoleList.vue
View file @
83f779ac
This diff is collapsed.
Click to expand it.
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