From 812222d5414b2fbb98fda54443bcf07aa850521c Mon Sep 17 00:00:00 2001 From: kely Date: Tue, 3 Feb 2026 15:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=BA=BA=E7=BE=A4=20?= =?UTF-8?q?=E4=B8=8E=20=E9=A3=9F=E5=93=81=E6=95=B0=E9=87=8F=20=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E4=B8=8D=E4=B8=8A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ingredient-meals.component.html | 24 +++++++++---------- .../cdk/src/ingredient/ingredient.module.ts | 10 +++++++- 2 files changed, 21 insertions(+), 13 deletions(-) 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: [