<Table :loading="loading" border :columns="columnsDefault" :data="data" :span-method="handleSpan"></Table>
integratedData(data) {
let that = this;
let arrId = [];
data.forEach(i => {
!arrId.includes(i.taskMonth) ? arrId.push(i.taskMonth) : arrId;
});
let arrObj = [];
arrId.forEach(j => {
arrObj.push({
month: j,
num: 0
})
})
data.forEach(k => {
arrObj.forEach(l => {
k.taskMonth === l.month ? l.num ++ : l.num;
})
})
data.forEach((m,mIndex) => {
arrObj.forEach((n,index) => {
if(m.taskMonth === n.month){
if(arrId.includes(m.taskMonth)){
m.mergeCol = n.num;
arrId.splice(arrId.indexOf(m.taskMonth),1);
}else{
m.mergeCol = 0;
}
}
})
})
return data;
},
handleSpan ({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
return {
rowspan: row.mergeCol === 0 ? 0:row.mergeCol,
colspan: row.mergeCol === 0 ? 0:1
};
}
},