From cea29f7bcb98b6fa779fe944aca4b1a65cd24330 Mon Sep 17 00:00:00 2001 From: shawn <597035529@qq.com> Date: Fri, 24 Mar 2023 11:18:18 +0800 Subject: [PATCH] 'update:rolemange-tree' --- web/src/views/sysManage/roleManage/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/src/views/sysManage/roleManage/index.tsx b/web/src/views/sysManage/roleManage/index.tsx index 490fe55..d705099 100644 --- a/web/src/views/sysManage/roleManage/index.tsx +++ b/web/src/views/sysManage/roleManage/index.tsx @@ -1,7 +1,7 @@ import { PlusOutlined } from '@ant-design/icons' import type { ActionType, ProColumns, ProFormInstance } from '@ant-design/pro-components' import { ProTable, DrawerForm, ProFormText, ProFormDateRangePicker } from '@ant-design/pro-components' -import { Row, Col, Tree, Button, message } from 'antd' +import { Row, Col, Tree, Button, message, Spin } from 'antd' import { useRef, useState, useEffect } from 'react' import { useRoleManageApi, useMenuManageApi } from '@/apis/modules/sysManage' @@ -27,6 +27,7 @@ const index = () => { // tree树形 const [treeData, setTreeData] = useState([]) const [expandedKeys, setExpandedKeys] = useState([]) + const [loadingTree, setLoadingTree] = useState(false) const addFn = () => { setModalFormMode({ title: '新增', mode: 'add' }) @@ -204,6 +205,7 @@ const index = () => { // 获取tree树形数据 const findMenuTreeFn = async () => { + setLoadingTree(true) const data: any = await menuApi.findMenuTreeApi({ parentId: 'root' }) @@ -219,6 +221,7 @@ const index = () => { }) } render(data) + setLoadingTree(false) return data } @@ -345,9 +348,11 @@ const index = () => { ) : null} - - {renderTreeNodes(treeData)} - + + + {renderTreeNodes(treeData)} + + {/*