|
|
@@ -420,13 +420,13 @@
|
|
|
// 按父ID分组,计算每组的起始索引和数量
|
|
|
const groupMap = new Map()
|
|
|
|
|
|
- // 收集所有行的索引,包括没有parentId的行
|
|
|
+ // 收集所有行的索引;无 parentId 的行使用自身 id 做分组,避免被错误合并
|
|
|
this.auditProjectList.forEach((row, index) => {
|
|
|
- const parentId = row.parentId || null
|
|
|
- if (!groupMap.has(parentId)) {
|
|
|
- groupMap.set(parentId, [])
|
|
|
+ const groupKey = row.parentId || row.id || `row_${index}`
|
|
|
+ if (!groupMap.has(groupKey)) {
|
|
|
+ groupMap.set(groupKey, [])
|
|
|
}
|
|
|
- groupMap.get(parentId).push(index)
|
|
|
+ groupMap.get(groupKey).push(index)
|
|
|
})
|
|
|
|
|
|
// 设置每组的合并信息:第一条 rowspan=组长度,其余为0
|