diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index bf64a807..49e76b05 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -84,9 +84,18 @@
-
+
+ onMenuStatusChanged(scope.row, val as number)"
+ />
@@ -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([]) // 列表的数据
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()