This commit is contained in:
parent
aad0f26437
commit
3f5457bf04
@ -9,10 +9,10 @@ export function MyModal(props?: any) {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (open && props?.onOpen) {
|
||||
props.onOpen();
|
||||
if (open) {
|
||||
props?.onOpen(true);
|
||||
}
|
||||
}, [open, props?.onOpen]);
|
||||
}, [open]);
|
||||
|
||||
useImperativeHandle(props.myRef, () => ({
|
||||
close,
|
||||
|
||||
@ -11,86 +11,90 @@ import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
const [show, setShow] = useState<any>({});
|
||||
const getShow = () => {
|
||||
Apis.Grid.Grids.Show({
|
||||
id: props?.item?.id,
|
||||
})
|
||||
.then((res) => {
|
||||
setShow(res?.data);
|
||||
})
|
||||
.catch(() => false);
|
||||
};
|
||||
export default function Info(props: MyBetaModalFormProps) {
|
||||
const [getShow, setDataShow] = useState<any>({});
|
||||
|
||||
// 只在弹窗打开时获取数据
|
||||
const handleOpen = () => {
|
||||
getShow();
|
||||
};
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
width="800px"
|
||||
onOpen={handleOpen}
|
||||
onOpen={(e: boolean) => {
|
||||
if (e) {
|
||||
return Apis.Grid.Grids.Show({
|
||||
id: props?.item?.id,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
setDataShow(JSON.parse(JSON.stringify(res?.data)));
|
||||
return false;
|
||||
})
|
||||
.catch(() => false);
|
||||
}
|
||||
console.log(e);
|
||||
}}
|
||||
node={
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||
<Space>
|
||||
<span>【{show?.id}】</span>
|
||||
{show?.name}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房号">
|
||||
{show?.name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="楼层">
|
||||
{show?.floor}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋用途">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesUsageEnum}
|
||||
value={show?.usage}
|
||||
key="usage"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="产权性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOwnershipTypeEnum}
|
||||
value={show?.ownership_type}
|
||||
key="ownership_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="建筑面积">
|
||||
{show?.built_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="套内面积">
|
||||
{show?.inside_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计费面积">
|
||||
{show?.chargeable_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesStatusEnum}
|
||||
value={show?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="户型">
|
||||
{show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫
|
||||
{show?.kitchen || ''}厨{show?.balcony || ''}阳台
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="朝向">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOrientationEnum}
|
||||
value={show?.orientation}
|
||||
key="orientation"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
<>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||
<Space>
|
||||
<span>【{getShow?.id}】</span>
|
||||
{getShow?.name}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房号">
|
||||
{getShow?.name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="楼层">
|
||||
{getShow?.floor}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋用途">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesUsageEnum}
|
||||
value={getShow?.usage}
|
||||
key="usage"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="产权性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOwnershipTypeEnum}
|
||||
value={getShow?.ownership_type}
|
||||
key="ownership_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="建筑面积">
|
||||
{getShow?.built_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="套内面积">
|
||||
{getShow?.inside_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计费面积">
|
||||
{getShow?.chargeable_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesStatusEnum}
|
||||
value={getShow?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="户型">
|
||||
{getShow?.room || ''}房{getShow?.hall || ''}厅
|
||||
{getShow?.bathroom || ''}卫{getShow?.kitchen || ''}厨
|
||||
{getShow?.balcony || ''}阳台
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="朝向">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOrientationEnum}
|
||||
value={getShow?.orientation}
|
||||
key="orientation"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user