Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kadycui
game-admin
提交
464a6ac4
game-admin
项目概览
kadycui
/
game-admin
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
game-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
464a6ac4
编写于
9月 19, 2023
作者:
kadycui
💻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ADD:权限配置树形菜单
上级
64acf552
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
3 deletion
+40
-3
src/pages/role/list.vue
src/pages/role/list.vue
+40
-3
未找到文件。
src/pages/role/list.vue
浏览文件 @
464a6ac4
...
...
@@ -17,10 +17,10 @@
</el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"
18
0"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"
25
0"
align=
"center"
>
<
template
#default=
"scope"
>
<el-button
type=
"primary"
size=
"small"
text
@
click=
"openSetRule(scope.row)"
>
配置权限
</el-button>
<el-button
type=
"primary"
size=
"small"
text
@
click=
"handleEdit(scope.row)"
>
修改
</el-button>
<el-popconfirm
title=
"是否删除此角色?"
confirm-button-text=
"确认"
cancel-button-text=
"取消"
@
confirm=
"handleDelete(scope.row.id)"
>
<template
#reference
>
...
...
@@ -43,7 +43,7 @@
<el-form-item
label=
"角色描述"
prop=
"desc"
>
<el-input
v-model=
"form.desc"
placeholder=
"描述内容"
type=
"textarea"
:rows=
"5"
></el-input>
</el-form-item>
<el-form-item
label=
"
角色
状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-switch
v-model=
"form.status"
:active-value=
"1"
:inactive-value=
"0"
>
</el-switch>
</el-form-item>
...
...
@@ -52,11 +52,22 @@
</FormDrawer>
<!-- 权限配置 -->
<FormDrawer
ref=
"setRuleformDrawerRef"
title=
"权限配置"
@
submit=
"handleSetRuleSubmit"
>
<el-tree-v2
:data=
"ruleList"
:props=
"{value:'id', label: 'name', children: 'child'}"
show-checkbox
:height=
"treeHeight"
/>
</FormDrawer>
</el-card>
</template>
<
script
setup
>
import
{
ref
}
from
"
vue
"
import
{
getRoleList
,
createRole
,
...
...
@@ -64,6 +75,11 @@ import {
deleteRole
,
updateRoleStatus
}
from
"
@/api/role
"
import
{
getRuleList
,
}
from
"
@/api/rule
"
import
FormDrawer
from
"
@/components/FormDrawer.vue
"
import
ListHeader
from
"
@/components/ListHeader.vue
"
import
{
useInitTable
,
useInitForm
}
from
"
@/composables/useCommon.js
"
...
...
@@ -120,6 +136,27 @@ const {
const
setRuleformDrawerRef
=
ref
(
null
)
const
treeHeight
=
ref
(
0
)
const
ruleList
=
ref
([])
const
roleId
=
ref
(
0
)
const
openSetRule
=
(
row
)
=>
{
roleId
.
value
=
row
.
id
treeHeight
.
value
=
window
.
innerHeight
-
170
getRuleList
(
1
).
then
(
res
=>
{
ruleList
.
value
=
res
.
list
setRuleformDrawerRef
.
value
.
open
()
})
}
const
handleSetRuleSubmit
=
()
=>
{
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录