<vxe-table
border
highlight-hover-row
highlight-current-row
show-all-overflow
height="550"
class="lossTaget"
:row-class-name="rowClassName"
:header-cell-class-name="headerCellClassName"
:cell-class-name="cellClassName"
:data="hsstandardData"
align="center"
:span-method="colspanMethod"
style="width:100%"
>
</vxe-table>
mergeCells (arr) {
let colspanResult = []
let colspanIndex = 0
arr.forEach((item, index) => {
if (index === 0) {
colspanResult.push(1)
} else {
if (item.processType === arr[index - 1].processType) {
colspanResult[colspanIndex] += 1
colspanResult.push(0)
} else {
colspanResult.push(1)
colspanIndex = index
}
}
})
return colspanResult
},
colspanMethod ({ rowIndex, column, data }) {
if (column && column['title'] === '制程') {
let arr = this.mergeCells(data)
const _row = arr[rowIndex]
const _col = _row > 0 ? 1 : 0
let a = {
rowspan: _row,
colspan: _col
}
return a
}
},