fix:更新循环
Some checks failed
Build and Push Docker Image / build (push) Failing after 3m41s

This commit is contained in:
zsqtony 2025-10-05 10:39:21 +08:00
parent aad0f26437
commit 3f5457bf04
2 changed files with 79 additions and 75 deletions

View File

@ -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,

View File

@ -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}> <ProCard extra={props.extra}>
<ProDescriptions bordered> <ProDescriptions bordered>
<ProDescriptions.Item label="房屋全名" span={2}> <ProDescriptions.Item label="房屋全名" span={2}>
<Space> <Space>
<span>{show?.id}</span> <span>{getShow?.id}</span>
{show?.name} {getShow?.name}
</Space> </Space>
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="房号"> <ProDescriptions.Item label="房号">
{show?.name} {getShow?.name}
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="楼层"> <ProDescriptions.Item label="楼层">
{show?.floor} {getShow?.floor}
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="房屋用途"> <ProDescriptions.Item label="房屋用途">
<renderTextHelper.Tag <renderTextHelper.Tag
Enums={AssetHousesUsageEnum} Enums={AssetHousesUsageEnum}
value={show?.usage} value={getShow?.usage}
key="usage" key="usage"
/> />
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="产权性质"> <ProDescriptions.Item label="产权性质">
<renderTextHelper.Tag <renderTextHelper.Tag
Enums={AssetHousesOwnershipTypeEnum} Enums={AssetHousesOwnershipTypeEnum}
value={show?.ownership_type} value={getShow?.ownership_type}
key="ownership_type" key="ownership_type"
/> />
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="建筑面积"> <ProDescriptions.Item label="建筑面积">
{show?.built_area}m² {getShow?.built_area}m²
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="套内面积"> <ProDescriptions.Item label="套内面积">
{show?.inside_area}m² {getShow?.inside_area}m²
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="计费面积"> <ProDescriptions.Item label="计费面积">
{show?.chargeable_area}m² {getShow?.chargeable_area}m²
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="房屋状态"> <ProDescriptions.Item label="房屋状态">
<renderTextHelper.Tag <renderTextHelper.Tag
Enums={AssetHousesStatusEnum} Enums={AssetHousesStatusEnum}
value={show?.status} value={getShow?.status}
key="status" key="status"
/> />
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="户型"> <ProDescriptions.Item label="户型">
{show?.room || ''}{show?.hall || ''}{show?.bathroom || ''} {getShow?.room || ''}{getShow?.hall || ''}
{show?.kitchen || ''}{show?.balcony || ''} {getShow?.bathroom || ''}{getShow?.kitchen || ''}
{getShow?.balcony || ''}
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item label="朝向"> <ProDescriptions.Item label="朝向">
<renderTextHelper.Tag <renderTextHelper.Tag
Enums={AssetHousesOrientationEnum} Enums={AssetHousesOrientationEnum}
value={show?.orientation} value={getShow?.orientation}
key="orientation" key="orientation"
/> />
</ProDescriptions.Item> </ProDescriptions.Item>
</ProDescriptions> </ProDescriptions>
</ProCard> </ProCard>
</>
} }
/> />
); );