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