Upravy UI, refaktoring, davkove upravy a mazani fotek
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<script setup>
|
||||
import {computed, ref} from "vue";
|
||||
import {setDefaultData} from "src/composables/form/formHandling";
|
||||
import DialogWrapper from "components/DialogWrapper.vue";
|
||||
import FormWrapper from "components/FormWrapper.vue";
|
||||
import {commonProps} from "src/composables/inputs";
|
||||
import ComboboxInput from "components/inputs/ComboboxInput.vue";
|
||||
|
||||
const props = defineProps({
|
||||
photo: {
|
||||
type: Object
|
||||
},
|
||||
locations: {
|
||||
type: Array
|
||||
}
|
||||
});
|
||||
|
||||
const photoId = computed(() => props.photo?.id || null);
|
||||
const formData = ref({
|
||||
name: "",
|
||||
description: "",
|
||||
pointOfInterest: null,
|
||||
isFlightCover: false
|
||||
});
|
||||
|
||||
const setup = (() => {
|
||||
setDefaultData(formData.value, props.photo || {});
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DialogWrapper :formData="formData" :object-id="photoId" @show="setup">
|
||||
{{ formData }}
|
||||
<q-img :src="photo.thumbnailUrl"/>
|
||||
|
||||
<q-card-section>
|
||||
<FormWrapper :save-button="false">
|
||||
<q-input v-model="formData.name" label="Název" v-bind="commonProps"/>
|
||||
<q-input type="textarea" v-model="formData.description" label="Popis" v-bind="commonProps"/>
|
||||
|
||||
<ComboboxInput
|
||||
:options="locations"
|
||||
v-bind="commonProps"
|
||||
v-model="formData.pointOfInterest"
|
||||
label="POI"
|
||||
/>
|
||||
|
||||
<q-checkbox v-model="formData.isFlightCover" label="Úvodní fotografie k letu?"/>
|
||||
</FormWrapper>
|
||||
</q-card-section>
|
||||
</DialogWrapper>
|
||||
</template>
|
||||
Reference in New Issue
Block a user