fix: 去掉spin,影响占位

pull/87/head
xingyu4j 2025-04-26 13:34:10 +08:00
parent 059687e1f5
commit c5774bb1b2
2 changed files with 37 additions and 30 deletions

View File

@ -7,7 +7,7 @@ import { ref } from 'vue';
import { useVbenModal, VbenTree } from '@vben/common-ui';
import { handleTree } from '@vben/utils';
import { Checkbox, message, Spin } from 'ant-design-vue';
import { Checkbox, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getDeptList } from '#/api/system/dept';
@ -28,6 +28,13 @@ const isCheckStrictly = ref(true); // 父子联动状态
const expandedKeys = ref<number[]>([]); //
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
formItemClass: 'col-span-2',
labelWidth: 80,
},
layout: 'horizontal',
schema: useAssignDataPermissionFormSchema(),
showDefaultActions: false,
@ -128,23 +135,23 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
</script>
<template>
<Modal title="数据权限">
<Modal title="数据权限" class="w-[40%]">
<Form class="mx-4">
<template #dataScopeDeptIds="slotProps">
<Spin :spinning="deptLoading" class="w-full">
<!-- TODO @芋艿可优化使用 antd tree原因是更原生 -->
<VbenTree
:tree-data="deptTree"
multiple
bordered
:expanded="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
:auto-check-parent="false"
:check-strictly="!isCheckStrictly"
/>
</Spin>
<!-- <Spin :spinning="deptLoading"> -->
<!-- TODO @芋艿可优化使用 antd tree原因是更原生 -->
<VbenTree
:tree-data="deptTree"
multiple
bordered
:expanded="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
:auto-check-parent="false"
:check-strictly="!isCheckStrictly"
/>
<!-- </Spin> -->
</template>
</Form>
<template #prepend-footer>

View File

@ -7,7 +7,7 @@ import { ref } from 'vue';
import { useVbenModal, VbenTree } from '@vben/common-ui';
import { handleTree } from '@vben/utils';
import { Checkbox, message, Spin } from 'ant-design-vue';
import { Checkbox, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getMenuList } from '#/api/system/menu';
@ -120,21 +120,21 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
</script>
<template>
<Modal title="数据权限">
<Modal title="数据权限" class="w-[40%]">
<Form class="mx-4">
<template #menuIds="slotProps">
<Spin :spinning="menuLoading" class="w-full">
<!-- TODO @芋艿可优化使用 antd tree原因是更原生 -->
<VbenTree
:tree-data="menuTree"
multiple
bordered
:expanded="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
/>
</Spin>
<!-- <Spin :spinning="menuLoading" class="w-full"> -->
<!-- TODO @芋艿可优化使用 antd tree原因是更原生 -->
<VbenTree
:tree-data="menuTree"
multiple
bordered
:expanded="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"
/>
<!-- </Spin> -->
</template>
</Form>
<template #prepend-footer>