效果图:
代码:
columns = [
{
{
title: <div className={styles.tableTeCenter}>投放地区</div>,
dataIndex: 'areaNames',
render: val => <div className={styles.tableCenter}>{ val ? val : '--' }</div>,
className: styles.tableCell,
},
{
title: <div className={styles.tableTeCenter}>生效时间</div>,
render: (val, item, index) => (
<div>
<span className={styles.tableTitle}>{item.effectStartDate ? formatTime(item.customerName,'Y-MM-dd') : '--'}</span>
<span className={styles.tableTitle}>至</span>
<span className={styles.tableTitle}>{item.effectEndDate ? formatTime(item.effectEndDate,'Y-MM-dd') : '--'}</span>
</div>
),
className: styles.tableCell,
},]