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