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 d1db4cd..f2fa540 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 @@ -139,7 +139,6 @@ export class DishFormComponent { public getValues() { let values = null - console.log('this.formGroup.getRawValue()', this.formGroup.getRawValue(), this.foodItemSelected) if (Utils.validateFormGroup(this.formGroup)) { const value = this.formGroup.getRawValue() // const { _nutrition, key, name, type } = this.formGroup.getRawValue(); diff --git a/projects/admin/src/app/pages/dish/dish.component.ts b/projects/admin/src/app/pages/dish/dish.component.ts index ba0667e..c303ead 100644 --- a/projects/admin/src/app/pages/dish/dish.component.ts +++ b/projects/admin/src/app/pages/dish/dish.component.ts @@ -198,7 +198,6 @@ export class DishComponent { [c.key]: c, } }, {} as AnyObject) - console.log('this.tableFoods', this.tableFoods) } }) } diff --git a/projects/admin/src/app/pages/food/food.component.ts b/projects/admin/src/app/pages/food/food.component.ts index 803c10b..ec1181f 100644 --- a/projects/admin/src/app/pages/food/food.component.ts +++ b/projects/admin/src/app/pages/food/food.component.ts @@ -148,9 +148,7 @@ export class FoodComponent implements OnInit, OnDestroy { } downloadTemplate() { - this.api.getFoodExcelTemplate().subscribe((res) => { - console.log('res', res) - }) + this.api.getFoodExcelTemplate().subscribe((res) => {}) } showImportForm(nzContent: TemplateRef<{}>) { 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 68834a5..bc54ec0 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 @@ -52,8 +52,15 @@ {{ data | date : 'yyyy-MM-dd HH:mm:ss' }} + + + {{ data }} + + - {{ tableOrg[data] ? tableOrg[data].name : '-' }} + + {{ tableOrg[data] ? tableOrg[data].name : '-' }} + {{ item }} @@ -63,16 +70,12 @@ {{ statusTextMap[data] }} -
- - 全年 - - - - {{ item }} - - -
+ {{ data.length }}个月 + +
+ {{ item }}月 +
+
{{ data }} 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 bb711a8..a75eecd 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 @@ -88,9 +88,9 @@ export class IngredientListComponent { { key: 'name', title: '食谱名称', width: '200px' }, { key: 'vender', title: '单位', width: '200px' }, { key: 'meals', title: '包含餐次', width: '180px' }, - { key: 'month', title: '适用月份' }, - { key: 'day', title: '周期' }, - { key: 'status', title: '状态', width: '120px' }, + { key: 'month', title: '适用月份', width: '100px' }, + { key: 'day', title: '周期', width: '100px' }, + { key: 'status', title: '状态', width: '80px' }, { key: 'modify', title: '更新时间', width: '170px' }, { key: 'operate', title: '创建人', width: '160px' }, ]) diff --git a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html index ccfafc9..86bcc46 100644 --- a/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html +++ b/projects/admin/src/app/pages/standard/standard-form/standard-form.component.html @@ -28,21 +28,23 @@ - - - {{ item.value }} - - - - - - - + + + + {{ item.value }} + + + + + + + + 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 7a3dca3..2cbfbc9 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 @@ -60,7 +60,7 @@ export class StandardFormComponent { overflows: Record = {} ngOnInit(): void { - console.log('this.api.globalEnum.nutrient', this.api.globalEnum.nutrient) + // console.log('this.api.globalEnum.nutrient', this.api.globalEnum.nutrient) this.formGroup = this.fb.group({ id: this.fb.control('', []), name: this.fb.control('', [FormValidators.required()]), @@ -119,15 +119,20 @@ export class StandardFormComponent { onSubmit(gotoSetting?: boolean) { if (Utils.validateFormGroup(this.formGroup)) { + const vendors = this.listOfOption.filter((f) => f.checked).map((i) => i.id) + if (vendors.length === 0) { + this.msg.error('请选择适用单位') + return + } this.submitLoading = true this.api .saveStandard({ - foodCategoryDay: this.state?.foodCategoryDay, - foodCategoryWeek: this.state?.foodCategoryWeek, - ingredient: this.state?.ingredient, + foodCategoryDay: this.state?.foodCategoryDay ?? [], + foodCategoryWeek: this.state?.foodCategoryWeek ?? [], + ingredient: this.state?.ingredient ?? {}, overflows: this.overflows, ...this.formGroup.value, - vendors: this.listOfOption.filter((f) => f.checked).map((i) => i.id), + vendors, }) .pipe( finalize(() => { diff --git a/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts index 9213f94..1d640d1 100644 --- a/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts +++ b/projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts @@ -91,14 +91,26 @@ export class StandardListComponent { if (Utils.validateFormGroup(this.copyForm)) { const val = this.copyForm.value const name = val.name! - const res = await lastValueFrom( + + const add = await lastValueFrom( this.api.saveStandard({ - ...v, + vendors: v['vendors'], + overflow: v['overflow'], + overflows: v['overflows'], name, id: null, }), ) - this.msg.success(res.desc) + const update = await lastValueFrom( + this.api.saveStandard({ + foodCategoryDay: v['foodCategoryDay'] ?? [], + foodCategoryWeek: v['foodCategoryWeek'] ?? [], + ingredient: v['ingredient'] ?? {}, + name, + id: add.body['id'], + }), + ) + this.msg.success(update.desc) this.tableList.run() return true } 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 b670351..11dbf69 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 @@ -123,7 +123,8 @@ export class StandardSettingComponent implements AfterViewInit, OnDestroy { return [] } this.expand(0) - const sorts = data.crows ?? Object.keys(data.ingredient) + const sorts = data.crows?.length > 0 ? data.crows : Object.keys(data.ingredient) + return sorts.map((peopleName: string) => { const v: any = data.ingredient[peopleName] return { @@ -231,7 +232,6 @@ export class StandardSettingComponent implements AfterViewInit, OnDestroy { } 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 })) } diff --git a/projects/cdk/src/app-page/app-page.component.ts b/projects/cdk/src/app-page/app-page.component.ts index 2a21573..a651af5 100644 --- a/projects/cdk/src/app-page/app-page.component.ts +++ b/projects/cdk/src/app-page/app-page.component.ts @@ -1,19 +1,19 @@ -import { CommonModule } from "@angular/common"; -import { Component, Input, OnDestroy, TemplateRef } from "@angular/core"; -import { ActivatedRoute, NavigationEnd, Router, Scroll } from "@angular/router"; -import { Subject, filter, startWith, take, takeUntil } from "rxjs"; -import { NzOutletModule } from "ng-zorro-antd/core/outlet"; +import { CommonModule } from '@angular/common' +import { Component, Input, OnDestroy, TemplateRef } from '@angular/core' +import { ActivatedRoute, NavigationEnd, Router, Scroll } from '@angular/router' +import { Subject, filter, startWith, take, takeUntil } from 'rxjs' +import { NzOutletModule } from 'ng-zorro-antd/core/outlet' interface BreadcrumbInterface { - label: string; - href?: string; + label: string + href?: string } @Component({ standalone: true, - selector: "app-page", - templateUrl: "./app-page.component.html", - styleUrls: ["./app-page.component.less"], + selector: 'app-page', + templateUrl: './app-page.component.html', + styleUrls: ['./app-page.component.less'], imports: [CommonModule, NzOutletModule], }) export class AppPageComponent implements OnDestroy { @@ -28,35 +28,35 @@ export class AppPageComponent implements OnDestroy { // }); } - @Input() pageTitle?: TemplateRef<{}> | string; + @Input() pageTitle?: TemplateRef<{}> | string - @Input() full: boolean = false; + @Input() full: boolean = false - @Input() scroll: boolean = true; + @Input() scroll: boolean = true - @Input() pageExtra?: TemplateRef<{}> | string; + @Input() pageExtra?: TemplateRef<{}> | string - unSubscribe$ = new Subject(); + unSubscribe$ = new Subject() - breadcrumb: BreadcrumbInterface[] = []; + breadcrumb: BreadcrumbInterface[] = [] ngOnDestroy(): void { - this.unSubscribe$.next(); - this.unSubscribe$.complete(); + this.unSubscribe$.next() + this.unSubscribe$.complete() } genBreadcrumb() { - let route: ActivatedRoute | null = this.route; - this.breadcrumb = []; + let route: ActivatedRoute | null = this.route + this.breadcrumb = [] while (route) { if (route.routeConfig?.title) { this.breadcrumb.unshift({ label: route.routeConfig!.title as string, href: route.routeConfig.path, - }); + }) } - route = route?.parent ?? null; + route = route?.parent ?? null } - console.log("this.route", this.breadcrumb); + // console.log("this.route", this.breadcrumb); } } diff --git a/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.ts b/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.ts index a7a75c6..2b2a704 100644 --- a/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.ts +++ b/projects/cdk/src/ingredient/ingredient-dish/ingredient-dish.component.ts @@ -105,7 +105,7 @@ export class IngredientDishComponent implements OnChanges { initMenuBasic() { if (this.menuBaisc) { const meals = this.menuBaisc.meals as string[] - console.log('this.menuBaisc', this.menuBaisc) + // console.log('this.menuBaisc', this.menuBaisc) const day = this.menuBaisc.day as number[] this.days = day.map((i, idx) => { const d = weekdayMap[i] @@ -146,7 +146,7 @@ export class IngredientDishComponent implements OnChanges { reuse(day: number, nzContent: TemplateRef<{}>) { const thisDayDishs = this.mealDishList.filter((f) => f.day === day) - console.log('dayDishs', day, this.mealDishList, thisDayDishs, this.selectDay) + // console.log('dayDishs', day, this.mealDishList, thisDayDishs, this.selectDay) this.modal.create({ nzTitle: '请选择应用到的日期', nzContent, 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 2f8c7fb..a1827cb 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 @@ -118,13 +118,15 @@ export class IngredientFormBasicComponent implements OnChanges { } }) - this.api.getOrgList().subscribe((res) => { - this.allOrgs = res.map((i) => ({ - ...i, - value: String(i.id), - label: i.name, - })) - }) + if (!this.client) { + this.api.getOrgList().subscribe((res) => { + this.allOrgs = res.map((i) => ({ + ...i, + value: String(i.id), + label: i.name, + })) + }) + } } ngOnChanges(changes: SimpleChanges): void {} diff --git a/projects/cdk/src/table-list/td-overflow.directive.ts b/projects/cdk/src/table-list/td-overflow.directive.ts index 49dd892..1ec357a 100644 --- a/projects/cdk/src/table-list/td-overflow.directive.ts +++ b/projects/cdk/src/table-list/td-overflow.directive.ts @@ -1,30 +1,30 @@ -import { AfterContentInit, AfterViewInit, ChangeDetectorRef, Directive, ElementRef, Input } from "@angular/core"; -import { NzPopoverDirective } from "ng-zorro-antd/popover"; +import { AfterContentInit, AfterViewInit, ChangeDetectorRef, Directive, ElementRef, Input } from '@angular/core' +import { NzPopoverDirective } from 'ng-zorro-antd/popover' @Directive({ - selector: "[jwTdOverflow]", + selector: '[jwTdOverflow]', }) export class TdOverflowDirective implements AfterViewInit { - @Input("jwTdOverflow") content!: string; + @Input('jwTdOverflow') content!: string constructor( private elementRef: ElementRef, private popoverDirective: NzPopoverDirective, - private cdr: ChangeDetectorRef + private cdr: ChangeDetectorRef, ) {} ngOnInit() {} ngAfterViewInit(): void { - const element = this.elementRef.nativeElement as HTMLElement; - console.log("element", element.offsetWidth, element.scrollWidth); + const element = this.elementRef.nativeElement as HTMLElement + // console.log("element", element.offsetWidth, element.scrollWidth); // 如果元素的实际宽度大于可见宽度,就使用 nz-popover 指令来显示完整的内容 if (element.offsetWidth < element.scrollWidth) { - this.popoverDirective.content = this.content; + this.popoverDirective.content = this.content } else { - this.popoverDirective.trigger = null; - this.popoverDirective.content = "da"; - element.textContent = this.content; + this.popoverDirective.trigger = null + this.popoverDirective.content = 'da' + element.textContent = this.content } } } diff --git a/projects/client/src/app/components/dish-form/dish-form.component.ts b/projects/client/src/app/components/dish-form/dish-form.component.ts index 600bc08..4a0e731 100644 --- a/projects/client/src/app/components/dish-form/dish-form.component.ts +++ b/projects/client/src/app/components/dish-form/dish-form.component.ts @@ -1,203 +1,203 @@ -import { Component, Input, OnInit } from "@angular/core"; -import { FormArray, FormBuilder, FormGroup } from "@angular/forms"; -import { ApiService } from "@cdk/services"; -import { Utils } from "@cdk/utils"; -import { FormValidators } from "@cdk/validators"; -import { NzMessageService } from "ng-zorro-antd/message"; -import { Subject, debounceTime, distinctUntilChanged, filter, finalize, switchMap, throttleTime } from "rxjs"; +import { Component, Input, OnInit } from '@angular/core' +import { FormArray, FormBuilder, FormGroup } from '@angular/forms' +import { ApiService } from '@cdk/services' +import { Utils } from '@cdk/utils' +import { FormValidators } from '@cdk/validators' +import { NzMessageService } from 'ng-zorro-antd/message' +import { Subject, debounceTime, distinctUntilChanged, filter, finalize, switchMap, throttleTime } from 'rxjs' @Component({ - selector: "app-dish-form", - templateUrl: "./dish-form.component.html", - styleUrls: ["./dish-form.component.less"], + selector: 'app-dish-form', + templateUrl: './dish-form.component.html', + styleUrls: ['./dish-form.component.less'], }) export class DishFormComponent { constructor(private fb: FormBuilder, private msg: NzMessageService, private api: ApiService) {} - @Input() data: any; + @Input() data: any - @Input() orgs: any[] = []; + @Input() orgs: any[] = [] - @Input() foods: any[] = []; + @Input() foods: any[] = [] - private orgSearch$ = new Subject>(); + private orgSearch$ = new Subject>() - private foodSearch$ = new Subject>(); + private foodSearch$ = new Subject>() - formGroup!: FormGroup; + formGroup!: FormGroup - selectedValue = null; + selectedValue = null - orgListOfOption: Array<{ value: string; text: string }> = []; + orgListOfOption: Array<{ value: string; text: string }> = [] - foodListOfOption: Array<{ value: string; text: string }> = []; + foodListOfOption: Array<{ value: string; text: string }> = [] - searchedFood: Array<{ value: string; text: string }> = []; + searchedFood: Array<{ value: string; text: string }> = [] - foodSelected: string[] = []; + foodSelected: string[] = [] - foodItemSelected: any[] = []; + foodItemSelected: any[] = [] - nzFilterOption = (): boolean => true; + nzFilterOption = (): boolean => true - globalEnum = this.api.globalEnum; + globalEnum = this.api.globalEnum - uploadLoading = false; + uploadLoading = false - addFoodVisible = false; + addFoodVisible = false - iconPreview = ""; + iconPreview = '' get food(): FormArray { - return this.formGroup.get("ingredient") as FormArray; + return this.formGroup.get('ingredient') as FormArray } get icon() { - return this.formGroup.get("icon")?.value; + return this.formGroup.get('icon')?.value } ngOnInit(): void { this.formGroup = this.fb.group({ - id: this.fb.control("", []), - name: this.fb.control("", [FormValidators.required()]), - icon: this.fb.control("", []), - mark: this.fb.control("", [FormValidators.required()]), - poly: this.fb.control("", [FormValidators.required()]), + id: this.fb.control('', []), + name: this.fb.control('', [FormValidators.required()]), + icon: this.fb.control('', []), + mark: this.fb.control('', [FormValidators.required()]), + poly: this.fb.control('', [FormValidators.required()]), month: this.fb.control([], []), - }); + }) this.orgSearch$ .pipe( debounceTime(500), distinctUntilChanged(), - switchMap((q) => this.api.getOrgList(q)) + switchMap((q) => this.api.getOrgList(q)), ) .subscribe((data) => { - const listOfOption: Array<{ value: string; text: string }> = []; + const listOfOption: Array<{ value: string; text: string }> = [] data.forEach((item) => { listOfOption.push({ value: item.id.toString(), text: item.name, - }); - }); - this.orgListOfOption = listOfOption; - }); + }) + }) + this.orgListOfOption = listOfOption + }) this.foodSearch$ .pipe( filter((f) => !!f), debounceTime(500), distinctUntilChanged(), - switchMap((q) => this.api.getFoodList(q)) + switchMap((q) => this.api.getFoodList(q)), ) .subscribe((data) => { - const listOfOption: Array<{ value: string; text: string }> = []; + const listOfOption: Array<{ value: string; text: string }> = [] data.body.forEach((item) => { listOfOption.push({ value: item.key, text: item.name, - }); - }); - this.searchedFood = this.searchedFood.concat(listOfOption); - this.foodListOfOption = listOfOption; - }); - this.setValues(); + }) + }) + this.searchedFood = this.searchedFood.concat(listOfOption) + this.foodListOfOption = listOfOption + }) + this.setValues() } setValues() { - this.orgListOfOption = this.orgs.map((i) => ({ text: i.name, value: i.id })); + this.orgListOfOption = this.orgs.map((i) => ({ text: i.name, value: i.id })) if (this.data) { // this.allMonth = this.allMonth.map((i) => // (this.data.month ?? []).includes(i.value) ? { ...i, checked: true } : i // ); this.foods.forEach((f) => { - const item = { text: f.name, value: f.key }; - this.foodListOfOption.push(item); - this.searchedFood.push(item); - const num = this.data.ingredient.find((i: any) => i.key === f.key); + const item = { text: f.name, value: f.key } + this.foodListOfOption.push(item) + this.searchedFood.push(item) + const num = this.data.ingredient.find((i: any) => i.key === f.key) if (num) { - this.foodItemSelected.push({ num: num.value, ...item, isMain: num.isMain }); - this.foodSelected.push(f.key); + this.foodItemSelected.push({ num: num.value, ...item, isMain: num.isMain }) + this.foodSelected.push(f.key) } - }); + }) this.formGroup.patchValue({ ...this.data, mark: this.data.marks, - }); - if (this.data["icon"]) { - this.iconPreview = "/api/icon/" + this.data["icon"]; + }) + if (this.data['icon']) { + this.iconPreview = '/api/icon/' + this.data['icon'] } } } public getValues() { - let values = null; - console.log("this.formGroup.getRawValue()", this.formGroup.getRawValue(), this.foodItemSelected); + let values = null + // console.log("this.formGroup.getRawValue()", this.formGroup.getRawValue(), this.foodItemSelected); if (Utils.validateFormGroup(this.formGroup)) { - const value = this.formGroup.getRawValue(); + const value = this.formGroup.getRawValue() // const { _nutrition, key, name, type } = this.formGroup.getRawValue(); - let ingredient: any[] = []; + let ingredient: any[] = [] for (const f of this.foodItemSelected) { - let num = Number(f.num); + let num = Number(f.num) if (!num) { - this.msg.error(`请输入${f.value}-${f.text}的重量`); - return; + this.msg.error(`请输入${f.value}-${f.text}的重量`) + return } ingredient.push({ isMain: f.isMain, key: f.value, value: num, - }); + }) } - const month = value.month.join(","); + const month = value.month.join(',') values = { ...value, month, ingredient, - }; + } } - return values; + return values } onMainChange(e: boolean, key: string) { this.foodItemSelected.forEach((i) => { if (e) { - i.isMain = false; + i.isMain = false if (i.value === key) { - i.isMain = true; + i.isMain = true } } else { if (i.value === key) { - i.isMain = false; + i.isMain = false } } - }); + }) } searchOrg(value: string): void { if (value) { - this.orgSearch$.next({ keyword: value }); + this.orgSearch$.next({ keyword: value }) } } searchFood(value: string): void { if (value) { - this.foodSearch$.next({ keyword: value }); + this.foodSearch$.next({ keyword: value }) } } onFoodSelected(v: string[]) { - this.foodItemSelected = []; + this.foodItemSelected = [] this.searchedFood.forEach((item) => { if (this.foodItemSelected.some((s) => s.value === item.value)) { - return; + return } if (v.includes(item.value)) { - this.foodItemSelected.push(item); + this.foodItemSelected.push(item) } - }); + }) // this.foodItemSelected = this.searchedFood.filter((f) => { // return v.includes(f.value) @@ -207,36 +207,36 @@ export class DishFormComponent { addFood() { this.food.push( this.fb.group({ - name: this.fb.control("", [FormValidators.required()]), + name: this.fb.control('', [FormValidators.required()]), tag: this.fb.control(0, [FormValidators.required()]), weight: this.fb.control(0, [FormValidators.required()]), - }) - ); + }), + ) } removeFood(idx: number) { - this.food.removeAt(idx); + this.food.removeAt(idx) } onFileChange(e: Event) { - const target = e.target as HTMLInputElement; - const file = target.files![0]; - target.value = ""; + const target = e.target as HTMLInputElement + const file = target.files![0] + target.value = '' if (file.size / 1024 / 1024 >= 2) { - this.msg.error("图片大小不能超过2M"); - return; + this.msg.error('图片大小不能超过2M') + return } - const fileReader = new FileReader(); + const fileReader = new FileReader() fileReader.onload = () => { - const base64 = fileReader.result as string; - this.iconPreview = base64; + const base64 = fileReader.result as string + this.iconPreview = base64 // this.formGroup.get("icon")?.setValue(base64); - }; - fileReader.readAsDataURL(file); - const formdata = new FormData(); - formdata.append("file", file); + } + fileReader.readAsDataURL(file) + const formdata = new FormData() + formdata.append('file', file) this.api.upload(formdata).subscribe((res) => { - this.formGroup.get("icon")?.setValue(res.body); - }); + this.formGroup.get('icon')?.setValue(res.body) + }) } } diff --git a/projects/client/src/app/pages/data-vis/data-vis.component.ts b/projects/client/src/app/pages/data-vis/data-vis.component.ts index 5dc14db..639643d 100644 --- a/projects/client/src/app/pages/data-vis/data-vis.component.ts +++ b/projects/client/src/app/pages/data-vis/data-vis.component.ts @@ -199,7 +199,7 @@ export class DataVisComponent implements AfterViewInit { this.rd2.setStyle(child, 'transform', `translateY(0px)`) const elHeight = el.clientHeight const childHeight = child.clientHeight - console.log(childHeight, elHeight) + // console.log(childHeight, elHeight) if (childHeight <= elHeight) { return } @@ -226,7 +226,7 @@ export class DataVisComponent implements AfterViewInit { return } this.api - .getAnalysis(this.menuId, void 0, this.people) + .getAnalysis(this.menuId, this.day, this.people) .pipe( finalize(() => { this.analysisLoading = false diff --git a/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html b/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html index 5f08cc5..bb9d867 100644 --- a/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html +++ b/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.html @@ -50,6 +50,9 @@ {{ tableOrg[data] ? tableOrg[data].name : '-' }} + + {{ data }} + {{ item }} @@ -59,16 +62,12 @@ {{ statusTextMap[data] }} -
- - 全年 - - - - {{ item }} - - -
+ {{ data.length }}个月 + +
+ {{ item }}月 +
+
{{ data }} diff --git a/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts b/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts index 8232b69..6e8c009 100644 --- a/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts +++ b/projects/client/src/app/pages/ingredients/ingredient-list/ingredient-list.component.ts @@ -82,9 +82,9 @@ export class IngredientListComponent { { key: 'name', title: '食谱名称', width: '200px' }, { key: 'meals', title: '包含餐次', width: '180px' }, - { key: 'month', title: '适用月份' }, - { key: 'day', title: '周期' }, - { key: 'status', title: '状态', width: '120px' }, + { key: 'month', title: '适用月份', width: '100px' }, + { key: 'day', title: '周期', width: '100px' }, + { key: 'status', title: '状态', width: '80px' }, { key: 'modify', title: '更新时间', width: '170px' }, { key: 'operate', title: '创建人', width: '160px' }, ]) @@ -231,7 +231,7 @@ export class IngredientListComponent { this.msg.error('请选择发布日期') return false } - console.log(id, day) + // console.log(id, day) const res = await lastValueFrom(this.api.release(id, this.startTime, day)) this.msg.success(res.desc) this.tableList.run()