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

perf: 用户机构树默认不展开

parent 9cd4e60d
import React, { useState, useEffect } from 'react';
import {
Tree,
// Tree,
Table,
Space,
message,
......@@ -15,6 +15,7 @@ import {
Menu,
} from 'antd';
import {
UserOutlined,
UserAddOutlined,
UsergroupAddOutlined,
EditOutlined,
......@@ -42,6 +43,7 @@ import {
setUserState as postSetUserState,
multiDeleteUsers,
} from '@/services/userCenter/userManage/api';
import Tree from '@/components/ExpendableTree';
import classnames from 'classnames';
import AddUserModal from './AddUserModal';
import AddSubOrgModal from './AddSubOrgModal';
......@@ -50,7 +52,6 @@ import DeleteOrgModal from './DeleteOrgModal';
import RelateRoleModal from './RelateRoleModal';
import EditUserModal from './EditUserModal';
import ChangePasswordModal from './ChangePasswordModal';
import styles from './UserManage.less';
const UserManage = () => {
......@@ -281,6 +282,7 @@ const UserManage = () => {
return {
title: org.text,
key: org.id,
// icon: <UserOutlined style={{ display: 'inline' }} />,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
};
......@@ -735,7 +737,7 @@ const UserManage = () => {
blockNode
autoExpandParent
// expandedKeys={[currentSelectOrg]}
defaultExpandAll
// defaultExpandAll
selectedKeys={[currentSelectOrg]}
onSelect={onSelect}
treeData={treeData.map(t => mapTree(t))}
......@@ -889,7 +891,7 @@ const UserManage = () => {
<Tree
showIcon="true"
showLine={{ showLeafIcon: false }}
defaultExpandAll="true"
// defaultExpandAll
// 未切换时原先的节点,注意要转字符串
selectedKeys={[`${currentSelectOldOrg}`]}
onSelect={value => {
......
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