2025-08-08 18:35:02 +08:00
|
|
|
|
import { MyPageContainer, usePageTabs } from '@/common';
|
2025-06-30 14:24:39 +08:00
|
|
|
|
import { Apis } from '@/gen/Apis';
|
|
|
|
|
|
import { ProCard } from '@ant-design/pro-components';
|
|
|
|
|
|
import { useParams } from '@umijs/max';
|
2026-01-26 19:55:06 +08:00
|
|
|
|
import { Space, Steps, Tabs } from 'antd';
|
2025-06-30 14:24:39 +08:00
|
|
|
|
import { useEffect, useState } from 'react';
|
2025-08-27 11:24:29 +08:00
|
|
|
|
|
2026-01-26 19:55:06 +08:00
|
|
|
|
import { FileProtectOutlined } from '@ant-design/icons';
|
2025-09-19 00:16:07 +08:00
|
|
|
|
import ComponentsInfo from '../modals/CompanyShow';
|
2025-09-18 19:40:30 +08:00
|
|
|
|
import CompanyUpdate from '../modals/CompanyUpdate';
|
|
|
|
|
|
import CompanyApps from '../table/Apps';
|
|
|
|
|
|
import Assets from '../table/Assets';
|
|
|
|
|
|
import Brands from '../table/Brands';
|
2026-01-15 18:46:34 +08:00
|
|
|
|
import CustomerEnd from '../table/CustomerEnd';
|
2025-09-18 19:40:30 +08:00
|
|
|
|
import Employees from '../table/Employees';
|
|
|
|
|
|
import Organizations from '../table/Organizations';
|
|
|
|
|
|
import Positions from '../table/Positions';
|
|
|
|
|
|
import ReceiptAccounts from '../table/ReceiptAccounts';
|
2026-01-15 18:46:34 +08:00
|
|
|
|
import Roles from '../table/Roles';
|
2025-08-08 18:35:02 +08:00
|
|
|
|
|
|
|
|
|
|
export default function Show({ title }: { title?: string } = {}) {
|
2025-06-30 14:24:39 +08:00
|
|
|
|
const { id } = useParams<{ id: string }>();
|
|
|
|
|
|
const [data, setShow] = useState<any>({});
|
|
|
|
|
|
|
2025-08-08 18:35:02 +08:00
|
|
|
|
// 注册当前页面为标签页
|
|
|
|
|
|
const { addTab } = usePageTabs({
|
|
|
|
|
|
tabKey: `company-show-${id}`,
|
2025-08-27 11:24:29 +08:00
|
|
|
|
tabLabel: '配置:' + (data?.short_name || title || '资产详情'),
|
2025-08-08 18:35:02 +08:00
|
|
|
|
});
|
2025-06-30 14:24:39 +08:00
|
|
|
|
const loadShow = () => {
|
|
|
|
|
|
let paramsId: any = { id: id ?? 0 };
|
|
|
|
|
|
Apis.Company.Companies.Show(paramsId).then((res) => {
|
|
|
|
|
|
setShow(res?.data);
|
2025-08-08 18:35:02 +08:00
|
|
|
|
// 更新标签页名称为API返回的name
|
|
|
|
|
|
if (res?.data?.short_name) {
|
|
|
|
|
|
addTab({
|
|
|
|
|
|
key: `company-show-${id}`,
|
|
|
|
|
|
label: res.data.short_name,
|
|
|
|
|
|
path: `/company/${id}`,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2025-06-30 14:24:39 +08:00
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
loadShow();
|
|
|
|
|
|
}, [id]);
|
|
|
|
|
|
|
|
|
|
|
|
let items = [
|
|
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '项目配置',
|
2025-06-30 14:24:39 +08:00
|
|
|
|
key: '1',
|
|
|
|
|
|
closable: false,
|
2025-12-13 13:23:48 +08:00
|
|
|
|
children: <CompanyApps item={data} />,
|
2025-06-30 16:07:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '组织配置',
|
2025-06-30 16:07:20 +08:00
|
|
|
|
key: '2',
|
|
|
|
|
|
closable: false,
|
2025-08-08 18:35:02 +08:00
|
|
|
|
children: <Organizations item={data} />,
|
2025-07-01 10:40:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '岗位配置',
|
2025-07-01 10:40:00 +08:00
|
|
|
|
key: '3',
|
|
|
|
|
|
closable: false,
|
2025-08-08 18:35:02 +08:00
|
|
|
|
children: <Positions item={data} />,
|
2025-06-30 14:24:39 +08:00
|
|
|
|
},
|
2025-07-01 10:40:00 +08:00
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '员工配置',
|
2025-07-01 10:40:00 +08:00
|
|
|
|
key: '4',
|
|
|
|
|
|
closable: false,
|
2025-07-01 11:35:54 +08:00
|
|
|
|
children: <Employees item={data} />,
|
2025-07-01 10:40:00 +08:00
|
|
|
|
},
|
2025-07-16 10:18:01 +08:00
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '账号配置',
|
2025-08-08 18:35:02 +08:00
|
|
|
|
key: '5',
|
2025-07-16 10:18:01 +08:00
|
|
|
|
closable: false,
|
|
|
|
|
|
children: <ReceiptAccounts item={data} />,
|
|
|
|
|
|
},
|
2025-12-13 13:23:48 +08:00
|
|
|
|
|
2025-08-12 18:17:37 +08:00
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '应用配置',
|
2025-08-12 18:17:37 +08:00
|
|
|
|
key: '6',
|
|
|
|
|
|
closable: false,
|
2025-12-13 13:23:48 +08:00
|
|
|
|
children: <Brands item={data} />,
|
2025-08-12 18:17:37 +08:00
|
|
|
|
},
|
2025-09-10 19:10:17 +08:00
|
|
|
|
{
|
2026-01-15 18:46:34 +08:00
|
|
|
|
label: '品牌配置',
|
2025-09-10 19:10:17 +08:00
|
|
|
|
key: '7',
|
|
|
|
|
|
closable: false,
|
2025-12-13 13:23:48 +08:00
|
|
|
|
children: <Assets item={data} />,
|
2025-09-10 19:10:17 +08:00
|
|
|
|
},
|
2026-01-15 18:46:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: '权限配置',
|
|
|
|
|
|
key: '8',
|
|
|
|
|
|
closable: false,
|
|
|
|
|
|
children: <Roles item={data} />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: '客户端配置',
|
|
|
|
|
|
key: '9',
|
|
|
|
|
|
closable: false,
|
|
|
|
|
|
children: <CustomerEnd item={data} />,
|
|
|
|
|
|
},
|
2025-06-30 14:24:39 +08:00
|
|
|
|
];
|
|
|
|
|
|
return (
|
|
|
|
|
|
<MyPageContainer title={title}>
|
2025-08-27 11:24:29 +08:00
|
|
|
|
{/* <ComponentsInfo item={data} /> */}
|
|
|
|
|
|
<ProCard
|
|
|
|
|
|
title={`${data?.name} (${data?.short_name})`}
|
|
|
|
|
|
extra={
|
|
|
|
|
|
<Space>
|
|
|
|
|
|
<ComponentsInfo
|
|
|
|
|
|
item={{ ...data, type: 'primary' }}
|
|
|
|
|
|
title="查看"
|
|
|
|
|
|
reload={loadShow}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<CompanyUpdate item={data} title="机构" reload={loadShow} />
|
|
|
|
|
|
</Space>
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
2025-12-13 13:23:48 +08:00
|
|
|
|
<div>请按以下顺序配置:</div>
|
2026-01-26 19:55:06 +08:00
|
|
|
|
<div style={{ padding: '10px 0' }}>
|
|
|
|
|
|
<Steps
|
|
|
|
|
|
type="navigation"
|
|
|
|
|
|
current={-1}
|
|
|
|
|
|
items={[
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '应用配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '组织配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '岗位配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '员工配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '账号配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '品牌配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '项目配置',
|
|
|
|
|
|
status: 'finish',
|
|
|
|
|
|
icon: <FileProtectOutlined />,
|
|
|
|
|
|
},
|
|
|
|
|
|
]}
|
|
|
|
|
|
/>
|
2025-08-27 11:24:29 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</ProCard>
|
2025-06-30 14:24:39 +08:00
|
|
|
|
<ProCard>
|
|
|
|
|
|
<Tabs type="card" items={data?.id ? items : []} />
|
|
|
|
|
|
</ProCard>
|
|
|
|
|
|
</MyPageContainer>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|