Commit efc7024d authored by 陈前坚's avatar 陈前坚

perf: loading

parent e2719255
...@@ -53,7 +53,7 @@ import { ...@@ -53,7 +53,7 @@ import {
} from '@/services/userCenter/userManage/api'; } from '@/services/userCenter/userManage/api';
const UserManage = () => { const UserManage = () => {
const [treeLoading, setTreeLoading] = useState(true); const [treeLoading, setTreeLoading] = useState(false);
const [tableLoading, setTableLoading] = useState(false); const [tableLoading, setTableLoading] = useState(false);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
...@@ -319,7 +319,6 @@ const UserManage = () => { ...@@ -319,7 +319,6 @@ const UserManage = () => {
// 获取用户机构树 // 获取用户机构树
useEffect(() => { useEffect(() => {
setTreeLoading(true);
updateTrees(); updateTrees();
}, []); }, []);
...@@ -769,33 +768,34 @@ const UserManage = () => { ...@@ -769,33 +768,34 @@ const UserManage = () => {
return ( return (
<PageContainer className={styles.userManageContainer}> <PageContainer className={styles.userManageContainer}>
<div className={styles.contentContainer}> <div className={styles.contentContainer}>
<div className={styles.orgContainer}> <Spin spinning={treeLoading} tip="loading...">
<span style={{ padding: '8px', fontSize: '16px' }}> <div className={styles.orgContainer}>
机构列表 <span style={{ padding: '8px', fontSize: '16px' }}>
<Tooltip title="查找用户"> 机构列表
<SearchOutlined <Tooltip title="查找用户">
style={{ <SearchOutlined
fontSize: '18px', style={{
float: 'right', fontSize: '18px',
margin: '4px 4px 0px 12px', float: 'right',
color: '#1890FF', margin: '4px 4px 0px 12px',
}} color: '#1890FF',
onClick={searchUser} }}
/> onClick={searchUser}
</Tooltip> />
<Tooltip title="添加下级机构"> </Tooltip>
<FolderAddTwoTone <Tooltip title="添加下级机构">
style={{ <FolderAddTwoTone
fontSize: '18px', style={{
float: 'right', fontSize: '18px',
marginTop: '4px', float: 'right',
}} marginTop: '4px',
onClick={e => addSubOrg(e, '根目录', '-1')} }}
/> onClick={e => addSubOrg(e, '根目录', '-1')}
</Tooltip> />
</span> </Tooltip>
{treeData.length > 0 && ( </span>
<Spin spinning={treeLoading} tip="loading...">
{treeData.length > 0 && (
<Tree <Tree
// showLine="true" // showLine="true"
showIcon="true" showIcon="true"
...@@ -805,9 +805,9 @@ const UserManage = () => { ...@@ -805,9 +805,9 @@ const UserManage = () => {
onSelect={onSelect} onSelect={onSelect}
treeData={treeData.map(t => mapTree(t))} treeData={treeData.map(t => mapTree(t))}
/> />
</Spin> )}
)} </div>
</div> </Spin>
<div className={styles.userContainer}> <div className={styles.userContainer}>
<Table <Table
title={getTableTitle} title={getTableTitle}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment