Upravy UI, refaktoring, davkove upravy a mazani fotek
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<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({
|
||||
photos: {
|
||||
type: Array
|
||||
},
|
||||
locations: {
|
||||
type: Array
|
||||
}
|
||||
});
|
||||
|
||||
const formData = ref({
|
||||
name: "",
|
||||
description: "",
|
||||
pointOfInterest: null,
|
||||
photoIds: []
|
||||
});
|
||||
|
||||
const setup = () => {
|
||||
formData.value.photoIds = props.photos.map(p => p.id);
|
||||
formData.value.name = "";
|
||||
formData.value.description = "";
|
||||
formData.value.pointOfInterest = null;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DialogWrapper :formData="formData" @show="setup()">
|
||||
<q-card-section class="text-center">
|
||||
<!-- <q-scroll-area style="min-height: 80px; max-height: 150px">-->
|
||||
<q-img :src="photo.thumbnailUrl" width="80px" class="q-ma-sm" v-for="photo in photos" :key="photo.thumbnailUrl"/>
|
||||
<!-- {{ photos }}-->
|
||||
<!-- </q-scroll-area>-->
|
||||
</q-card-section>
|
||||
<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"
|
||||
:enable-new-values="false"
|
||||
label="POI"
|
||||
/>
|
||||
</FormWrapper>
|
||||
</q-card-section>
|
||||
</DialogWrapper>
|
||||
</template>
|
||||
Reference in New Issue
Block a user