-
-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recipe editor in model editor system basics
- Loading branch information
1 parent
ab9f970
commit 49c8a5a
Showing
35 changed files
with
275 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<template> | ||
<model-editor-base | ||
:loading="loading" | ||
:dialog="dialog" | ||
@save="saveObject" | ||
@delete="deleteObject" | ||
@close="emit('close')" | ||
:is-update="isUpdate()" | ||
:model-class="modelClass" | ||
:object-name="editingObjName()"> | ||
|
||
<v-tabs v-model="tab" :disabled="loading" grow> | ||
<v-tab value="recipe">{{ $t('Recipe') }}</v-tab> | ||
<v-tab value="steps">{{ $t('Steps') }}</v-tab> | ||
<v-tab value="settings">{{ $t('Settings') }}</v-tab> | ||
|
||
</v-tabs> | ||
|
||
<v-card-text> | ||
<v-tabs-window v-model="tab"> | ||
<v-tabs-window-item value="recipe"> | ||
<v-form :disabled="loading"> | ||
<v-text-field :label="$t('Name')" v-model="editingObj.name"></v-text-field> | ||
<v-textarea :label="$t('Description')" v-model="editingObj.description" clearable counter="512"></v-textarea> | ||
|
||
<v-label>{{ $t('Keywords') }}</v-label> | ||
<ModelSelect mode="tags" v-model="editingObj.keywords" model="Keyword"></ModelSelect> | ||
<v-row> | ||
<v-col cols="12" md="6"> | ||
<v-text-field :label="$t('WaitingTime')" v-model="editingObj.waitingTime"></v-text-field> | ||
</v-col> | ||
<v-col cols="12" md="6"> | ||
<v-text-field :label="$t('WorkingTime')" v-model="editingObj.workingTime"></v-text-field> | ||
</v-col> | ||
<v-col cols="12" md="6"> | ||
<v-text-field :label="$t('Servings')" v-model="editingObj.servings"></v-text-field> | ||
</v-col> | ||
<v-col cols="12" md="6"> | ||
<v-text-field :label="$t('ServingsText')" v-model="editingObj.servingsText"></v-text-field> | ||
</v-col> | ||
</v-row> | ||
|
||
</v-form> | ||
</v-tabs-window-item> | ||
<v-tabs-window-item value="steps"> | ||
<v-form :disabled="loading"> | ||
|
||
|
||
</v-form> | ||
</v-tabs-window-item> | ||
<v-tabs-window-item value="settings"> | ||
<v-form :disabled="loading"> | ||
|
||
|
||
</v-form> | ||
</v-tabs-window-item> | ||
</v-tabs-window> | ||
</v-card-text> | ||
</model-editor-base> | ||
|
||
</template> | ||
|
||
<script setup lang="ts"> | ||
import {onMounted, PropType, ref} from "vue"; | ||
import {Recipe} from "@/openapi"; | ||
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue"; | ||
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions"; | ||
import {useI18n} from "vue-i18n"; | ||
import ModelSelect from "@/components/inputs/ModelSelect.vue"; | ||
const {t} = useI18n() | ||
const props = defineProps({ | ||
item: {type: {} as PropType<Recipe>, required: false, default: null}, | ||
itemId: {type: [Number, String], required: false, default: undefined}, | ||
dialog: {type: Boolean, default: false} | ||
}) | ||
const emit = defineEmits(['create', 'save', 'delete', 'close']) | ||
const {setupState, deleteObject, saveObject, isUpdate, editingObjName, loading, editingObj, modelClass} = useModelEditorFunctions<Recipe>('Recipe', emit) | ||
// object specific data (for selects/display) | ||
const tab = ref("recipe") | ||
onMounted(() => { | ||
setupState(props.item, props.itemId) | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.