效果演示
核心js
combineCell:function(list) {
for (var field in list[0]) {
var k = 0
while (k < list.length) {
list[k][field + 'Span'] = 1
list[k][field + 'Dis'] = false
for (var i = k + 1; i <= list.length - 1; i++) {
if (list[k][field] == list[i][field] && list[k][field] != '') {
list[k][field + 'Span']++
list[k][field + 'Dis'] = false
list[i][field + 'Span'] = 1
list[i][field + 'Dis'] = true
} else {
break
}
}
k = i
}
}
return list
}