import { MyBetaModalFormProps, renderTextHelper } from '@/common'; import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; import { QuestionsTypeEnum } from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space, Spin } from 'antd'; import { useState } from 'react'; export default function SurveysListShow(props: MyBetaModalFormProps) { const [loading, setLoading] = useState(true); const [data, setData] = useState({}); return ( { if (props?.item?.id) { setLoading(true); Apis.Survey.Surveys.Show({ id: props.item.id }) .then((res) => { setData(res?.data || {}); }) .finally(() => { setLoading(false); }); } }} node={
{data?.name}
{data?.description || '-'} {data?.questions_with_order?.length > 0 ? data?.questions_with_order?.map( (item: any, index: number) => ( {''} 题目{item?.category_id}:{item?.title || '-'} {''} {item?.required ? '[必答]' : '[非必答]'} {item?.placeholder ? (
提示: {item?.placeholder || '-'}
) : null}
), ) : '-'}
{data?.created_at || '-'} {data?.updated_at || '-'} {data?.is_enabled ? '是' : '否'}
} /> ); }