2025-06-30 14:20:46 +08:00
|
|
|
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
|
|
|
|
import { MyModal } from '@/components/MyModal';
|
2025-10-04 22:22:41 +08:00
|
|
|
import { Apis } from '@/gen/Apis';
|
2025-06-30 14:20:46 +08:00
|
|
|
import {
|
|
|
|
|
AssetHousesOrientationEnum,
|
|
|
|
|
AssetHousesOwnershipTypeEnum,
|
|
|
|
|
AssetHousesStatusEnum,
|
|
|
|
|
AssetHousesUsageEnum,
|
|
|
|
|
} from '@/gen/Enums';
|
|
|
|
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
2025-10-04 22:22:41 +08:00
|
|
|
import { Space } from 'antd';
|
|
|
|
|
import { useCallback, useState } from 'react';
|
2025-06-30 14:20:46 +08:00
|
|
|
|
|
|
|
|
export default function info(props: MyBetaModalFormProps) {
|
2025-10-04 22:22:41 +08:00
|
|
|
const [show, setShow] = useState<any>({});
|
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
|
|
|
|
|
const getShow = useCallback(() => {
|
|
|
|
|
if (loading || !props?.item?.id) return;
|
|
|
|
|
|
|
|
|
|
setLoading(true);
|
|
|
|
|
Apis.Asset.AssetHouses.Show({
|
|
|
|
|
id: props?.item?.id,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
setShow(res?.data);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
});
|
|
|
|
|
}, [props?.item?.id, loading]);
|
|
|
|
|
|
|
|
|
|
// 只在弹窗打开时获取数据
|
|
|
|
|
const handleOpen = useCallback(() => {
|
|
|
|
|
if (!loading) {
|
|
|
|
|
getShow();
|
|
|
|
|
}
|
|
|
|
|
}, [getShow, loading]);
|
|
|
|
|
|
2025-06-30 14:20:46 +08:00
|
|
|
return (
|
|
|
|
|
<MyModal
|
|
|
|
|
title={props.title || '查看'}
|
2025-10-04 22:22:41 +08:00
|
|
|
width="800px"
|
|
|
|
|
onOpen={handleOpen}
|
2025-06-30 14:20:46 +08:00
|
|
|
node={
|
|
|
|
|
<ProCard extra={props.extra}>
|
|
|
|
|
<ProDescriptions bordered>
|
|
|
|
|
<ProDescriptions.Item label="房屋全名" span={2}>
|
2025-10-04 22:22:41 +08:00
|
|
|
<Space>
|
|
|
|
|
<span>【{show?.id}】</span>
|
|
|
|
|
{show?.full_name}
|
|
|
|
|
</Space>
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="房号">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.name}
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="楼层">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.floor}
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="房屋用途">
|
|
|
|
|
<renderTextHelper.Tag
|
|
|
|
|
Enums={AssetHousesUsageEnum}
|
2025-10-04 22:22:41 +08:00
|
|
|
value={show?.usage}
|
2025-06-30 14:20:46 +08:00
|
|
|
key="usage"
|
|
|
|
|
/>
|
|
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="产权性质">
|
|
|
|
|
<renderTextHelper.Tag
|
|
|
|
|
Enums={AssetHousesOwnershipTypeEnum}
|
2025-10-04 22:22:41 +08:00
|
|
|
value={show?.ownership_type}
|
2025-06-30 14:20:46 +08:00
|
|
|
key="ownership_type"
|
|
|
|
|
/>
|
|
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="建筑面积">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.built_area}m²
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="套内面积">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.inside_area}m²
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="计费面积">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.chargeable_area}m²
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="房屋状态">
|
|
|
|
|
<renderTextHelper.Tag
|
|
|
|
|
Enums={AssetHousesStatusEnum}
|
2025-10-04 22:22:41 +08:00
|
|
|
value={show?.status}
|
2025-06-30 14:20:46 +08:00
|
|
|
key="status"
|
|
|
|
|
/>
|
|
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="户型">
|
2025-10-04 22:22:41 +08:00
|
|
|
{show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫
|
|
|
|
|
{show?.kitchen || ''}厨{show?.balcony || ''}阳台
|
2025-06-30 14:20:46 +08:00
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item label="朝向">
|
|
|
|
|
<renderTextHelper.Tag
|
|
|
|
|
Enums={AssetHousesOrientationEnum}
|
2025-10-04 22:22:41 +08:00
|
|
|
value={show?.orientation}
|
2025-06-30 14:20:46 +08:00
|
|
|
key="orientation"
|
|
|
|
|
/>
|
|
|
|
|
</ProDescriptions.Item>
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|
</ProCard>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|