feat: showing recipe list values
- add displaying for values in recipe list, with some editable fields except topping, string params, feed pattern/level Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
4866674f26
commit
dbb5ce466c
14 changed files with 640 additions and 37 deletions
|
|
@ -8,7 +8,11 @@
|
|||
|
||||
import { columns, type RecipelistMaterial } from './columns';
|
||||
import { get, readable, writable } from 'svelte/store';
|
||||
import { materialFromMachineQuery, materialFromServerQuery } from '$lib/core/stores/recipeStore';
|
||||
import {
|
||||
latestRecipeToppingData,
|
||||
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';
|
||||
|
|
@ -29,18 +33,17 @@
|
|||
let recipeListMatState: RecipelistMaterial[] = $state([]);
|
||||
let recipeListOriginal: RecipelistMaterial[] = $state([]);
|
||||
|
||||
let toppingSlotState: any = $state([]);
|
||||
|
||||
function remappingToColumn(data: any[]): RecipelistMaterial[] {
|
||||
let ret: RecipelistMaterial[] = [];
|
||||
// expect recipelist
|
||||
if (materialSnapshot) {
|
||||
let d_cnt = 0;
|
||||
for (let rpl of data) {
|
||||
let mat =
|
||||
refPage == 'brew'
|
||||
? materialSnapshot.filter(
|
||||
(x: any) => x['id'].toString() === rpl['materialPathId'].toString()
|
||||
)[0]
|
||||
: materialSnapshot[rpl['materialPathId']];
|
||||
let mat = materialSnapshot.filter(
|
||||
(x: any) => x['id'].toString() === rpl['materialPathId'].toString()
|
||||
)[0];
|
||||
|
||||
// console.log('mat filter get', Object(mat), Object.keys(mat));
|
||||
|
||||
|
|
@ -61,9 +64,10 @@
|
|||
values: {
|
||||
string_param: rpl['StringParam'],
|
||||
mix_order: rpl['MixOrder'],
|
||||
stir_time: rpl['stirTime'],
|
||||
feed: {
|
||||
pattern: rpl['feedPattern'],
|
||||
parameter: rpl['feedParameter']
|
||||
pattern: rpl['FeedPattern'],
|
||||
parameter: rpl['FeedParameter']
|
||||
},
|
||||
powder: {
|
||||
gram: rpl['powderGram'],
|
||||
|
|
@ -113,9 +117,11 @@
|
|||
materialSnapshot = get(materialFromMachineQuery);
|
||||
}
|
||||
|
||||
console.log(`detail : ${JSON.stringify(recipeData)}`);
|
||||
|
||||
recipeListMatState = remappingToColumn(recipeData['recipes']);
|
||||
toppingSlotState = recipeData['ToppingSet'];
|
||||
|
||||
latestRecipeToppingData.set(toppingSlotState);
|
||||
|
||||
// save old value\
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue