diff --git a/projects/cdk/src/ingredient/ingredient-meals/ingredient-meals.component.html b/projects/cdk/src/ingredient/ingredient-meals/ingredient-meals.component.html index 185684a..e795299 100644 --- a/projects/cdk/src/ingredient/ingredient-meals/ingredient-meals.component.html +++ b/projects/cdk/src/ingredient/ingredient-meals/ingredient-meals.component.html @@ -27,9 +27,7 @@ 菜品 食材 - - {{ p }} - + {{ p }} @@ -81,15 +79,17 @@ - - - - + + + + + + diff --git a/projects/cdk/src/ingredient/ingredient.module.ts b/projects/cdk/src/ingredient/ingredient.module.ts index 1596585..ec525a1 100644 --- a/projects/cdk/src/ingredient/ingredient.module.ts +++ b/projects/cdk/src/ingredient/ingredient.module.ts @@ -1,4 +1,4 @@ -import { NgModule } from '@angular/core' +import { NgModule, Pipe } from '@angular/core' import { SharedModule } from '@cdk/shared/shared.module' import { AddDishToIngredientComponent } from './add-dish-to-ingredient/add-dish-to-ingredient.component' import { IngredientMealsComponent } from './ingredient-meals/ingredient-meals.component' @@ -10,6 +10,13 @@ import { IngredientAnalysisComponent } from './ingredient-analysis/ingredient-an import { NutritionTableComponent } from './nutrition-table/nutrition-table.component' import { SelectFoodComponent } from './select-food/select-food.component' +@Pipe({ name: 'findByPeople', pure: true }) +export class FindByPeoplePipe { + transform(values: any[], people: any) { + return values?.find((v) => v.peopleName === people) + } +} + @NgModule({ declarations: [ AddDishToIngredientComponent, @@ -21,6 +28,7 @@ import { SelectFoodComponent } from './select-food/select-food.component' IngredientAnalysisComponent, NutritionTableComponent, SelectFoodComponent, + FindByPeoplePipe, ], imports: [SharedModule], exports: [