Browse Source

bug修改

main
kely 1 year ago
parent
commit
87897b8e48
  1. 2
      projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts
  2. 4
      projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts
  3. 5
      projects/admin/src/app/pages/standard/standard-list/standard-list.component.html
  4. 4
      projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts
  5. 5
      projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.html
  6. 10
      projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts
  7. 1
      projects/cdk/src/table-list/table-list/table-list.component.html
  8. 1
      projects/cdk/src/table-list/table-list/table-list.component.ts
  9. 4
      projects/client/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts

2
projects/admin/src/app/pages/ingredients/ingredient-form/ingredient-form.component.ts

@ -110,7 +110,7 @@ export class IngredientFormComponent implements OnInit {
analysis() {
this.drawer.create({
nzWidth: 20,
nzWidth: 720,
nzWrapClassName: "analysis-drawer",
nzContent: IngredientAnalysisComponent,
nzContentParams: {

4
projects/admin/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts

@ -22,7 +22,9 @@ export class IngredientReleaseComponent {
private msg: NzMessageService
) {}
public tableList = new TableListOption(this.fetchData.bind(this));
public tableList = new TableListOption(this.fetchData.bind(this), {
frontPagination: false,
});
public queryForm = new FormGroup({
name: new FormControl(""),

5
projects/admin/src/app/pages/standard/standard-list/standard-list.component.html

@ -10,7 +10,10 @@
<div class="h-full overflow-hidden bg-white rounded-lg">
<nz-card [nzBordered]="false" nzTitle="营养标准列表">
<table-list [props]="tableList" [search]="searchTpl" [action]="pageExtraTpl" [formGroup]="queryForm"
<table-list [props]="tableList"
[search]="searchTpl"
[action]="pageExtraTpl"
[formGroup]="queryForm"
[renderColumns]="renderColumnsTpl">

4
projects/admin/src/app/pages/standard/standard-list/standard-list.component.ts

@ -22,7 +22,9 @@ export class StandardListComponent {
private router: Router
) {}
public tableList = new TableListOption(this.fetchData.bind(this));
public tableList = new TableListOption(this.fetchData.bind(this), {
frontPagination: false,
});
public queryForm = new FormGroup({
keyword: new FormControl(""),

5
projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.html

@ -14,13 +14,8 @@
<nz-form-control [nzErrorTip]="formControlErrorTpl" nzSpan="12">
<nz-select
[nzDisabled]="menu"
nzShowSearch
nzServerSearch
nzPlaceHolder="请选择标准"
[nzShowArrow]="false"
formControlName="nutrient"
[nzFilterOption]="nzFilterOption"
(nzOnSearch)="searchStandard($event)"
(ngModelChange)="onStandardChange($event)">
<nz-option *ngFor="let o of standardOfOption"
[nzLabel]="o.label"

10
projects/cdk/src/ingredient/ingredient-form-basic/ingredient-form-basic.component.ts

@ -110,20 +110,25 @@ export class IngredientFormBasicComponent implements OnChanges {
// });
this.api.getStandard().subscribe((res) => {
this.standardOfOption = res;
if (this.menu) {
this.onStandardChange(String(this.menu.nutrient));
this.setValues();
}
});
this.setValues();
}
ngOnChanges(changes: SimpleChanges): void {}
setValues() {
let weekday = [];
// console.log("this.menu", this.menu);
if (this.menu) {
this.standardSearch$.next({ id: this.menu.nutrient });
this.meals = this.meals.map((i) => (this.menu.meals.includes(i.value) ? { ...i, checked: true } : i));
weekday = this.weekday.map((i) => (this.menu.day.includes(i.value) ? { ...i, checked: true } : i));
this.formGroup.patchValue({
...this.menu,
nutrient: String(this.menu.nutrient),
vendors: [String(this.menu.vender)],
});
} else {
@ -147,6 +152,9 @@ export class IngredientFormBasicComponent implements OnChanges {
onStandardChange(v: any) {
const currentStandard = this.standardOfOption.find((f) => f.value === v);
this.formGroup.patchValue({
vendors: [],
});
if (currentStandard) {
this.currentPeoples = Object.entries(currentStandard["ingredient"] ?? {}).map(([k, v]) => {
return {

1
projects/cdk/src/table-list/table-list/table-list.component.html

@ -36,7 +36,6 @@
<ng-template #renderTableTpl>
<div class="table-card table-list shadow-sm ">
<div #tableEl class="overflow-auto">
<nz-table
#basicTable

1
projects/cdk/src/table-list/table-list/table-list.component.ts

@ -145,6 +145,7 @@ export class TableListComponent implements OnInit, OnChanges, AfterViewInit, OnD
this.dataSource = f.body.content;
this.props.pager.total = f.body.totalElements;
this.totalPages = Math.ceil(this.props.pager.total / this.props.pager.size);
console.log("this.props.pager.total", this.props.pager.total);
this.checkPage();
});
}

4
projects/client/src/app/pages/ingredients/ingredient-release/ingredient-release.component.ts

@ -21,7 +21,9 @@ export class IngredientReleaseComponent {
private msg: NzMessageService
) {}
public tableList = new TableListOption(this.fetchData.bind(this));
public tableList = new TableListOption(this.fetchData.bind(this), {
frontPagination: false,
});
public queryForm = new FormGroup({
name: new FormControl(""),

Loading…
Cancel
Save