45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { MyPageContainer } from '@/common';
|
|
import { Apis } from '@/gen/Apis';
|
|
import { ProCard } from '@ant-design/pro-components';
|
|
import { useParams } from '@umijs/max';
|
|
import { Tabs } from 'antd';
|
|
import { useEffect, useState } from 'react';
|
|
import ComponentsInfo from './components/ComponentsInfo';
|
|
import Organizations from './components/Organizations';
|
|
export default function Show({ title = '机构详情' }) {
|
|
const { id } = useParams<{ id: string }>();
|
|
const [data, setShow] = useState<any>({});
|
|
|
|
const loadShow = () => {
|
|
let paramsId: any = { id: id ?? 0 };
|
|
Apis.Company.Companies.Show(paramsId).then((res) => {
|
|
setShow(res?.data);
|
|
});
|
|
};
|
|
useEffect(() => {
|
|
loadShow();
|
|
}, [id]);
|
|
|
|
let items = [
|
|
{
|
|
label: '基本信息',
|
|
key: '1',
|
|
closable: false,
|
|
children: <ComponentsInfo item={data} reload={() => loadShow()} />,
|
|
},
|
|
{
|
|
label: '组织',
|
|
key: '2',
|
|
closable: false,
|
|
children: <Organizations item={data} />,
|
|
},
|
|
];
|
|
return (
|
|
<MyPageContainer title={title}>
|
|
<ProCard>
|
|
<Tabs type="card" items={data?.id ? items : []} />
|
|
</ProCard>
|
|
</MyPageContainer>
|
|
);
|
|
}
|