| 
					
				 | 
			
			
				@@ -2,13 +2,14 @@ import { useModel, useRequest } from 'umi' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { Delete, EveryUser } from '@icon-park/react' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import ProForm, { ProFormCheckbox, ProFormDependency, ProFormSwitch } from '@ant-design/pro-form' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import type { FormInstance } from 'antd' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { message, Table, Tabs } from 'antd' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { message, Table, Tabs, Popconfirm, Popover } from 'antd' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import React, { useRef, useMemo, useState, useEffect } from 'react' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import RoleMenu from './components/RoleMenu/roleMenu' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   fetchRoleStaffListByRoleId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   updateRolePermission, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  getRolePermissions 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getRolePermissions, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  deleteStaff 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } from '@/services/user/api' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import type { ColumnsType } from 'antd/lib/table' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import ConnectModal from './components/ConnectModal' 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -17,44 +18,6 @@ import { formatPermission } from '@/utils/utils' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const System = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const { TabPane } = Tabs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const formRef = useRef<FormInstance>(null) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  const columns: ColumnsType<API.RoleStaffListItem> = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '用户', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'username', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '15%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '手机', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'phone', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '部门', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'departmentName', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '岗位', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'position', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '15%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '角色', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'age', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      title: '操作', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      dataIndex: 'opreate', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      width: '20%', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      render: () => ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <span className="hover:text-hex-e7026e"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <Delete fill="#fd3995" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        </span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const { initialState } = useModel('@@initialState') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   const menuId = useMemo(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return initialState?.menuList?.find(item => item.name === '系统管理')?.id 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -90,6 +53,19 @@ const System = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const { run: tryDeleteStaff } = useRequest( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    (params: API.DeleteStaff) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      return deleteStaff(params) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      manual: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      onSuccess: () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        message.success('移除员工成功') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tryGetRoleStaffList(state.id) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   useEffect(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (state.id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       tryGetRoleStaffList(state.id) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -103,6 +79,57 @@ const System = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, [state.id, state.activeKey]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const columns: ColumnsType<API.RoleStaffListItem> = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '用户', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'username', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '15%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '手机', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'phone', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '部门', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'departmentName', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '岗位', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'position', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '15%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '角色', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'age', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '20%' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      title: '操作', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      dataIndex: 'opreate', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      width: '20%', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      render: (_, record) => ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // console.log(record.staffId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          {state.id && ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <Popover> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <Popconfirm 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                title="确认删除吗?" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                okText="确认" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cancelText="取消" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                onConfirm={() => tryDeleteStaff({ id: state.id, staffId: record.staffId })}> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <span className="hover:text-hex-e7026e cursor-pointer"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  <Delete fill="#fd3995" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </Popconfirm> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </Popover> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          )} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   return ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <div className="h-full w-full flex flex-row"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <RoleMenu menuId={menuId} onSelect={onSelect} /> 
			 |