refactor(growth-guard):优化数据转换逻辑- 简化 groups 数据转换逻辑,使用 map代替 filter + map- 移除冗余的 console.log语句-修复 customers 数据更新的赋值方式

This commit is contained in:
陈昱达
2025-08-22 15:58:49 +08:00
parent f205565966
commit b5da499252

View File

@@ -69,13 +69,11 @@ export default {
// 将groups数据转换为多维数组格式
const convertedGroups = newValue.map(group => {
// 从每个group的data中提取name属性组成数组
// 排除空的
return group.data.filter(item => item.name).map(item => item.name)
// return group.data.map(item => item.name || '')
})
console.log(convertedGroups)
return group.data.map(item => item.name || '');
});
// 更新customers数据用于footer显示
this.customers = convertedGroups
this.customers = convertedGroups;
},
deep: true
}