|
@@ -579,9 +579,31 @@ export default {
|
|
one: spanOneArr
|
|
one: spanOneArr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ flitterData1(arr) {
|
|
|
|
+ var spanOneArr = []
|
|
|
|
+ let concatOne = 0
|
|
|
|
+ arr.forEach((item, index) => {
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ spanOneArr.push(1)
|
|
|
|
+ } else {
|
|
|
|
+ // name 修改
|
|
|
|
+ if (item.materialType === arr[index - 1].materialType) {
|
|
|
|
+ // 第一列需合并相同内容的判断条件
|
|
|
|
+ spanOneArr[concatOne] += 1
|
|
|
|
+ spanOneArr.push(0)
|
|
|
|
+ } else {
|
|
|
|
+ spanOneArr.push(1)
|
|
|
|
+ concatOne = index
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return {
|
|
|
|
+ one: spanOneArr
|
|
|
|
+ }
|
|
|
|
+ },
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
if (columnIndex === 0) {
|
|
if (columnIndex === 0) {
|
|
- const _row = this.flitterData(this.tableData).one[rowIndex]
|
|
|
|
|
|
+ const _row = this.flitterData1(this.tableData).one[rowIndex]
|
|
const _col = _row > 0 ? 1 : 0
|
|
const _col = _row > 0 ? 1 : 0
|
|
return {
|
|
return {
|
|
rowspan: _row,
|
|
rowspan: _row,
|