import React, { FC } from 'react'; import deleteIcon from './assets/deleteIcon.png'; import prodIcon from './assets/prodIcon.png'; import styles from './index.less'; import { CardDiv } from '../index'; interface ComponentProps { isEdit?: boolean; proData?: any[]; onDeleteProd?: (index: number) => void; onAddProd?: () => void; } const ProjectInfo: FC = ({ isEdit = false, proData = [], onDeleteProd, onAddProd, }) => { const rightView = () => (
新增产商品
); // 不带有资费信息产品基本数据 const renderNorRow = ({ row, index }: any) => { const { prodId, offerId } = row; let key = prodId ? `${prodId}-${index}` : `${offerId}-${index}`; return (
{row?.prodName || row?.offerName}
{isEdit && ( { if (onDeleteProd) onDeleteProd(index); }} /> )}
产商品编码
{row?.offerNbr || row?.offerCode || row?.prodCode}
产商品类别
{row?.attrValueName || row?.offerTypeName || row?.prodTypeName}
); }; return ( {!!proData.filter((row) => row !== undefined).length && (
{proData.map((row, index) => renderNorRow({ row, index }))}
)}
); }; export default ProjectInfo;