Browse Source

feat(ingredient): 更新成分表单基础组件的数据处理逻辑

- 修改了currentPeoples的数据映射方式,从使用Object.entries转换为直接遍历crows数组
- 添加了类型声明并重构了数据结构处理流程
- 增加了console.log用于调试当前标准和人员信息
main
kely 4 hours ago
parent
commit
aaa1b436c6
  1. 5
      projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts

5
projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts

@ -168,7 +168,9 @@ export class IngredientFormBasicComponent implements OnChanges {
vendors: [], vendors: [],
}) })
if (currentStandard) { if (currentStandard) {
this.currentPeoples = Object.entries(currentStandard['ingredient'] ?? {}).map(([k, v]) => { this.currentPeoples = currentStandard['crows'].map((people: string) => {
const k = people
const v = currentStandard['ingredient']?.[k]
return { return {
label: k, label: k,
value: k, value: k,
@ -176,6 +178,7 @@ export class IngredientFormBasicComponent implements OnChanges {
...(v as any), ...(v as any),
} }
}) })
console.log('currentStandard', this.currentPeoples, currentStandard, this.menu?.crows)
if (this.client) { if (this.client) {
return return
} }

Loading…
Cancel
Save