import { Card, Col, Input, Row, Modal, Empty, Collapse } from 'antd'; import { Form } from '@ant-design/compatible'; import { useForm } from 'antd/lib/form/Form'; import React, { useMemo, useState } from 'react'; import { connect } from 'dva'; import CommentContent from '@/components/CommentContent'; import AttachmentTable from '@/components/AttachmentTable'; import DIYTable from '@/components/DDComponents/DIYTable'; const { confirm } = Modal; const { Panel } = Collapse; const FormAndFilesNode = props => { const { formData, excelFileList, comment, version, loading } = props; const FormContent = useMemo(() => { return renderFrom(formData); }, [formData]); if (formData) { return ( {FormContent} ); } if (excelFileList?.length > 0) { return ( ); } return null; }; const renderFrom = data => { if (!data) return ; try { const ding_schema = JSON.parse(data)[0]; const formData = JSON.parse(ding_schema)?.formComponentValues; formData.forEach(item => { if (item.type === 'DIYTable') { item.value = item.value.map(row => JSON.parse(row)); } }); if (formData.length == 0) return ; return ( <> {formData.map((item, idx) => { if (item.type === 'DIYTable') { return ( ); } const value = item.value.join(','); return (
{value}
); })} ); } catch { return ; } }; export default connect(({ detail, loading }) => ({ comment: detail.comment, loading, }))(FormAndFilesNode);