:span-method="(...arg)=>strategySpanMethodDown(...arg,deptLevelData)"
deptLevelData: 为需要处理的数组
// 合并单元格函数 strategySpanMethodDown: function({ row, column, rowIndex, columnIndex }, data) { if (columnIndex === 1) { var spanArr = this.getSpanArr(data, column.property) const _row = spanArr[rowIndex] const _col = _row > 0 ? 1 : 0 return { rowspan: _row, colspan: _col } } }, // 处理合并行的数据 getSpanArr: function(data, spanKey) { var spanArr = [] var pos = '' for (var i = 0; i < data.length; i++) { if (i === 0) { spanArr.push(1) pos = 0 } else { // 判断当前元素与上一个元素是否相同 business 为需要根据什么合并 if (data[i].business === data[i - 1].business) { spanArr[pos] += 1 spanArr.push(0) } else { spanArr.push(1) pos = i } } } return spanArr },