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