parent
7075f4a664
commit
29a1a82cfb
12 changed files with 344 additions and 203 deletions
|
|
@ -8,14 +8,18 @@
|
|||
|
||||
import { columns, type RecipelistMaterial } from './columns';
|
||||
import { get, readable, writable } from 'svelte/store';
|
||||
import { materialFromMachineQuery } from '$lib/core/stores/recipeStore';
|
||||
import { materialFromMachineQuery, materialFromServerQuery } from '$lib/core/stores/recipeStore';
|
||||
import { generateIcing } from '$lib/helpers/icingGen';
|
||||
import { machineInfoStore } from '$lib/core/stores/machineInfoStore';
|
||||
import MachineInfo from '../machine-info.svelte';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
//
|
||||
let { recipeData, onPendingChange }: { recipeData: any; onPendingChange: any } = $props();
|
||||
let {
|
||||
recipeData,
|
||||
onPendingChange,
|
||||
refPage
|
||||
}: { recipeData: any; onPendingChange: any; refPage: string } = $props();
|
||||
|
||||
let menuName: string = $state('');
|
||||
|
||||
|
|
@ -31,9 +35,12 @@
|
|||
if (materialSnapshot) {
|
||||
let d_cnt = 0;
|
||||
for (let rpl of data) {
|
||||
let mat = materialSnapshot.filter(
|
||||
(x: any) => x['id'].toString() === rpl['materialPathId'].toString()
|
||||
)[0];
|
||||
let mat =
|
||||
refPage == 'brew'
|
||||
? materialSnapshot.filter(
|
||||
(x: any) => x['id'].toString() === rpl['materialPathId'].toString()
|
||||
)[0]
|
||||
: materialSnapshot[rpl['materialPathId']];
|
||||
|
||||
// console.log('mat filter get', Object(mat), Object.keys(mat));
|
||||
|
||||
|
|
@ -99,7 +106,14 @@
|
|||
if (recipeData) {
|
||||
menuName =
|
||||
recipeData['name'] ?? (recipeData['otherName'] ? recipeData['otherName'] : 'Not set');
|
||||
materialSnapshot = get(materialFromMachineQuery);
|
||||
|
||||
if (refPage == 'overview') {
|
||||
materialSnapshot = get(materialFromServerQuery);
|
||||
} else if (refPage == 'brew') {
|
||||
materialSnapshot = get(materialFromMachineQuery);
|
||||
}
|
||||
|
||||
console.log(`detail : ${JSON.stringify(recipeData)}`);
|
||||
|
||||
recipeListMatState = remappingToColumn(recipeData['recipes']);
|
||||
// save old value\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue