Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
38be4bbe
Commit
38be4bbe
authored
Apr 20, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
a4b89b0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
iview-admin/src/libs/util.js
+12
-0
iview-admin/src/store/module/metainfo/userinfo.js
+0
-3
iview-admin/src/view/components/tables/tables.vue
+17
-12
No files found.
iview-admin/src/libs/util.js
View file @
38be4bbe
...
...
@@ -23,6 +23,18 @@ export const btnAuthFilter=(metainfo,user)=>{
// })
// }
// metainfo.auths=authbtns
let
authbtns
=
[]
let
keyswithauth
=
Object
.
keys
(
metainfo
.
auths
).
filter
(
authname
=>
{
return
true
})
if
(
keyswithauth
){
keyswithauth
.
forEach
(
k
=>
{
metainfo
.
auths
[
k
].
forEach
(
bt
=>
{
authbtns
.
push
(
bt
)
})
})
}
metainfo
.
auths
=
authbtns
return
metainfo
}
...
...
iview-admin/src/store/module/metainfo/userinfo.js
View file @
38be4bbe
...
...
@@ -9,9 +9,6 @@ export default {
title
:
'Handle'
,
key
:
'handle'
,
button
:
[
//这个数组中内容,需要按照权限字符串,在服务端构造
{
title
:
"删除"
,
type
:
"text"
,
icon
:
"md-trash"
,
key
:
"delete"
},
{
title
:
"编辑"
,
type
:
"text"
,
icon
:
""
,
key
:
"edit"
},
{
title
:
"启用"
,
type
:
"text"
,
icon
:
""
,
key
:
"enable"
},
]
}
],
...
...
iview-admin/src/view/components/tables/tables.vue
View file @
38be4bbe
...
...
@@ -7,7 +7,7 @@
searchable
search-place=
"top"
v-model=
"tableData"
:columns=
"col
umns
"
:columns=
"col
swithauth
"
@
on-rapid-query=
"doquery"
@
on-exec=
"doexec"
/>
...
...
@@ -34,11 +34,7 @@ export default {
data
()
{
this
.
metaName
=
"user_info"
;
return
{
forminfo
:
this
.
metaName
?
this
.
$store
.
getters
[
this
.
metaName
][
"form"
]
:
{},
columns
:
this
.
metaName
?
this
.
$store
.
getters
[
this
.
metaName
][
"list"
]
:
[],
authbtns
:
this
.
metaName
?
this
.
$store
.
getters
[
this
.
metaName
][
"auths"
]
:
[],
metainfo
:
this
.
$store
.
getters
[
this
.
metaName
],
tableData
:
[]
};
},
...
...
@@ -61,20 +57,29 @@ export default {
});
},
computed
:
{
forminfo
(){
return
this
.
metainfo
[
"form"
]
},
formbtns
()
{
return
this
.
authbtns
.
filter
(
bt
=>
{
return
this
.
metainfo
[
"auths"
]
.
filter
(
bt
=>
{
return
bt
.
isOnForm
;
});
},
onlistbtns
()
{
return
this
.
authbtns
.
filter
(
bt
=>
{
return
this
.
metainfo
[
"auths"
]
.
filter
(
bt
=>
{
return
bt
.
isOnGrid
;
});
},
inrowbtns
()
{
return
this
.
authbtns
.
filter
(
bt
=>
{
return
bt
.
isInRow
;
});
colswithauth
(){
let
listbtns
=
this
.
metainfo
[
"auths"
].
filter
(
bt
=>
{
return
bt
.
isInRow
;
});
this
.
metainfo
[
"list"
].
forEach
(
c
=>
{
if
(
c
.
key
==
"handle"
){
c
.
button
.
push
(...
listbtns
)
}
})
return
this
.
metainfo
[
"list"
]
}
}
};
...
...
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