const mergeCells = (text, data, key, index, recordlength) => {
if (index !== 0 && text === data[index - 1][key]) {
return 0;
}
let rowSpan = 1;
for (let i = index + 1; i < data.length; i += 1) {
if (text !== data[i][key]) {
break;
}
rowSpan += 1;
}
return rowSpan;
};
str.render = (text, record, index) => {
const obj = {
children: text,
props: {
rowSpan: 0,
},
};
obj.props.rowSpan = mergeCells(
newsource[index].flow_trace,
newsource,
'flow_trace',
index,
newsource[index].length,
);
return obj
};
antd 行列合并
猜你喜欢
转载自blog.csdn.net/mengfanyue123/article/details/122604817
今日推荐
周排行