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(() => {
if (open && props?.onOpen) {
props.onOpen();
if (open) {
props?.onOpen(true);
}
}, [open, props?.onOpen]);
}, [open]);
useImperativeHandle(props.myRef, () => ({
close,

View File

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