1. 第一列相同数据合并
    2. flitterData(arr) {
    3. let spanOneArr = [];
    4. let concatOne = 0;
    5. arr.forEach((item, index) => {
    6. if (index === 0) {
    7. spanOneArr.push(1);
    8. } else {
    9. //name 修改
    10. // item.itemCode 是我第一列要渲染的值 这个你们改成自己的
    11. if (item.storeName === arr[index - 1].storeName) {
    12. //第一列需合并相同内容的判断条件
    13. spanOneArr[concatOne] += 1;
    14. spanOneArr.push(0);
    15. } else {
    16. spanOneArr.push(1);
    17. concatOne = index;
    18. }
    19. }
    20. });
    21. return {
    22. one: spanOneArr,
    23. };
    24. },
    25. arraySpanMethod({ row, column, rowIndex, columnIndex }){
    26. if(columnIndex == 0){
    27. // 表格数据修改
    28. const _row = this.flitterData(this.searchData).one[rowIndex]
    29. const _col = _row > 0 ? 1 : 0;
    30. return {
    31. rowspan: _row,
    32. colspan: _col,
    33. };
    34. }
    35. }