add mixOrder condition
This commit is contained in:
parent
c9fd7baf9d
commit
f4b1db4867
4 changed files with 98 additions and 68 deletions
|
|
@ -171,10 +171,10 @@ const routes: Routes = [
|
||||||
// loadComponent: () =>
|
// loadComponent: () =>
|
||||||
// import('./core/notfound.component').then((m) => m.NotfoundComponent),
|
// import('./core/notfound.component').then((m) => m.NotfoundComponent),
|
||||||
// },
|
// },
|
||||||
// {
|
{
|
||||||
// path: '**',
|
path: '**',
|
||||||
// redirectTo: 'departments',
|
redirectTo: 'departments',
|
||||||
// },
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
>
|
>
|
||||||
<td class="font-medium text-gray-900 whitespace-nowrap sticky left-0">
|
<td class="font-medium text-gray-900 whitespace-nowrap sticky left-0">
|
||||||
<input type="checkbox" class="toggle" formControlName="isUse" />
|
<input type="checkbox" class="toggle" formControlName="isUse" />
|
||||||
<p>{{i}}</p>
|
<p>{{ i }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td class="font-medium text-gray-900 whitespace-nowrap sticky">
|
<td class="font-medium text-gray-900 whitespace-nowrap sticky">
|
||||||
<input
|
<input
|
||||||
|
|
@ -45,25 +45,26 @@
|
||||||
<input type="text" class="input" formControlName="name" />
|
<input type="text" class="input" formControlName="name" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td
|
<td class="font-medium text-gray-900 whitespace-nowrap">
|
||||||
class="font-medium text-gray-900 whitespace-nowrap"
|
|
||||||
*ngIf="
|
|
||||||
displayByCond(i, 'powderGram', 'not-zero', { compare: undefined })
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex justify-center items-center space-x-2 bg-purple-300 rounded-md p-2"
|
class="flex justify-center items-center space-x-2 bg-purple-300 rounded-md p-2"
|
||||||
|
*ngIf="
|
||||||
|
displayByCond(i, 'powderGram', 'not-zero', {
|
||||||
|
compare: undefined
|
||||||
|
}) &&
|
||||||
|
(getTypeForRecipeListAtIndex(i)['category'] == 'powder' ||
|
||||||
|
getTypeForRecipeListAtIndex(i)['category'] == 'bean')
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<p>Volume</p>
|
<p>Volume</p>
|
||||||
<input type="text" class="bg-transparent w-8" formControlName="powderGram" />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="bg-transparent w-8"
|
||||||
|
formControlName="powderGram"
|
||||||
|
/>
|
||||||
<p>gram</p>
|
<p>gram</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
|
||||||
|
|
||||||
<td
|
|
||||||
class="font-medium text-gray-900 whitespace-nowrap"
|
|
||||||
*ngIf="displayByCond(i, 'powderGram', 'zero', { compare: undefined })"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex items-center space-x-2 bg-purple-300 rounded-md p-2"
|
class="flex items-center space-x-2 bg-purple-300 rounded-md p-2"
|
||||||
*ngIf="
|
*ngIf="
|
||||||
|
|
@ -72,37 +73,37 @@
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p>Volume</p>
|
<p>Volume</p>
|
||||||
<input type="text" class="bg-transparent w-8" formControlName="syrupGram" />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="bg-transparent w-8"
|
||||||
|
formControlName="syrupGram"
|
||||||
|
/>
|
||||||
<p>gram</p>
|
<p>gram</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="font-medium text-gray-900 whitespace-nowrap">
|
<td class="font-medium text-gray-900 whitespace-nowrap">
|
||||||
<div class="flex flex-row p-2 space-x-3">
|
<div class="flex flex-row p-2 space-x-3">
|
||||||
<div class="flex items-center justify-center bg-gray-200">
|
<div class="flex items-center justify-center bg-gray-200">
|
||||||
<div class="items-center rounded-md" *ngIf="isStringParamExist(i)">
|
<div
|
||||||
|
class="items-center rounded-md"
|
||||||
|
*ngIf="isStringParamExist(i) && !isMixOrder(i)"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="flex items-center rounded-md tooltip"
|
class="flex items-center rounded-md tooltip"
|
||||||
[attr.data-tip]="param.pkey"
|
[attr.data-tip]="param.pkey"
|
||||||
*ngFor="let param of getStringParamOfIndex(i)"
|
*ngFor="let param of getStringParamOfIndex(i)"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="param.pkey != 'encoder_cnt'">
|
<div *ngIf="param.pkey != 'encoder_cnt'">
|
||||||
<!-- <p> </p> -->
|
<!-- <p> </p> -->
|
||||||
<p *ngIf="param.pkey == 'notail'">tail</p>
|
<p *ngIf="param.pkey == 'notail'">tail</p>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="w-8 bg-transparent"
|
class="w-8 bg-transparent"
|
||||||
placeholder="{{ param.pvalue }}"
|
placeholder="{{ param.pvalue }}"
|
||||||
(click)="openStringParamEditor(i)"
|
(click)="openStringParamEditor(i)"
|
||||||
/>
|
/>
|
||||||
<p *ngIf="param.pkey == 'esp-v2-press-value'">mA</p>
|
<p *ngIf="param.pkey == 'esp-v2-press-value'">mA</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -110,7 +111,9 @@
|
||||||
class="tooltip flex items-center justify-evenly space-x-2 rounded-md bg-red-200 p-2"
|
class="tooltip flex items-center justify-evenly space-x-2 rounded-md bg-red-200 p-2"
|
||||||
data-tip="Hot"
|
data-tip="Hot"
|
||||||
*ngIf="
|
*ngIf="
|
||||||
displayByCond(i, 'waterYield', 'not-zero', { compare: undefined })
|
displayByCond(i, 'waterYield', 'not-zero', {
|
||||||
|
compare: undefined
|
||||||
|
}) && !isMixOrder(i)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p>Hot</p>
|
<p>Hot</p>
|
||||||
|
|
@ -126,7 +129,9 @@
|
||||||
class="tooltip flex items-center justify-center space-x-2 rounded-md bg-blue-200 p-2"
|
class="tooltip flex items-center justify-center space-x-2 rounded-md bg-blue-200 p-2"
|
||||||
data-tip="Cold"
|
data-tip="Cold"
|
||||||
*ngIf="
|
*ngIf="
|
||||||
displayByCond(i, 'waterCold', 'not-zero', { compare: undefined })
|
displayByCond(i, 'waterCold', 'not-zero', {
|
||||||
|
compare: undefined
|
||||||
|
}) && !isMixOrder(i)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p>Cold</p>
|
<p>Cold</p>
|
||||||
|
|
@ -147,10 +152,11 @@
|
||||||
compare: undefined
|
compare: undefined
|
||||||
}) &&
|
}) &&
|
||||||
getTypeForRecipeListAtIndex(i)['category'] != 'cup' &&
|
getTypeForRecipeListAtIndex(i)['category'] != 'cup' &&
|
||||||
!isTopping(getTypeForRecipeListAtIndex(i)['id'])
|
!isTopping(getTypeForRecipeListAtIndex(i)['id']) &&
|
||||||
|
!isMixOrder(i)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p>{{getTooltipForStirTime(getTypeForRecipeListAtIndex(i))}}</p>
|
<p>{{ getTooltipForStirTime(getTypeForRecipeListAtIndex(i)) }}</p>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="bg-transparent w-8"
|
class="bg-transparent w-8"
|
||||||
|
|
@ -158,38 +164,43 @@
|
||||||
/>
|
/>
|
||||||
<p>sec</p>
|
<p>sec</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- feed levels -->
|
<!-- feed levels -->
|
||||||
<div class="flex w-58 rounded-md bg-pink-200 items-center space-x-2 p-2 justify-center" *ngIf="getTooltipForStirTime(getTypeForRecipeListAtIndex(i)) == 'Mix'">
|
<div
|
||||||
|
class="flex w-58 rounded-md bg-pink-200 items-center space-x-2 p-2 justify-center"
|
||||||
|
*ngIf="
|
||||||
|
getTooltipForStirTime(getTypeForRecipeListAtIndex(i)) == 'Mix' &&
|
||||||
|
!isMixOrder(i)
|
||||||
|
"
|
||||||
<p>Style</p>
|
>
|
||||||
<input class="w-4 bg-transparent" formControlName="feedPattern">
|
<p>Style</p>
|
||||||
<p>Level</p>
|
<input class="w-4 bg-transparent" formControlName="feedPattern" />
|
||||||
<input class="w-12 bg-transparent" type="number" formControlName="feedParameter">
|
<p>Level</p>
|
||||||
|
<input
|
||||||
|
class="w-12 bg-transparent"
|
||||||
|
type="number"
|
||||||
|
formControlName="feedParameter"
|
||||||
<div class="flex p-1 space-x-2 bg-green-300 text-center rounded-md" *ngIf="getStringParam(i, 'encoder_cnt') != undefined">
|
/>
|
||||||
|
|
||||||
<p>Encoder </p>
|
|
||||||
<p>{{getStringParam(i, "encoder_cnt")?.pvalue}}</p>
|
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex p-1 space-x-2 bg-green-300 text-center rounded-md"
|
||||||
|
*ngIf="getStringParam(i, 'encoder_cnt') != undefined"
|
||||||
|
>
|
||||||
|
<p>Encoder</p>
|
||||||
|
<p>{{ getStringParam(i, "encoder_cnt")?.pvalue }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse collapse-open" *ngIf="isTopping(getTypeForRecipeListAtIndex(i)['id'])">
|
<div
|
||||||
|
class="collapse collapse-open"
|
||||||
|
*ngIf="isTopping(getTypeForRecipeListAtIndex(i)['id'])"
|
||||||
|
>
|
||||||
<!-- <div class="collapse-title">Topping Settings</div> -->
|
<!-- <div class="collapse-title">Topping Settings</div> -->
|
||||||
<div class="collapse-content">
|
<div class="collapse-content">
|
||||||
<app-recipe-topping
|
<app-recipe-topping
|
||||||
[productCode]="productCode"
|
[productCode]="productCode"
|
||||||
[index]="getToppingSlotNumber(getTypeForRecipeListAtIndex(i)['id'])"
|
[index]="
|
||||||
|
getToppingSlotNumber(getTypeForRecipeListAtIndex(i)['id'])
|
||||||
|
"
|
||||||
(toppingSetChange)="onToppingSetChange($event, i)"
|
(toppingSetChange)="onToppingSetChange($event, i)"
|
||||||
></app-recipe-topping>
|
></app-recipe-topping>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -199,7 +210,6 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<!-- show string param modal -->
|
<!-- show string param modal -->
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
|
@ -378,7 +388,11 @@
|
||||||
|
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<p class="text-base m-4">Level</p>
|
<p class="text-base m-4">Level</p>
|
||||||
<input type="text" class="input w-16" formControlName="feedParameter" />
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input w-16"
|
||||||
|
formControlName="feedParameter"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ export class RecipeListComponent implements OnInit {
|
||||||
|
|
||||||
(await this._materialService.getFullMaterialDetail()).subscribe((materials) => {
|
(await this._materialService.getFullMaterialDetail()).subscribe((materials) => {
|
||||||
this.fullMaterialList = materials;
|
this.fullMaterialList = materials;
|
||||||
this.categoriedMaterial = this.ListCategory();
|
this.categoriedMaterial = this.listCategory();
|
||||||
console.log(this.categoriedMaterial);
|
console.log(this.categoriedMaterial);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -578,7 +578,7 @@ export class RecipeListComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter from full detail by type
|
// Filter from full detail by type
|
||||||
ListCategory = () => {
|
listCategory = () => {
|
||||||
let catMap: { [key: string]: any[] } = {
|
let catMap: { [key: string]: any[] } = {
|
||||||
others: [],
|
others: [],
|
||||||
};
|
};
|
||||||
|
|
@ -629,6 +629,16 @@ export class RecipeListComponent implements OnInit {
|
||||||
|
|
||||||
getToppingSlotNumber = (mat: number) => convertFromInterProductCode(mat) - 8110 - 1 ;
|
getToppingSlotNumber = (mat: number) => convertFromInterProductCode(mat) - 8110 - 1 ;
|
||||||
|
|
||||||
|
// get value at index, if 'MixOrder' exist and is 1, return true
|
||||||
|
isMixOrder = (index: number) => {
|
||||||
|
let mixOrder = this.recipeListData.at(index).get('mixOrder')?.value;
|
||||||
|
// console.log("get::MixOrder", mixOrder, "test get::mixOrder", this.recipeListData.at(index).get('mixOrder'));
|
||||||
|
return mixOrder.toString() == "1" ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------ String Param ------------------
|
||||||
|
|
||||||
isStringParamExist = (i: number) => {
|
isStringParamExist = (i: number) => {
|
||||||
let rawStringParam = this.recipeListData.at(i).get('StringParam')?.value;
|
let rawStringParam = this.recipeListData.at(i).get('StringParam')?.value;
|
||||||
if (rawStringParam) {
|
if (rawStringParam) {
|
||||||
|
|
@ -694,9 +704,15 @@ export class RecipeListComponent implements OnInit {
|
||||||
return stringParamsDefinition[name] || name;
|
return stringParamsDefinition[name] || name;
|
||||||
};
|
};
|
||||||
|
|
||||||
displayByCond = (index: number, key: string, condition: string, compare?: any) =>{
|
|
||||||
|
|
||||||
return conditionTests[condition](this.recipeListData.value[index][key])};
|
// ------------------ Filter ------------------
|
||||||
|
|
||||||
|
displayByCond = (index: number, key: string, condition: any, compare?: any) =>{
|
||||||
|
if(typeof condition == 'function'){
|
||||||
|
return condition(this.recipeListData.value[index][key], compare);
|
||||||
|
}
|
||||||
|
return conditionTests[condition](this.recipeListData.value[index][key])
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// timeout
|
// timeout
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
api: 'http://10.11.77.50:5555',
|
api: 'https://recipe.taobin.io:8090/api',
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue