Commit b95f055b by cen

fix: 更改父id

1 parent b7886b4c
...@@ -342,21 +342,21 @@ export default { ...@@ -342,21 +342,21 @@ export default {
}) })
} else if (item.level === 3) { } else if (item.level === 3) {
// 当level为3时,先按parentId分组 // 当level为3时,先按parentId分组
const parentId = item.parentId const parentCategoryType = item.parentCategoryType
if (level3Map.has(parentId)) { if (level3Map.has(parentCategoryType)) {
// 如果parentId已存在,则将当前categoryType添加到数组中 // 如果parentId已存在,则将当前categoryType添加到数组中
level3Map.get(parentId).push(item.categoryType) level3Map.get(parentCategoryType).push(item.categoryType)
} else { } else {
// 如果parentId不存在,则创建新数组 // 如果parentId不存在,则创建新数组
level3Map.set(parentId, [item.categoryType]) level3Map.set(parentCategoryType, [item.categoryType])
} }
} }
}) })
// 然后将分组后的level3数据添加到historyOrderGoodsTypes中 // 然后将分组后的level3数据添加到historyOrderGoodsTypes中
level3Map.forEach((categoryTypes, parentId) => { level3Map.forEach((categoryTypes, parentCategoryType) => {
this.historyOrderGoodsTypes.push({ this.historyOrderGoodsTypes.push({
secondaryGoodsType: parentId, secondaryGoodsType: parentCategoryType,
thirdLevelGoodsTypes: categoryTypes thirdLevelGoodsTypes: categoryTypes
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!