fix: tree bugs

This commit is contained in:
xingyu4j
2025-10-09 18:23:35 +08:00
parent f63dc0ecef
commit d2f50c9388
7 changed files with 60 additions and 58 deletions

View File

@@ -7,7 +7,7 @@ import { computed, ref } from 'vue';
import { Tree, useVbenModal } from '@vben/common-ui';
import { handleTree } from '@vben/utils';
import { Checkbox, message } from 'ant-design-vue';
import { Checkbox, message, Spin } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getMenuList } from '#/api/system/menu';
@@ -134,17 +134,18 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
<Modal :title="getTitle" class="w-2/5">
<Form class="mx-6">
<template #menuIds="slotProps">
<Tree
class="max-h-96 overflow-y-auto"
:loading="menuLoading"
:tree-data="menuTree"
multiple
bordered
:expanded="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
/>
<Spin :spinning="menuLoading" wrapper-class-name="w-full">
<Tree
class="max-h-96 overflow-y-auto"
:tree-data="menuTree"
multiple
bordered
:default-expanded-keys="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
/>
</Spin>
</template>
</Form>
<template #prepend-footer>