feat: 使用vben自带的spin指令
parent
84b51ed8bb
commit
4613732cd1
|
@ -135,12 +135,12 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
|||
<Modal title="数据权限" class="w-[40%]">
|
||||
<Form class="mx-4">
|
||||
<template #dataScopeDeptIds="slotProps">
|
||||
<!-- <Spin :spinning="deptLoading"> -->
|
||||
<!-- TODO @芋艿:可优化,使用 antd 的 tree?原因是,更原生 -->
|
||||
<VbenTree
|
||||
:tree-data="deptTree"
|
||||
multiple
|
||||
bordered
|
||||
:spinning="deptLoading"
|
||||
:expanded="expandedKeys"
|
||||
v-bind="slotProps"
|
||||
value-field="id"
|
||||
|
@ -148,7 +148,6 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
|||
:auto-check-parent="false"
|
||||
:check-strictly="!isCheckStrictly"
|
||||
/>
|
||||
<!-- </Spin> -->
|
||||
</template>
|
||||
</Form>
|
||||
<template #prepend-footer>
|
||||
|
|
|
@ -127,9 +127,9 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
|||
<Modal title="数据权限" class="w-[40%]">
|
||||
<Form class="mx-4">
|
||||
<template #menuIds="slotProps">
|
||||
<!-- <Spin :spinning="menuLoading" class="w-full"> -->
|
||||
<!-- TODO @芋艿:可优化,使用 antd 的 tree?原因是,更原生 -->
|
||||
<VbenTree
|
||||
:spinning="menuLoading"
|
||||
:tree-data="menuTree"
|
||||
multiple
|
||||
bordered
|
||||
|
@ -138,7 +138,6 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
|||
value-field="id"
|
||||
label-field="name"
|
||||
/>
|
||||
<!-- </Spin> -->
|
||||
</template>
|
||||
</Form>
|
||||
<template #prepend-footer>
|
||||
|
|
|
@ -6,7 +6,7 @@ import { onMounted, ref } from 'vue';
|
|||
import { Search } from '@vben/icons';
|
||||
import { handleTree } from '@vben/utils';
|
||||
|
||||
import { Input, Spin, Tree } from 'ant-design-vue';
|
||||
import { Input, Tree } from 'ant-design-vue';
|
||||
|
||||
import { getSimpleDeptList } from '#/api/system/dept';
|
||||
|
||||
|
@ -66,18 +66,17 @@ onMounted(async () => {
|
|||
</template>
|
||||
</Input>
|
||||
</div>
|
||||
<Spin :spinning="loading">
|
||||
<Tree
|
||||
class="pt-2"
|
||||
v-if="deptTree.length > 0"
|
||||
:tree-data="deptTree"
|
||||
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
||||
@select="handleSelect"
|
||||
:default-expand-all="true"
|
||||
/>
|
||||
<div v-else-if="!loading" class="py-4 text-center text-gray-500">
|
||||
暂无数据
|
||||
</div>
|
||||
</Spin>
|
||||
<Tree
|
||||
:spinning="loading"
|
||||
class="pt-2"
|
||||
v-if="deptTree.length > 0"
|
||||
:tree-data="deptTree"
|
||||
:field-names="{ title: 'name', key: 'id', children: 'children' }"
|
||||
@select="handleSelect"
|
||||
:default-expand-all="true"
|
||||
/>
|
||||
<div v-else-if="!loading" class="py-4 text-center text-gray-500">
|
||||
暂无数据
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue