表格数据合并单元格,增加rowSpan

        // 给相同的增加rowSpan
			function dealWithData(list){
                if(!list || !Array.isArray(list) || list.length === 0){
                    return []
                }
                list = [...list]
				let i = 0, j = 1 , id = list[i].foodId;
				for(j; j < list.length; j++){
					if(list[j].foodId !== id){
                        list[i].rowSpan = (j - i)
						i = j;
                        id = list[i].foodId
					}
				}
				return list
			}
posted @ 2021-03-31 16:52  橙云生  阅读(109)  评论(0编辑  收藏  举报