Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kadycui
game-admin
提交
f401a183
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 搜索 >>
提交
f401a183
编写于
9月 18, 2023
作者:
kadycui
💻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ADD: 状态修改, 权限数据删除
上级
0ae07ddb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
7 deletion
+27
-7
src/api/rule.js
src/api/rule.js
+10
-0
src/pages/access/list.vue
src/pages/access/list.vue
+17
-7
未找到文件。
src/api/rule.js
浏览文件 @
f401a183
...
...
@@ -15,4 +15,14 @@ export function createRule(data) {
export
function
updateRule
(
id
,
data
)
{
return
axios
.
post
(
"
/admin/rule/
"
+
id
,
data
)
}
export
function
updateRuleStatus
(
id
,
status
){
return
axios
.
post
(
`/admin/rule/
${
id
}
/update_status`
,
{
status
})
}
export
function
deleteRule
(
id
){
return
axios
.
post
(
`/admin/rule/
${
id
}
/delete`
)
}
\ No newline at end of file
src/pages/access/list.vue
浏览文件 @
f401a183
...
...
@@ -14,10 +14,16 @@
</el-icon>
<span>
{{
data
.
name
}}
</span>
<div
class=
"ml-auto"
>
<el-switch
:modelValue=
"data.status"
:active-value=
"1"
:inactive-value=
"0"
/>
<el-switch
:modelValue=
"data.status"
:active-value=
"1"
:inactive-value=
"0"
@
change=
"handleStatusChange($event, data)"
/>
<el-button
text
type=
"primary"
size=
"small"
@
click.stop=
"handleEdit(data)"
>
修改
</el-button>
<el-button
text
type=
"primary"
size=
"small"
@
click.stop=
"addChild(data.id)"
>
增加
</el-button>
<el-button
text
type=
"primary"
size=
"small"
>
删除
</el-button>
<el-popconfirm
title=
"是否删除该记录?"
confirm-button-text=
"确认"
cancel-button-text=
"取消"
@
confirm=
"handleDelete(data.id)"
>
<template
#reference
>
<el-button
text
type=
"primary"
size=
"small"
>
删除
</el-button>
</
template
>
</el-popconfirm>
</div>
</div>
</template>
...
...
@@ -76,7 +82,9 @@ import IconSelect from "@/components/IconSelect.vue"
import
{
getRuleList
,
createRule
,
updateRule
updateRule
,
updateRuleStatus
,
deleteRule
}
from
"
@/api/rule.js
"
...
...
@@ -93,15 +101,18 @@ const defaultExpandKeys = ref([])
const
{
loading
,
tableData
,
getData
getData
,
handleDelete
,
handleStatusChange
}
=
useInitTable
({
getList
:
getRuleList
,
onGetListSuccess
:
(
res
)
=>
{
tableData
.
value
=
res
.
list
options
.
value
=
res
.
rules
defaultExpandKeys
.
value
=
res
.
list
.
map
(
o
=>
o
.
id
)
}
},
delete
:
deleteRule
,
updateStatus
:
updateRuleStatus
})
...
...
@@ -115,7 +126,6 @@ const {
handleSubmit
,
handleCreate
,
handleEdit
}
=
useInitForm
(
{
form
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录