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();