![]()
@@ -80,7 +79,7 @@
diff --git a/projects/admin/src/app/components/dish-form/dish-form.component.ts b/projects/admin/src/app/components/dish-form/dish-form.component.ts
index 7979f5a..1e3df70 100644
--- a/projects/admin/src/app/components/dish-form/dish-form.component.ts
+++ b/projects/admin/src/app/components/dish-form/dish-form.component.ts
@@ -67,22 +67,26 @@ export class DishFormComponent {
month: this.fb.control([], []),
});
- this.orgSearch$
- .pipe(
- debounceTime(500),
- distinctUntilChanged(),
- switchMap((q) => this.api.getOrgList(q))
- )
- .subscribe((data) => {
- const listOfOption: Array<{ value: string; text: string }> = [];
- data.body.forEach((item) => {
- listOfOption.push({
- value: item.id.toString(),
- text: item.name,
- });
- });
- this.orgListOfOption = listOfOption;
- });
+ this.api.getOrgList().subscribe((res) => {
+ this.orgListOfOption = res;
+ });
+
+ // this.orgSearch$
+ // .pipe(
+ // debounceTime(500),
+ // distinctUntilChanged(),
+ // switchMap((q) => this.api.getOrgList(q))
+ // )
+ // .subscribe((data) => {
+ // const listOfOption: Array<{ value: string; text: string }> = [];
+ // data.forEach((item) => {
+ // listOfOption.push({
+ // value: item.id.toString(),
+ // text: item.name,
+ // });
+ // });
+ // this.orgListOfOption = listOfOption;
+ // });
this.foodSearch$
.pipe(
filter((f) => !!f),
@@ -121,7 +125,9 @@ export class DishFormComponent {
this.foodSelected.push(f.key);
}
});
- this.iconPreview = "/icon/" + this.data["icon"];
+ if (this.data["icon"]) {
+ this.iconPreview = "/icon/" + this.data["icon"];
+ }
this.formGroup.patchValue({
...this.data,
vendors: [this.data.vender],
@@ -222,8 +228,8 @@ export class DishFormComponent {
const target = e.target as HTMLInputElement;
const file = target.files![0];
target.value = "";
- if (file.size / 1024 / 1024 >= 5) {
- this.msg.error("图片大小不能超过5M");
+ if (file.size / 1024 / 1024 >= 2) {
+ this.msg.error("图片大小不能超过2M");
return;
}
const fileReader = new FileReader();
diff --git a/projects/admin/src/app/components/ingredient-status-list/ingredient-status-list.component.ts b/projects/admin/src/app/components/ingredient-status-list/ingredient-status-list.component.ts
index 2943ca3..76fefde 100644
--- a/projects/admin/src/app/components/ingredient-status-list/ingredient-status-list.component.ts
+++ b/projects/admin/src/app/components/ingredient-status-list/ingredient-status-list.component.ts
@@ -128,8 +128,8 @@ export class IngredientStatusListComponent {
if (vendors.length > 0) {
this.api.getOrgList({ vendors }).subscribe((org) => {
- if (Array.isArray(org.body)) {
- this.tableOrg = org.body.reduce((a, c) => {
+ if (Array.isArray(org)) {
+ this.tableOrg = org.reduce((a, c) => {
return {
...a,
[c.id]: c,
diff --git a/projects/admin/src/app/pages/dish/dish.component.html b/projects/admin/src/app/pages/dish/dish.component.html
index 85f6bcf..411fd98 100644
--- a/projects/admin/src/app/pages/dish/dish.component.html
+++ b/projects/admin/src/app/pages/dish/dish.component.html
@@ -21,13 +21,8 @@
+ formControlName="vendors">
diff --git a/projects/admin/src/app/pages/dish/dish.component.ts b/projects/admin/src/app/pages/dish/dish.component.ts
index f38cfb7..60edb17 100644
--- a/projects/admin/src/app/pages/dish/dish.component.ts
+++ b/projects/admin/src/app/pages/dish/dish.component.ts
@@ -64,7 +64,7 @@ export class DishComponent {
tableFoods: { [k: string]: any } = {};
- listOfOption: Array<{ value: number; text: string }> = [];
+ listOfOption: Array<{ value: number | string; text: string }> = [];
nzFilterOption = (): boolean => true;
@@ -72,24 +72,28 @@ export class DishComponent {
ngOnInit(): void {
this.initTableList();
- this.orgSearch$
- .pipe(
- filter((f) => !!f),
- debounceTime(500),
- distinctUntilChanged(),
- takeUntil(this.destroy$),
- switchMap((term: string) => this.api.getOrgList({ keyword: term }))
- )
- .subscribe((data) => {
- const listOfOption: Array<{ value: number; text: string }> = [];
- data.body.forEach((item) => {
- listOfOption.push({
- value: item.id,
- text: item.name,
- });
- });
- this.listOfOption = listOfOption;
- });
+
+ this.api.getOrgList().subscribe((res) => {
+ this.listOfOption = res;
+ });
+ // this.orgSearch$
+ // .pipe(
+ // filter((f) => !!f),
+ // debounceTime(500),
+ // distinctUntilChanged(),
+ // takeUntil(this.destroy$),
+ // switchMap((term: string) => this.api.getOrgList({ keyword: term }))
+ // )
+ // .subscribe((data) => {
+ // const listOfOption: Array<{ value: number; text: string }> = [];
+ // data.forEach((item) => {
+ // listOfOption.push({
+ // value: item.id,
+ // text: item.name,
+ // });
+ // });
+ // this.listOfOption = listOfOption;
+ // });
this.tableList.getState$.pipe(takeUntil(this.destroy$)).subscribe((res) => {
this.selectedIds = res.selectedKeys as Array;
@@ -174,8 +178,8 @@ export class DishComponent {
if (vendors.length > 0) {
this.api.getOrgList({ vendors }).subscribe((org) => {
- if (Array.isArray(org.body)) {
- this.tableOrg = org.body.reduce((a, c) => {
+ if (Array.isArray(org)) {
+ this.tableOrg = org.reduce((a, c) => {
return {
...a,
[c.id]: c,
diff --git a/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.html b/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.html
index acece79..f99ef7a 100644
--- a/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.html
+++ b/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.html
@@ -40,7 +40,8 @@
diff --git a/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts b/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts
index e064f19..80086d3 100644
--- a/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts
+++ b/projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts
@@ -45,12 +45,13 @@ export class IngredientFormComponent implements OnInit {
getDetail() {
if (this.id && this.id !== "create") {
- this.api.getMenuItem(this.id).subscribe((res) => {
+ const id = this.id.split(",")[0];
+ this.api.getMenuItem(id).subscribe((res) => {
if (res.body) {
this.menuItem = res.body;
}
});
- this.api.getMenuDist(this.id).subscribe((res) => {
+ this.api.getMenuDist(id).subscribe((res) => {
if (Array.isArray(res.body)) {
res.body.forEach((d) => {
d.ingredient.forEach((f: any) => {
@@ -91,20 +92,10 @@ export class IngredientFormComponent implements OnInit {
});
}
- onStepChange(basicInfo: any) {
+ onStepChange(idStr: string) {
this.step = 1;
- this.menuItem = {
- ...basicInfo,
- menuIds: basicInfo.menuId,
- meals: basicInfo.meals.reduce(
- (a: string[], c: OptionItemInterface) => (c["checked"] ? a.concat(c.value) : a),
- [] as string[]
- ),
- crows: basicInfo.peoples.reduce(
- (a: string[], c: OptionItemInterface) => (c["checked"] ? a.concat(c.value) : a),
- [] as string[]
- ),
- };
+ this.id = idStr;
+ this.getDetail();
}
createNewMenu() {
@@ -153,10 +144,9 @@ export class IngredientFormComponent implements OnInit {
nzWidth: 650,
nzOnOk: () => {
const { mealDishList } = this.menuDish;
-
this.api
.saveMenuDist({
- menuIds: this.menuItem.menuIds ?? [this.menuItem.id],
+ menuIds: this.id?.split(","),
dishes: this.formatData(mealDishList),
})
.subscribe((res) => {
diff --git a/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html b/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html
index afc3d68..7025e73 100644
--- a/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html
+++ b/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html
@@ -55,7 +55,7 @@
{{item}}
- {{data}} 天
+ 周{{data}}
{{statusTextMap[data]}}
@@ -69,7 +69,7 @@
- {{monthText[item]}}
+ {{item}}
diff --git a/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts b/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts
index 0c723b8..34e25c4 100644
--- a/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts
+++ b/projects/admin/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts
@@ -71,16 +71,16 @@ export class IngredientListComponent {
}
initTableList() {
- this.tableList.scroll = { x: null };
+ this.tableList.scroll = { x: "900px" };
this.tableList = this.tableList.setColumns([
- { key: "name", title: "食谱名称" },
- { key: "vender", title: "单位" },
- { key: "meals", title: "包含餐次" },
- { key: "month", title: "适用月份", width: "300px" },
+ { key: "name", title: "食谱名称", width: "200px" },
+ { key: "vender", title: "单位", width: "200px" },
+ { key: "meals", title: "包含餐次", width: "180px" },
+ { key: "month", title: "适用月份" },
{ key: "day", title: "周期" },
- { key: "status", title: "状态" },
- { key: "modify", title: "更新时间" },
- { key: "operate", title: "创建人" },
+ { key: "status", title: "状态", width: "120px" },
+ { key: "modify", title: "更新时间", width: "170px" },
+ { key: "operate", title: "创建人", width: "160px" },
]);
this.tableList = this.tableList.setOptions([
@@ -156,8 +156,8 @@ export class IngredientListComponent {
if (vendors.length > 0) {
this.api.getOrgList({ vendors }).subscribe((org) => {
- if (Array.isArray(org.body)) {
- this.tableOrg = org.body.reduce((a, c) => {
+ if (Array.isArray(org)) {
+ this.tableOrg = org.reduce((a, c) => {
return {
...a,
[c.id]: c,
diff --git a/projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts b/projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts
index f0b311a..3e6b95a 100644
--- a/projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts
+++ b/projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts
@@ -97,8 +97,8 @@ export class IngredientReleaseComponent {
if (vendors.length > 0) {
this.api.getOrgList({ vendors }).subscribe((org) => {
- if (Array.isArray(org.body)) {
- this.tableOrg = org.body.reduce((a, c) => {
+ if (Array.isArray(org)) {
+ this.tableOrg = org.reduce((a, c) => {
return {
...a,
[c.id]: c,
diff --git a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts
index b401274..8d25fb7 100644
--- a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts
+++ b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.ts
@@ -63,7 +63,7 @@ export class StandardFormComponent {
if (Array.isArray(this.state.vendors)) {
this.api.getOrgList({ vendors: this.state.vendors }).subscribe((data) => {
const listOfOption: Array<{ value: number; text: string }> = [];
- data.body.forEach((item) => {
+ data.forEach((item) => {
listOfOption.push({
value: item.id,
text: item.name,
@@ -83,7 +83,7 @@ export class StandardFormComponent {
)
.subscribe((data) => {
const listOfOption: Array<{ value: number; text: string }> = [];
- data.body.forEach((item) => {
+ data.forEach((item) => {
listOfOption.push({
value: item.id,
text: item.name,
diff --git a/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.html b/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.html
index 86869c8..4c60bc0 100644
--- a/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.html
+++ b/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.html
@@ -15,7 +15,7 @@