Browse Source

修复 新增菜品 的 bug

main
kely 6 months ago
parent
commit
8a86e68535
  1. 2
      projects/admin/src/app/components/dish-form/dish-form.component.ts
  2. 2
      projects/admin/src/app/pages/dish/dish.component.ts
  3. 2
      projects/client/src/app/components/dish-form/dish-form.component.ts
  4. 2
      projects/client/src/app/pages/dish/dish.component.ts

2
projects/admin/src/app/components/dish-form/dish-form.component.ts

@ -199,7 +199,7 @@ export class DishFormComponent {
this.foodItemSelected = this.foodItemSelected.filter((item) => v.includes(item.value))
// 添加新的选择项
const newSelectedItems = this.searchedFood.filter(
const newSelectedItems = this.foodListOfOption.filter(
(item) => v.includes(item.value) && !this.foodItemSelected.some((s) => s.value === item.value),
)
this.foodItemSelected = [...this.foodItemSelected, ...newSelectedItems]

2
projects/admin/src/app/pages/dish/dish.component.ts

@ -214,7 +214,7 @@ export class DishComponent {
showFoodForm(data?: any) {
this.drawerRef = this.drawer.create({
nzTitle: data ? '编辑菜品' : '新增菜品',
nzWidth: 700,
nzWidth: 1000,
nzContent: DishFormComponent,
nzContentParams: {
data,

2
projects/client/src/app/components/dish-form/dish-form.component.ts

@ -193,7 +193,7 @@ export class DishFormComponent {
this.foodItemSelected = this.foodItemSelected.filter((item) => v.includes(item.value))
// 添加新的选择项
const newSelectedItems = this.searchedFood.filter(
const newSelectedItems = this.foodListOfOption.filter(
(item) => v.includes(item.value) && !this.foodItemSelected.some((s) => s.value === item.value),
)
this.foodItemSelected = [...this.foodItemSelected, ...newSelectedItems]

2
projects/client/src/app/pages/dish/dish.component.ts

@ -178,7 +178,7 @@ export class DishComponent {
showFoodForm(data?: any) {
this.drawerRef = this.drawer.create({
nzTitle: data ? '编辑菜品' : '新增菜品',
nzWidth: 700,
nzWidth: 1000,
nzContent: DishFormComponent,
nzContentParams: {
data,

Loading…
Cancel
Save