fix equipment incorrect category bug
This commit is contained in:
parent
1d536309e1
commit
7d6988f581
3 changed files with 28 additions and 10 deletions
|
|
@ -66,7 +66,20 @@ export class MaterialSettingsComponent implements OnInit {
|
|||
this.allMaterials!.forEach((mat) => {
|
||||
let category = getMaterialType(mat.materialId);
|
||||
// try again
|
||||
if (category == 'others') {
|
||||
if(category == 'others' && mat.type.includes("true")){
|
||||
|
||||
// extract type
|
||||
let type = mat.type.split(",");
|
||||
type.forEach((t)=>{
|
||||
let tt = t.split(":");
|
||||
// powder:true -> powder-[0] | true-[1]
|
||||
category = tt[1] == "true" ? tt[0] : category;
|
||||
});
|
||||
|
||||
if(!Object.keys(catMap).includes(category)){
|
||||
catMap[category] = [];
|
||||
}
|
||||
} else if (category == 'others') {
|
||||
// find min
|
||||
// console.log(Math.floor(mat.materialId / 1000) );
|
||||
let interCode = Math.floor(mat.materialId / 10000) * 10000;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
Create Topping
|
||||
</button>
|
||||
<dialog id="topping_builder_modal" class="modal">
|
||||
<div class="modal-box max-w-screen-2xl">
|
||||
<div class="modal-box max-w-screen-2xl m-4">
|
||||
<div class="sticky top-0 z-10 bg-stone-200 rounded-md">
|
||||
<div class="flex items-center justify-start space-x-4">
|
||||
<div class="flex items-center justify-start space-x-4 p-4">
|
||||
<h3 class="text-xl font-bold">Topping Builder</h3>
|
||||
|
||||
<div class="">
|
||||
|
|
@ -15,11 +15,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="modal-action">
|
||||
<form method="dialog">
|
||||
<button class="btn btn-warning">Close</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
|
@ -88,6 +84,12 @@
|
|||
"useGram",
|
||||
"weight_float"
|
||||
] -->
|
||||
|
||||
<div class="modal-action right-0 bottom-0 sticky">
|
||||
<form method="dialog">
|
||||
<button class="btn btn-warning">Close</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
|
|
@ -152,7 +154,7 @@
|
|||
<input class="input input-sm input-bordered" formControlName="Desc" />
|
||||
</td>
|
||||
<!-- <td>{{tpg.idDefault}}</td> -->
|
||||
<div class="tooltip" data-tip="Default select id not in group or does not set" *ngIf="!isDefaultInMember(getAttrFromForm(i, 'groupID'), getAttrFromForm(i, 'idDefault'))">
|
||||
<div class="tooltip tooltip-warning" data-tip="Default select id not in group or does not set" *ngIf="!isDefaultInMember(getAttrFromForm(i, 'groupID'), getAttrFromForm(i, 'idDefault'))">
|
||||
<p class="text-red-500 text-5xl">⚠️</p>
|
||||
</div>
|
||||
<td class="grid grid-flow-row grid-cols-3 rounded-md gap-2">
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ export function inRange(min: number, max: number, value: number) {
|
|||
}
|
||||
|
||||
export function getCategories() {
|
||||
return Object.keys(rangeMaterialMapping);
|
||||
|
||||
let keys = Object.keys(rangeMaterialMapping);
|
||||
keys.push('equipment');
|
||||
return keys;
|
||||
}
|
||||
|
||||
export function getMaterialType(materialId: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue