| 
															
																@@ -21,7 +21,6 @@ const RoleLeftMenu = ({ onSelect }) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   const [state, setState] = useState({ 
															 | 
															
															 | 
															
																   const [state, setState] = useState({ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     value: '' 
															 | 
															
															 | 
															
																     value: '' 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   }) 
															 | 
															
															 | 
															
																   }) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-  // const [activeId, setActiveId] = useState('') 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   const [menuRoles, setMenuRoles] = useState<API.MenuRoleItem[]>([]) 
															 | 
															
															 | 
															
																   const [menuRoles, setMenuRoles] = useState<API.MenuRoleItem[]>([]) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   const { run: tryFetchRoleListByMenu } = useRequest(() => fetchRoleListByMenu(), { 
															 | 
															
															 | 
															
																   const { run: tryFetchRoleListByMenu } = useRequest(() => fetchRoleListByMenu(), { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     manual: true, 
															 | 
															
															 | 
															
																     manual: true, 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -33,7 +32,7 @@ const RoleLeftMenu = ({ onSelect }) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           roleType: item.roleType 
															 | 
															
															 | 
															
																           roleType: item.roleType 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         })) 
															 | 
															
															 | 
															
																         })) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       ) 
															 | 
															
															 | 
															
																       ) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      // setActiveId(result[0]['ID']) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+      result?.length && onSelect?.(result[0]?.ID) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     } 
															 | 
															
															 | 
															
																     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   }) 
															 | 
															
															 | 
															
																   }) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   const { run: tryAddRole } = useRequest((params: API.CreateRoleParams) => addRoleMenu(params), { 
															 | 
															
															 | 
															
																   const { run: tryAddRole } = useRequest((params: API.CreateRoleParams) => addRoleMenu(params), { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -76,14 +75,12 @@ const RoleLeftMenu = ({ onSelect }) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     title={ 
															 | 
															
															 | 
															
																                     title={ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                       <Input 
															 | 
															
															 | 
															
																                       <Input 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         placeholder="角色名称" 
															 | 
															
															 | 
															
																                         placeholder="角色名称" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        name="name" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                         onChange={e => onChangeName(e.currentTarget.value)} 
															 | 
															
															 | 
															
																                         onChange={e => onChangeName(e.currentTarget.value)} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                       /> 
															 | 
															
															 | 
															
																                       /> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     } 
															 | 
															
															 | 
															
																                     } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    okText="确认" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    okText="确定" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     cancelText="取消" 
															 | 
															
															 | 
															
																                     cancelText="取消" 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    onConfirm={() => tryUpdateRole(item.id, state.name)} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    icon=""> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+                    onConfirm={() => tryUpdateRole(item.id, state.name)}> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                     <FormOutlined className="pr-2" /> 
															 | 
															
															 | 
															
																                     <FormOutlined className="pr-2" /> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                   </Popconfirm> 
															 | 
															
															 | 
															
																                   </Popconfirm> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                   <Popconfirm 
															 | 
															
															 | 
															
																                   <Popconfirm 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -109,12 +106,7 @@ const RoleLeftMenu = ({ onSelect }) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   useEffect(() => { 
															 | 
															
															 | 
															
																   useEffect(() => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     tryFetchRoleListByMenu() 
															 | 
															
															 | 
															
																     tryFetchRoleListByMenu() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   }, []) 
															 | 
															
															 | 
															
																   }, []) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-  const saveActiveId = (id: string) => { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    // setActiveId(id) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    if (onSelect) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-      onSelect(id) 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-    } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-  } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																   return ( 
															 | 
															
															 | 
															
																   return ( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     <div 
															 | 
															
															 | 
															
																     <div 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       className="w-216px rounded-20px" 
															 | 
															
															 | 
															
																       className="w-216px rounded-20px" 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@@ -150,59 +142,12 @@ const RoleLeftMenu = ({ onSelect }) => { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         <ul className="p-0 m-0 list-none text-primary flex flex-col flex-1"> 
															 | 
															
															 | 
															
																         <ul className="p-0 m-0 list-none text-primary flex flex-col flex-1"> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           {menuRoles.length ? ( 
															 | 
															
															 | 
															
																           {menuRoles.length ? ( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             <DirectoryTree 
															 | 
															
															 | 
															
																             <DirectoryTree 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              multiple 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              defaultExpandAll 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              defaultSelectedKeys={menuRoles[0]?.key} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              onSelect={keys => saveActiveId(keys[0])} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+              defaultSelectedKeys={[menuRoles[0]?.key]} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																+              onSelect={keys => onSelect(keys[0])} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																               showIcon={false} 
															 | 
															
															 | 
															
																               showIcon={false} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																               treeData={renderTreeNode(menuRoles)} 
															 | 
															
															 | 
															
																               treeData={renderTreeNode(menuRoles)} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             /> 
															 | 
															
															 | 
															
																             /> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																           ) : null} 
															 | 
															
															 | 
															
																           ) : null} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-          {/* {menuRoles.map(item => ( 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            <Popover 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              key={item.id} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              placement="right" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              content={ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                <div> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                  {item.roleType !== 'system' ? ( 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    <span> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                      <Popconfirm 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        title={ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                          <Input 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            placeholder="角色名称" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            name="name" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                            onChange={e => onChangeName(e.currentTarget.value)} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                          /> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        okText="确定" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        cancelText="取消" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        onConfirm={() => tryUpdateRole(item.ID, state.name)} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        icon=""> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        <FormOutlined className="pr-1" /> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                      </Popconfirm> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                      <Popconfirm 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        title="确定删除该角色" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        okText="确定" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        cancelText="取消" 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        onConfirm={() => tryDelRole(item.ID)} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        icon={<QuestionCircleOutlined style={{ color: 'red' }} />}> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                        <DeleteOutlined /> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                      </Popconfirm> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                    </span> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                  ) : null} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                </div> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              }> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              <li 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                key={item.id} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                className={[ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                  'flex justify-between items-center py-2 px-5 cursor-pointer', 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                  item.ID === activeId ? 'scale-up-center' : '' 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                ].join(' ')} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                onClick={() => handleItemClick(item.ID)}> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-                <span>{item.name}</span> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-              </li> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-            </Popover> 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																-          ))} */} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																         </ul> 
															 | 
															
															 | 
															
																         </ul> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																       </div> 
															 | 
															
															 | 
															
																       </div> 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     </div> 
															 | 
															
															 | 
															
																     </div> 
															 |