25 changed files with 15385 additions and 255 deletions
File diff suppressed because it is too large
@ -1,28 +1,29 @@ |
|||
import { OptionItemInterface } from "@cdk/types"; |
|||
import { OptionItemInterface } from '@cdk/types' |
|||
|
|||
export type GlobalEnum = { |
|||
category: CategoryDTO[]; |
|||
mark: MarkDTO[]; |
|||
nutrient: NutrientDTO[]; |
|||
venderType: CategoryDTO[]; |
|||
mealType: OptionItemInterface[]; |
|||
menuStatus: OptionItemInterface[]; |
|||
measurementType: CategoryDTO[]; |
|||
poly: { key: string; name: string }[]; |
|||
}; |
|||
category: CategoryDTO[] |
|||
mark: MarkDTO[] |
|||
nutrient: NutrientDTO[] |
|||
venderType: CategoryDTO[] |
|||
mealType: OptionItemInterface[] |
|||
menuStatus: OptionItemInterface[] |
|||
measurementType: CategoryDTO[] |
|||
poly: { key: string; name: string }[] |
|||
} |
|||
|
|||
export type CategoryDTO = { |
|||
key: string; |
|||
value: string; |
|||
}; |
|||
key: string |
|||
value: string |
|||
} |
|||
|
|||
export type MarkDTO = { |
|||
key: string; |
|||
value: string; |
|||
}; |
|||
key: string |
|||
value: string |
|||
} |
|||
export type NutrientDTO = { |
|||
key: string; |
|||
value: string; |
|||
measurement: string; |
|||
nrv: number; |
|||
}; |
|||
key: string |
|||
value: string |
|||
measurement: string |
|||
nrv: number |
|||
sort: number |
|||
} |
|||
|
@ -1,91 +1,79 @@ |
|||
<table *ngIf="nutritions" class="nutritions-table" [ngClass]="{'dark':dark}"> |
|||
<thead> |
|||
<tr> |
|||
<th class=" text-left"> |
|||
营养素 |
|||
</th> |
|||
<th class=" text-right"> |
|||
实际摄入 |
|||
</th> |
|||
<th class=" text-right"> |
|||
标准范围 |
|||
</th> |
|||
<th class=" text-right"> |
|||
<table *ngIf="nutritions" class="nutritions-table" [ngClass]="{ dark: dark }"> |
|||
<thead> |
|||
<tr> |
|||
<th class="text-left">营养素</th> |
|||
<th class="text-right">实际摄入</th> |
|||
<th class="text-right">标准范围</th> |
|||
<!-- <th class=" text-right"> |
|||
UL值 |
|||
</th> |
|||
<th class=" text-right"> |
|||
溢出范围 |
|||
</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr *ngFor="let item of nutritions" class="row text-right" [ngClass]="{ |
|||
</th> --> |
|||
<th class="text-right">溢出范围</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr |
|||
*ngFor="let item of nutritions" |
|||
class="row text-right" |
|||
[ngClass]="{ |
|||
less:item.conclusion === '不足', |
|||
success:item.conclusion === '适量', |
|||
warning:item.conclusion === '过量', |
|||
danger:item.conclusion === '严重超标', |
|||
}"> |
|||
<td> |
|||
<div class="inner text-left"> |
|||
{{item.nutrition}} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="inner"> |
|||
{{item.virtual}} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="inner"> |
|||
{{item.standard}} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
}" |
|||
> |
|||
<td> |
|||
<div class="inner text-left"> |
|||
{{ item.nutrition }} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="inner"> |
|||
{{ item.virtual }} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="inner"> |
|||
{{ item.standard }} |
|||
</div> |
|||
</td> |
|||
<!-- <td> |
|||
<div class="inner"> |
|||
{{item.ul}} |
|||
</div> |
|||
</td> |
|||
<td> |
|||
<div class="inner"> |
|||
{{item.overload}} |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</td> --> |
|||
<td> |
|||
<div class="inner"> |
|||
{{ item.overload }} |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div class="flex justify-center text-center mt-4"> |
|||
<nz-space> |
|||
<div *nzSpaceItem> |
|||
<div class="tag less"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p> |
|||
不足 |
|||
</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag success"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p> |
|||
适量 |
|||
</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag warning"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p> |
|||
过量 |
|||
</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag danger"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p> |
|||
严重超标 |
|||
</p> |
|||
</div> |
|||
</nz-space> |
|||
<nz-space> |
|||
<div *nzSpaceItem> |
|||
<div class="tag less"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p>不足</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag success"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p>适量</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag warning"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p>过量</p> |
|||
</div> |
|||
<div *nzSpaceItem> |
|||
<div class="tag danger"> |
|||
<div class="inner"></div> |
|||
</div> |
|||
<p>严重超标</p> |
|||
</div> |
|||
</nz-space> |
|||
</div> |
@ -1,14 +1,18 @@ |
|||
import { Component, Input } from "@angular/core"; |
|||
import { Component, Input } from '@angular/core' |
|||
|
|||
@Component({ |
|||
selector: "lib-nutrition-table", |
|||
templateUrl: "./nutrition-table.component.html", |
|||
styleUrls: ["./nutrition-table.component.less"], |
|||
selector: 'lib-nutrition-table', |
|||
templateUrl: './nutrition-table.component.html', |
|||
styleUrls: ['./nutrition-table.component.less'], |
|||
}) |
|||
export class NutritionTableComponent { |
|||
constructor() {} |
|||
|
|||
@Input() nutritions: any[] = []; |
|||
@Input() nutritions: any[] = [] |
|||
|
|||
@Input() dark = false; |
|||
@Input() dark = false |
|||
|
|||
ngOnInit() { |
|||
console.log('this.nutritions', this.nutritions) |
|||
} |
|||
} |
|||
|
@ -1,3 +1 @@ |
|||
<iframe #iframe |
|||
style="display: none;"> |
|||
</iframe> |
|||
<iframe #iframe style="display: none"> </iframe> |
|||
|
Loading…
Reference in new issue