From afe28d83c9fce29ee20a606a8908bffe791cccfb Mon Sep 17 00:00:00 2001
From: DevDengChao <2325690622@qq.com>
Date: Mon, 20 May 2024 11:02:00 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=BF=AB=E9=80=9F?=
=?UTF-8?q?=E5=BC=80=E5=85=B3=E8=8F=9C=E5=8D=95=E7=9A=84=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/menu/index.vue | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
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()