fixed step editor recipe selection

This commit is contained in:
vabene1111
2025-07-11 20:51:21 +02:00
parent cd11194ce5
commit 7841397b59
2 changed files with 6 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<!-- TODO label is not showing for some reason, for now in placeholder --> <!-- TODO label is not showing for some reason, for now in placeholder -->
<v-label class="mt-2" v-if="props.label" >{{props.label}}</v-label> <v-label class="mt-2" v-if="props.label">{{ props.label }}</v-label>
<v-input :hint="props.hint" persistent-hint :label="props.label" :hide-details="props.hideDetails"> <v-input :hint="props.hint" persistent-hint :label="props.label" :hide-details="props.hideDetails">
<template #prepend v-if="$slots.prepend"> <template #prepend v-if="$slots.prepend">
<slot name="prepend"></slot> <slot name="prepend"></slot>
@@ -18,7 +18,7 @@
:on-create="createObject" :on-create="createObject"
:createOption="props.allowCreate" :createOption="props.allowCreate"
:delay="300" :delay="300"
:object="props.object" :object="true"
:valueProp="itemValue" :valueProp="itemValue"
:label="itemLabel" :label="itemLabel"
:searchable="true" :searchable="true"
@@ -92,7 +92,7 @@ const props = defineProps({
mode: {type: String as PropType<'single' | 'multiple' | 'tags'>, default: 'single'}, mode: {type: String as PropType<'single' | 'multiple' | 'tags'>, default: 'single'},
appendToBody: {type: Boolean, default: false}, appendToBody: {type: Boolean, default: false},
object: {type: Boolean, default: true}, //object: {type: Boolean, default: true}, // TODO broken either fix or finally get other multiselect working
allowCreate: {type: Boolean, default: false}, allowCreate: {type: Boolean, default: false},
placeholder: {type: String, default: undefined}, placeholder: {type: String, default: undefined},
@@ -150,9 +150,7 @@ function search(query: string) {
loading.value = true loading.value = true
return modelClass.value.list({query: query, page: 1, pageSize: props.limit}).then((r: any) => { return modelClass.value.list({query: query, page: 1, pageSize: props.limit}).then((r: any) => {
if (modelClass.value.model.isPaginated) { if (modelClass.value.model.isPaginated) {
if (r.next) { hasMoreItems.value = !!r.next
hasMoreItems.value = true
}
return r.results return r.results
} else { } else {
hasMoreItems.value = false hasMoreItems.value = false

View File

@@ -47,10 +47,10 @@
<v-number-input :label="$t('Time')" v-model="step.time" :min="0" :step="5" control-variant="split"></v-number-input> <v-number-input :label="$t('Time')" v-model="step.time" :min="0" :step="5" control-variant="split"></v-number-input>
</v-col> </v-col>
<v-col cols="12" md="6" v-if="showRecipe || step.stepRecipe != null"> <v-col cols="12" md="6" v-if="showRecipe || step.stepRecipe != null">
<model-select model="Recipe" v-model="step.stepRecipe" :object="false" append-to-body></model-select> <model-select model="Recipe" v-model="step.stepRecipeData" @update:modelValue="step.stepRecipe = (step.stepRecipeData != null) ? step.stepRecipeData.id! : null"></model-select>
</v-col> </v-col>
<v-col cols="12" md="6" v-if="showFile || step.file != null"> <v-col cols="12" md="6" v-if="showFile || step.file != null">
<model-select model="UserFile" v-model="step.file" append-to-body></model-select> <model-select model="UserFile" v-model="step.file"></model-select>
</v-col> </v-col>
</v-row> </v-row>