Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
15ed1cf5
authored
Sep 06, 2024
by
芋道源码
Committed by
GitHub
Sep 06, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #54 from DevDengChao/feat/menu-status-switch
feat: 新增快速开关菜单的按钮
parents
d7e0b771
afe28d83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
src/views/system/menu/index.vue
+20
-1
No files found.
src/views/system/menu/index.vue
View file @
15ed1cf5
...
...
@@ -84,9 +84,18 @@
<el-table-column
:show-overflow-tooltip=
"true"
label=
"权限标识"
prop=
"permission"
/>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"组件路径"
prop=
"component"
/>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"组件名称"
prop=
"componentName"
/>
<el-table-column
label=
"状态"
prop=
"status"
width=
"
8
0"
>
<el-table-column
label=
"状态"
prop=
"status"
width=
"
16
0"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.COMMON_STATUS"
:value=
"scope.row.status"
/>
<el-switch
class=
"ml-4px"
v-model=
"scope.row.status"
v-hasPermi=
"['system:menu:update']"
:active-value=
"CommonStatusEnum.ENABLE"
:inactive-value=
"CommonStatusEnum.DISABLE"
:loading=
"menuStatusUpdating[scope.row.id]"
@
change=
"(val) => onMenuStatusChanged(scope.row, val as number)"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
...
...
@@ -127,8 +136,10 @@
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
handleTree
}
from
'@/utils/tree'
import
*
as
MenuApi
from
'@/api/system/menu'
import
{
MenuVO
}
from
'@/api/system/menu'
import
MenuForm
from
'./MenuForm.vue'
import
{
CACHE_KEY
,
useCache
}
from
'@/hooks/web/useCache'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
defineOptions
({
name
:
'SystemMenu'
})
...
...
@@ -137,6 +148,7 @@ const { t } = useI18n() // 国际化
const
message
=
useMessage
()
// 消息弹窗
const
loading
=
ref
(
true
)
// 列表的加载中
const
menuStatusUpdating
=
ref
({})
// 列表的加载中
const
list
=
ref
<
any
>
([])
// 列表的数据
const
queryParams
=
reactive
({
name
:
undefined
,
...
...
@@ -208,6 +220,13 @@ const handleDelete = async (id: number) => {
}
catch
{}
}
const
onMenuStatusChanged
=
async
(
menu
:
MenuVO
,
val
:
number
)
=>
{
menuStatusUpdating
.
value
[
menu
.
id
]
=
true
menu
.
status
=
val
await
MenuApi
.
updateMenu
(
menu
)
menuStatusUpdating
.
value
[
menu
.
id
]
=
false
}
/** 初始化 **/
onMounted
(()
=>
{
getList
()
...
...
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