import { Timeline } from 'antd'; import styles from './index.less'; import { STATUS, SUB_STATUS } from './List'; import moment from 'moment'; import { useMemo } from 'react'; const StatusRender = ({ statusList }) => { const list = useMemo(() => { return statusList.map(item => { let attach = []; if (item.attach) { try { attach = JSON.parse(item.attach); } catch (e) { console.error(e); } attach = attach .map(item => { if (item instanceof Object) { return (
{item.name}
); } }) .filter(item => item); } return { ...item, attach }; }); }); return ( {list?.map((item, index) => ( {index + 1}}>
{STATUS.find(cur => cur.value == item.project_status)?.label}- {SUB_STATUS.find(cur => cur.value == item.status)?.label}
持续时间:{item.continuously}      修改人员:{item.author_name}      修改时间:{moment(item.c_time).format('YYYY-MM-DD')}
{item.attach.length > 0 &&
附件: {item.attach}
}
))}
); }; export default StatusRender;