|  | @@ -3,9 +3,7 @@ import Staff from './components/Staff'
 | 
	
		
			
				|  |  |  import Organization from './components/Organization'
 | 
	
		
			
				|  |  |  import Role from './components/Role'
 | 
	
		
			
				|  |  |  import { PageContainer } from '@ant-design/pro-layout'
 | 
	
		
			
				|  |  | -import type { RouteComponentProps } from 'react-router'
 | 
	
		
			
				|  |  | -import type { InstitutionDetailProps } from '../List'
 | 
	
		
			
				|  |  | -import { useRequest } from '@umijs/max'
 | 
	
		
			
				|  |  | +import { useParams, useRequest } from '@umijs/max'
 | 
	
		
			
				|  |  |  import { queryInstitution } from '@/services/api/institution'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export enum TabEnum {
 | 
	
	
		
			
				|  | @@ -14,10 +12,8 @@ export enum TabEnum {
 | 
	
		
			
				|  |  |    ROLE = '2'
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -type CompanyDetailProps = RouteComponentProps
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -const CompanyDetail: React.FC<CompanyDetailProps> = ({ location }) => {
 | 
	
		
			
				|  |  | -  const { dataID } = location.state as InstitutionDetailProps
 | 
	
		
			
				|  |  | +const CompanyDetail: React.FC = () => {
 | 
	
		
			
				|  |  | +  const { id: ID } = useParams()
 | 
	
		
			
				|  |  |    const [company, setCompany] = useState<Nullable<API.InstitutionListItem>>(null)
 | 
	
		
			
				|  |  |    const { run: tryQueryCompany } = useRequest(queryInstitution, {
 | 
	
		
			
				|  |  |      manual: true,
 | 
	
	
		
			
				|  | @@ -26,11 +22,11 @@ const CompanyDetail: React.FC<CompanyDetailProps> = ({ location }) => {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    })
 | 
	
		
			
				|  |  |    function initData() {
 | 
	
		
			
				|  |  | -    dataID && tryQueryCompany({ ID: dataID })
 | 
	
		
			
				|  |  | +    ID && tryQueryCompany({ ID })
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    useEffect(() => {
 | 
	
		
			
				|  |  |      initData()
 | 
	
		
			
				|  |  | -  }, [dataID])
 | 
	
		
			
				|  |  | +  }, [ID])
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    const menuMap: Record<string, string> = {
 | 
	
		
			
				|  |  |      [TabEnum.STAFF]: '人员管理',
 | 
	
	
		
			
				|  | @@ -44,19 +40,19 @@ const CompanyDetail: React.FC<CompanyDetailProps> = ({ location }) => {
 | 
	
		
			
				|  |  |        case TabEnum.STAFF:
 | 
	
		
			
				|  |  |          return (
 | 
	
		
			
				|  |  |            <Staff
 | 
	
		
			
				|  |  | -            dataID={dataID}
 | 
	
		
			
				|  |  | +            dataID={ID}
 | 
	
		
			
				|  |  |              companyName={company?.name}
 | 
	
		
			
				|  |  |              memberTotal={company?.memberTotal}
 | 
	
		
			
				|  |  |              managerID={company?.manager?.ID}
 | 
	
		
			
				|  |  |            />
 | 
	
		
			
				|  |  |          )
 | 
	
		
			
				|  |  |        case TabEnum.ORGANIZATION:
 | 
	
		
			
				|  |  | -        return <Organization dataID={dataID} />
 | 
	
		
			
				|  |  | +        return <Organization dataID={ID} />
 | 
	
		
			
				|  |  |        case TabEnum.ROLE:
 | 
	
		
			
				|  |  |          return (
 | 
	
		
			
				|  |  |            <Role
 | 
	
		
			
				|  |  |              initData={initData}
 | 
	
		
			
				|  |  | -            dataID={dataID}
 | 
	
		
			
				|  |  | +            dataID={ID}
 | 
	
		
			
				|  |  |              memberTotal={company?.memberTotal}
 | 
	
		
			
				|  |  |              managerID={company?.manager?.ID}
 | 
	
		
			
				|  |  |            />
 |