From 71dceeacc239032e29041f01b0567129851f6acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 24 Jun 2025 11:08:10 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=B1=95=E5=BC=80=E6=8A=98=E5=8F=A0=E6=8C=89=E9=92=AE?= =?UTF-8?q?=20=E8=8F=9C=E5=8D=95=E6=95=B0=E6=8D=AE=E9=87=8F=E5=A4=A7?= =?UTF-8?q?=E7=9A=84=E6=B8=85=E7=A9=BA=E4=B8=8B=20=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=A1=B5=E9=9D=A2=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?=E9=97=AE=E9=A2=98(=E5=9C=A8=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=B8=85=E7=A9=BA=E4=B8=8B=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E5=8A=9F=E8=83=BD=E4=B8=8D=E6=8E=A8=E8=8D=90=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BA=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/menu/index.vue | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 907fef5..6137eaf 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -27,9 +27,6 @@ 新增 - - 展开/折叠 - 级联删除 @@ -44,7 +41,7 @@ row-key="menuId" border :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" - :default-expand-all="isExpandAll" + :default-expand-all="false" lazy :load="getChildrenList" > @@ -306,7 +303,6 @@ const menuExpandMap = ref({}); const loading = ref(true); const showSearch = ref(true); const menuOptions = ref([]); -const isExpandAll = ref(false); const dialog = reactive({ visible: false, @@ -438,25 +434,6 @@ const handleAdd = (row?: MenuVO) => { dialog.visible = true; dialog.title = '添加菜单'; }; -/** 展开/折叠操作 */ -const handleToggleExpandAll = () => { - isExpandAll.value = !isExpandAll.value; - toggleExpandAll(menuList.value, isExpandAll.value); -}; -/** 展开/折叠所有 */ -const toggleExpandAll = (data: MenuVO[], status: boolean) => { - data.forEach(async (item: MenuVO) => { - const menuChildrenList = menuChildrenListMap.value[item.menuId]; - // 从menuChildrenListMap中获取子菜单列表 - if (menuChildrenList && (!item.children || item.children.length === 0)) { - item.children = menuChildrenList || []; - // 等待子菜单列表加载完成 - await nextTick(); - } - menuTableRef.value?.toggleRowExpansion(item, status); - if (item.children && item.children.length > 0) toggleExpandAll(item.children, status); - }); -}; /** 修改按钮操作 */ const handleUpdate = async (row: MenuVO) => { reset();