@@ -316,7 +316,7 @@
{{calcTypeText}}
-
diff --git a/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts
index 38b0a6c..d442999 100644
--- a/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts
+++ b/projects/admin/src/app/pages/standard/standard-setting/standard-setting.component.ts
@@ -96,6 +96,9 @@ export class StandardSettingComponent {
if (!data) {
return [];
}
+ if (Array.isArray(data) && data.length > 0) {
+ this.calcType = data[0]?.type;
+ }
return data;
}
@@ -151,11 +154,11 @@ export class StandardSettingComponent {
});
}
- removeFoodType(type: string, foodType: string) {
+ removeFoodType(type: string, idx: number) {
if (type === "day") {
- this.foodCategoryDay = this.foodCategoryDay.filter((f) => f.type !== foodType);
+ this.foodCategoryDay = this.foodCategoryDay.filter((f, i) => idx !== i);
} else {
- this.foodCategoryWeek = this.foodCategoryWeek.filter((f) => f.type !== foodType);
+ this.foodCategoryWeek = this.foodCategoryWeek.filter((f, i) => idx !== i);
}
}
@@ -170,6 +173,12 @@ export class StandardSettingComponent {
this.ingredient = this.ingredient.filter((_, i) => i !== idx);
}
+ calcTypeChange() {
+ console.log("this.calcType", this.calcType);
+ this.foodCategoryDay = this.foodCategoryDay.map((i) => ({ ...i, type: this.calcType }));
+ this.foodCategoryWeek = this.foodCategoryWeek.map((i) => ({ ...i, type: this.calcType }));
+ }
+
addNutrition(idx: number) {
const current = this.ingredient[idx];
const withoutSelectNutritions = this.globalEnum.nutrient.find(
diff --git a/projects/client/src/app/pages/dashboard/dashboard.component.html b/projects/client/src/app/pages/dashboard/dashboard.component.html
index 9e92c70..dac4891 100644
--- a/projects/client/src/app/pages/dashboard/dashboard.component.html
+++ b/projects/client/src/app/pages/dashboard/dashboard.component.html
@@ -114,28 +114,21 @@
- 食谱审核及发布
+ 食谱发布
8
- 在食谱列表中找到食谱,发起审核
+ 在食谱列表中找到食谱,进行发布
+
9
-
- 等待审核通过后返回食谱列表查看进行发布
-
-
-
-