2025-06-29 18:42:50 +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';
|
|
|
|
|
import MyAssetBuildings from './components/AssetBuildings';
|
2025-06-30 18:42:21 +08:00
|
|
|
import AssetGrid from './components/AssetGrid';
|
2025-06-30 14:20:46 +08:00
|
|
|
import AssetInfo from './components/AssetInfo';
|
2025-06-30 18:42:21 +08:00
|
|
|
|
2025-06-29 18:42:50 +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.Asset.AssetProjects.Show(paramsId).then((res) => {
|
|
|
|
|
setShow(res?.data);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
loadShow();
|
|
|
|
|
}, [id]);
|
|
|
|
|
|
|
|
|
|
let items = [
|
2025-06-30 14:20:46 +08:00
|
|
|
{
|
|
|
|
|
label: '基本信息',
|
|
|
|
|
key: 'info',
|
|
|
|
|
closable: false,
|
|
|
|
|
children: <AssetInfo item={data} reload={() => loadShow()} />,
|
|
|
|
|
},
|
2025-06-29 18:42:50 +08:00
|
|
|
{
|
|
|
|
|
label: '楼栋管理',
|
|
|
|
|
key: 'asset_buildings',
|
|
|
|
|
closable: false,
|
|
|
|
|
children: <MyAssetBuildings item={data} />,
|
|
|
|
|
},
|
2025-06-30 18:42:21 +08:00
|
|
|
{
|
|
|
|
|
label: '网格管理',
|
|
|
|
|
key: 'grid',
|
|
|
|
|
closable: false,
|
|
|
|
|
children: <AssetGrid item={data} />,
|
|
|
|
|
},
|
2025-06-30 14:20:46 +08:00
|
|
|
// {
|
|
|
|
|
// label: '车位管理',
|
|
|
|
|
// key: 'carport',
|
|
|
|
|
// closable: false,
|
|
|
|
|
// children: <MyAssetBuildings item={data} />,
|
|
|
|
|
// },
|
2025-06-29 18:42:50 +08:00
|
|
|
];
|
|
|
|
|
return (
|
|
|
|
|
<MyPageContainer title={title}>
|
2025-06-30 14:20:46 +08:00
|
|
|
{/* <Info
|
2025-06-29 18:42:50 +08:00
|
|
|
item={data}
|
|
|
|
|
extra={<Update item={data} reload={() => loadShow()} title="项目" />}
|
2025-06-30 14:20:46 +08:00
|
|
|
/> */}
|
2025-06-29 18:42:50 +08:00
|
|
|
<ProCard>
|
|
|
|
|
<Tabs type="card" items={data?.id ? items : []} />
|
|
|
|
|
</ProCard>
|
|
|
|
|
</MyPageContainer>
|
|
|
|
|
);
|
|
|
|
|
}
|