2025-07-10 18:01:45 +08:00
|
|
|
import {
|
|
|
|
|
MyColumns,
|
|
|
|
|
MyPageContainer,
|
|
|
|
|
MyProTableProps,
|
2025-07-25 16:42:54 +08:00
|
|
|
usePageTabs,
|
2025-07-10 18:01:45 +08:00
|
|
|
} from '@/common';
|
|
|
|
|
import { Apis } from '@/gen/Apis';
|
|
|
|
|
import {
|
2025-08-08 18:35:02 +08:00
|
|
|
AssetHousesOrientationEnum,
|
2025-07-10 18:01:45 +08:00
|
|
|
AssetHousesOwnershipTypeEnum,
|
|
|
|
|
AssetHousesStatusEnum,
|
|
|
|
|
AssetHousesUsageEnum,
|
|
|
|
|
} from '@/gen/Enums';
|
|
|
|
|
import { ProTable } from '@ant-design/pro-components';
|
|
|
|
|
import { useNavigate } from '@umijs/max';
|
|
|
|
|
import { Space } from 'antd';
|
2025-08-08 18:35:02 +08:00
|
|
|
import HousesShow from '../asset/components/modals/HousesShow';
|
|
|
|
|
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
2025-07-10 18:01:45 +08:00
|
|
|
|
2025-08-08 18:35:02 +08:00
|
|
|
export default function Index({ title = '房屋列表' }) {
|
2025-07-10 18:01:45 +08:00
|
|
|
const navigate = useNavigate();
|
2025-07-25 16:42:54 +08:00
|
|
|
// 注册当前页面为标签页
|
|
|
|
|
usePageTabs({
|
2025-08-08 18:35:02 +08:00
|
|
|
tabKey: 'asset-houses',
|
2025-07-25 16:42:54 +08:00
|
|
|
tabLabel: title,
|
|
|
|
|
});
|
2025-07-10 18:01:45 +08:00
|
|
|
return (
|
|
|
|
|
<MyPageContainer title={title}>
|
|
|
|
|
<ProTable
|
|
|
|
|
{...MyProTableProps.props}
|
|
|
|
|
request={async (params, sort) =>
|
|
|
|
|
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
|
|
|
|
|
}
|
|
|
|
|
columns={[
|
|
|
|
|
MyColumns.ID(),
|
2025-08-08 18:35:02 +08:00
|
|
|
{
|
|
|
|
|
title: '房屋名称',
|
|
|
|
|
dataIndex: 'full_name',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
|
2025-07-10 18:01:45 +08:00
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
title: '用途',
|
|
|
|
|
dataIndex: 'usage',
|
|
|
|
|
valueEnum: AssetHousesUsageEnum,
|
|
|
|
|
}),
|
|
|
|
|
{
|
2025-08-08 18:35:02 +08:00
|
|
|
title: '楼层',
|
|
|
|
|
dataIndex: 'floor',
|
|
|
|
|
render(_, record) {
|
|
|
|
|
return `${record?.floor}层`;
|
|
|
|
|
},
|
|
|
|
|
search: false,
|
2025-07-10 18:01:45 +08:00
|
|
|
},
|
2025-08-08 18:35:02 +08:00
|
|
|
|
2025-07-10 18:01:45 +08:00
|
|
|
{
|
|
|
|
|
title: '建筑面积',
|
|
|
|
|
dataIndex: 'built_area',
|
|
|
|
|
render(_, record) {
|
2025-08-08 18:35:02 +08:00
|
|
|
return `${record?.built_area || ''} m²`;
|
|
|
|
|
},
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '套内面积',
|
|
|
|
|
dataIndex: 'inside_area',
|
|
|
|
|
render(_, record) {
|
|
|
|
|
return `${record?.inside_area || ''} m²`;
|
2025-07-10 18:01:45 +08:00
|
|
|
},
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-25 16:42:54 +08:00
|
|
|
title: '计费面积',
|
|
|
|
|
dataIndex: 'chargeable_area',
|
2025-07-10 18:01:45 +08:00
|
|
|
render(_, record) {
|
2025-08-08 18:35:02 +08:00
|
|
|
return `${record?.chargeable_area || ''} m²`;
|
2025-07-10 18:01:45 +08:00
|
|
|
},
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-08-08 18:35:02 +08:00
|
|
|
title: '户型',
|
2025-07-10 18:01:45 +08:00
|
|
|
render(_, record) {
|
2025-08-08 18:35:02 +08:00
|
|
|
return `${record?.room || ''}室${record?.hall || ''}厅${
|
|
|
|
|
record?.bathroom || ''
|
|
|
|
|
}卫${record?.kitchen || ''}厨${record?.balcony || ''}阳台`;
|
2025-07-10 18:01:45 +08:00
|
|
|
},
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
2025-08-08 18:35:02 +08:00
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
title: '朝向',
|
|
|
|
|
dataIndex: 'orientation',
|
|
|
|
|
valueEnum: AssetHousesOrientationEnum,
|
|
|
|
|
search: false,
|
|
|
|
|
}),
|
2025-07-10 18:01:45 +08:00
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
title: '房屋状态',
|
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
valueEnum: AssetHousesStatusEnum,
|
|
|
|
|
search: false,
|
|
|
|
|
}),
|
2025-08-08 18:35:02 +08:00
|
|
|
MyColumns.EnumTag({
|
|
|
|
|
title: '产权性质',
|
|
|
|
|
dataIndex: 'ownership_type',
|
|
|
|
|
valueEnum: AssetHousesOwnershipTypeEnum,
|
|
|
|
|
search: false,
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '产权年限',
|
|
|
|
|
dataIndex: 'ownership_term',
|
|
|
|
|
render(_, record) {
|
|
|
|
|
return `${record?.ownership_term || '-'} 年`;
|
|
|
|
|
},
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
2025-07-10 18:01:45 +08:00
|
|
|
MyColumns.Option({
|
|
|
|
|
render: (_, item: any, index, action) => (
|
|
|
|
|
<Space key={index}>
|
2025-08-08 18:35:02 +08:00
|
|
|
<HousesShow item={item} reload={action?.reload} />
|
|
|
|
|
<HousesUpdate
|
|
|
|
|
item={item}
|
|
|
|
|
reload={action?.reload}
|
|
|
|
|
title="编辑"
|
|
|
|
|
/>
|
2025-07-10 18:01:45 +08:00
|
|
|
</Space>
|
|
|
|
|
),
|
|
|
|
|
}),
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</MyPageContainer>
|
|
|
|
|
);
|
|
|
|
|
}
|