66 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-06-30 14:24:39 +08:00
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';
2025-06-30 16:07:20 +08:00
import ComponentsInfo from './components/ComponentsInfo';
2025-07-01 11:35:54 +08:00
import Employees from './components/Employees';
2025-06-30 14:24:39 +08:00
import Organizations from './components/Organizations';
2025-07-01 10:40:00 +08:00
import Positions from './components/Positions';
import Projects from './components/Projects';
2025-06-30 14:24:39 +08:00
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 = [
{
2025-06-30 16:07:20 +08:00
label: '基本信息',
2025-06-30 14:24:39 +08:00
key: '1',
closable: false,
2025-06-30 16:07:20 +08:00
children: <ComponentsInfo item={data} reload={() => loadShow()} />,
},
{
2025-07-01 10:40:00 +08:00
label: '项目管理',
2025-06-30 16:07:20 +08:00
key: '2',
closable: false,
2025-07-01 10:40:00 +08:00
children: <Projects item={data} />,
},
{
label: '组织管理',
key: '3',
closable: false,
2025-06-30 14:24:39 +08:00
children: <Organizations item={data} />,
},
2025-07-01 10:40:00 +08:00
{
label: '员工管理',
key: '4',
closable: false,
2025-07-01 11:35:54 +08:00
children: <Employees item={data} />,
2025-07-01 10:40:00 +08:00
},
{
label: '岗位管理',
key: '5',
closable: false,
children: <Positions item={data} />,
},
2025-06-30 14:24:39 +08:00
];
return (
<MyPageContainer title={title}>
<ProCard>
<Tabs type="card" items={data?.id ? items : []} />
</ProCard>
</MyPageContainer>
);
}