import { MyBetaModalFormProps, renderTextHelper } from '@/common'; import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; import { MsgPropertyAnnouncementsPublishTypeEnum } from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useState } from 'react'; export default function Show(props: MyBetaModalFormProps) { const [show, setShow] = useState({}); const [loading, setLoading] = useState(false); const [hasLoaded, setHasLoaded] = useState(false); const getShow = () => { if (props?.item?.id && !loading && !hasLoaded) { setLoading(true); setHasLoaded(true); Apis.Msg.MsgPropertyAnnouncements.Show({ id: props?.item?.id, }) .then((res: any) => { setShow(res?.data); }) .catch(() => { setHasLoaded(false); // 如果请求失败,允许重试 }) .finally(() => { setLoading(false); }); } }; return ( {props?.item?.asset_project?.name || '-'} {props?.item?.title || '-'} {props?.item?.is_publish ? '已发布' : '未发布'} {show?.schedule_publish_at || '-'}
{props?.item?.publish_at || '-'} {props?.item?.created_at || '-'} {props?.item?.updated_at || '-'} } /> ); }