Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
84de88b7
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
334
Star
18155
Fork
5506
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
84de88b7
编写于
1月 07, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
资源权限前端功能
上级
26ee865c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
93 addition
and
9 deletion
+93
-9
QMPlusVuePage/src/api/authority.js
QMPlusVuePage/src/api/authority.js
+15
-0
QMPlusVuePage/src/view/superAdmin/authority/authority.vue
QMPlusVuePage/src/view/superAdmin/authority/authority.vue
+6
-1
QMPlusVuePage/src/view/superAdmin/authority/components/apis.vue
...VuePage/src/view/superAdmin/authority/components/apis.vue
+0
-8
QMPlusVuePage/src/view/superAdmin/authority/components/datas.vue
...uePage/src/view/superAdmin/authority/components/datas.vue
+72
-0
未找到文件。
QMPlusVuePage/src/api/authority.js
浏览文件 @
84de88b7
...
...
@@ -44,4 +44,19 @@ export const createAuthority = (data) => {
method
:
'
post
'
,
data
})
}
// @Summary 设置角色资源权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysAuthority true "设置角色资源权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /authority/setDataAuthority [post]
export
const
setDataAuthority
=
(
data
)
=>
{
return
service
({
url
:
"
/authority/setDataAuthority
"
,
method
:
'
post
'
,
data
})
}
\ No newline at end of file
QMPlusVuePage/src/view/superAdmin/authority/authority.vue
浏览文件 @
84de88b7
...
...
@@ -49,6 +49,9 @@
<el-tab-pane
label=
"角色api"
>
<apis
:row=
"activeRow"
/>
</el-tab-pane>
<el-tab-pane
label=
"资源权限"
>
<Datas
:row=
"activeRow"
:authority=
"tableData"
/>
</el-tab-pane>
</el-tabs>
</el-drawer>
</div>
...
...
@@ -65,6 +68,7 @@ import {
import
Menus
from
'
@/view/superAdmin/authority/components/menus
'
import
Apis
from
'
@/view/superAdmin/authority/components/apis
'
import
Datas
from
'
@/view/superAdmin/authority/components/datas
'
import
infoList
from
'
@/components/mixins/infoList
'
export
default
{
...
...
@@ -88,7 +92,8 @@ export default {
},
components
:
{
Menus
,
Apis
Apis
,
Datas
},
methods
:
{
opdendrawer
(
row
)
{
...
...
QMPlusVuePage/src/view/superAdmin/authority/components/apis.vue
浏览文件 @
84de88b7
...
...
@@ -61,14 +61,6 @@ export default {
}
return
apiTree
},
// 关联用户api关系
async
addAuthApi
(
row
)
{
const
res
=
await
getPolicyPathByAuthorityId
({
authorityId
:
this
.
row
.
authorityId
})
this
.
activeUserId
=
this
.
row
.
authorityId
this
.
apiTreeIds
=
res
.
data
.
paths
||
[]
},
// 关联关系确定
async
authApiEnter
()
{
const
checkArr
=
this
.
$refs
.
apiTree
.
getCheckedKeys
(
true
)
...
...
QMPlusVuePage/src/view/superAdmin/authority/components/datas.vue
0 → 100644
浏览文件 @
84de88b7
<
template
>
<div>
<div
class=
"clearflex"
>
<el-button
@
click=
"authDataEnter"
class=
"fl-right"
size=
"small"
type=
"primary"
>
确 定
</el-button>
</div>
<el-checkbox-group
v-model=
"dataAuthorityId"
@
change=
"selectAuthority"
>
<el-checkbox
v-for=
"(item,key) in authoritys"
:label=
"item"
:key=
"key"
>
{{
item
.
authorityName
}}
</el-checkbox>
</el-checkbox-group>
</div>
</
template
>
<
script
>
import
{
setDataAuthority
}
from
'
@/api/authority
'
export
default
{
name
:
'
Datas
'
,
data
()
{
return
{
authoritys
:[],
dataAuthorityId
:[]
}
},
props
:
{
row
:
{
default
:
function
()
{
return
{}
},
type
:
Object
},
authority
:
{
default
:
function
()
{
return
{}
},
type
:
Array
}
},
methods
:{
// 提交
async
authDataEnter
(){
const
res
=
await
setDataAuthority
(
this
.
row
)
if
(
res
.
success
){
this
.
$message
({
type
:
'
success
'
,
message
:
res
.
msg
})
}
},
// 平铺角色
roundAuthority
(
authoritys
){
authoritys
&&
authoritys
.
map
(
item
=>
{
const
obj
=
{}
obj
.
ID
=
item
.
ID
obj
.
authorityName
=
item
.
authorityName
this
.
authoritys
.
push
(
obj
)
if
(
item
.
children
.
length
){
this
.
roundAuthority
(
item
.
children
)
}
})
},
// 选择
selectAuthority
(){
this
.
row
.
dataAuthorityId
=
this
.
dataAuthorityId
}
},
created
()
{
this
.
authoritys
=
[]
this
.
dataAuthorityId
=
[]
this
.
roundAuthority
(
this
.
authority
)
this
.
row
.
dataAuthorityId
&&
this
.
row
.
dataAuthorityId
.
map
(
item
=>
{
const
obj
=
this
.
authoritys
&&
this
.
authoritys
.
filter
(
au
=>
au
.
ID
===
item
.
ID
)
&&
this
.
authoritys
.
filter
(
au
=>
au
.
ID
===
item
.
ID
)[
0
]
this
.
dataAuthorityId
.
push
(
obj
)
})
}
}
</
script
>
<
style
lang=
"less"
>
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录