diff --git a/projects/cdk/src/ingredient/ingredient-analysis/ingredient-analysis.component.ts b/projects/cdk/src/ingredient/ingredient-analysis/ingredient-analysis.component.ts
index fb472b7..1dc69da 100644
--- a/projects/cdk/src/ingredient/ingredient-analysis/ingredient-analysis.component.ts
+++ b/projects/cdk/src/ingredient/ingredient-analysis/ingredient-analysis.component.ts
@@ -2,6 +2,7 @@ import { Component, Input, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { ApiService } from "@cdk/services";
import { finalize } from "rxjs";
+import { weekdayMap } from "../ingredient-form-basic/ingredient-form-basic.component";
@Component({
selector: "lib-ingredient-analysis",
@@ -29,8 +30,11 @@ export class IngredientAnalysisComponent implements OnInit {
analysisLoading = false;
+ weekdayMap = weekdayMap;
+
ngOnInit(): void {
- this.currentDay = this.current.day;
+ console.log("this.current", this.menu);
+ this.currentDay = this.current?.day ?? this.menu.day[0];
this.currentPeople = this.menu.crows[0];
this.id = this.route.snapshot.queryParamMap.get("newId") ?? this.menu.id;
this.getAnalysis();
diff --git a/projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts b/projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts
index 4f92509..6d7abb0 100644
--- a/projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts
+++ b/projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts
@@ -79,36 +79,38 @@ export class IngredientFormBasicComponent implements OnChanges {
vendors: this.fb.control([], this.client ? [] : [FormValidators.required()]),
month: this.fb.control([], [FormValidators.required()]),
});
- this.standardSearch$
- .pipe(
- filter((f) => !!f),
- debounceTime(500),
- distinctUntilChanged(),
- takeUntil(this.destroy$),
- switchMap((q) => this.api.getStandard(q))
- )
- .subscribe((data) => {
- let listOfOption: Array
= [];
- if (data.body) {
- const getById = data.body && !Array.isArray(data.body);
- if (getById) {
- data.body = [data.body];
- }
- data.body.forEach((item: any) => {
- listOfOption.push({
- label: item.name,
- value: item.id,
- ...item,
- });
- });
- this.searchedStandard = this.searchedStandard.concat(listOfOption);
- if (getById && this.menu.nutrient) {
- this.onStandardChange(this.menu.nutrient);
- }
- }
- this.standardOfOption = listOfOption;
- });
-
+ // this.standardSearch$
+ // .pipe(
+ // filter((f) => !!f),
+ // debounceTime(500),
+ // distinctUntilChanged(),
+ // takeUntil(this.destroy$),
+ // switchMap((q) => this.api.getStandard(q))
+ // )
+ // .subscribe((data) => {
+ // let listOfOption: Array = [];
+ // if (data.body) {
+ // const getById = data.body && !Array.isArray(data.body);
+ // if (getById) {
+ // data.body = [data.body];
+ // }
+ // data.body.forEach((item: any) => {
+ // listOfOption.push({
+ // label: item.name,
+ // value: item.id,
+ // ...item,
+ // });
+ // });
+ // this.searchedStandard = this.searchedStandard.concat(listOfOption);
+ // if (getById && this.menu.nutrient) {
+ // this.onStandardChange(this.menu.nutrient);
+ // }
+ // }
+ // this.standardOfOption = listOfOption;
+ // });
+ this.api.getStandard().subscribe((res) => {
+ this.standardOfOption = res;
+ });
this.setValues();
}
diff --git a/projects/cdk/src/ingredient/ingredient-preview/ingredient-preview.component.html b/projects/cdk/src/ingredient/ingredient-preview/ingredient-preview.component.html
index 6ef81e9..43ca26f 100644
--- a/projects/cdk/src/ingredient/ingredient-preview/ingredient-preview.component.html
+++ b/projects/cdk/src/ingredient/ingredient-preview/ingredient-preview.component.html
@@ -14,7 +14,11 @@
{{basic.standardName ?? '-'}}
- {{basic.day}}天
+
+
+ {{weekdayMap[item]}}
+
+
@@ -56,12 +60,12 @@
- {{days | json}}
+
{{weekdayMap[day]}}
- 重量/克
+ 重量/克
|