Neue Büchereintragen Seite
This commit is contained in:
parent
01bb983492
commit
76f83cbae9
@ -86,6 +86,9 @@
|
||||
clear-icon="tabler-x"
|
||||
/>
|
||||
</VCol>
|
||||
|
||||
|
||||
<!-- SUCHEN BUTTON: Erscheint sobald was eigegeben wurde in die Felder Title/ISBN-->
|
||||
<VCol
|
||||
v-show="showButton"
|
||||
cols="12"
|
||||
@ -102,17 +105,29 @@
|
||||
</VCol>
|
||||
|
||||
|
||||
|
||||
<VCol
|
||||
v-show="displayedBooks"
|
||||
cols="12"
|
||||
>
|
||||
<div v-if="book">
|
||||
Buchtitel: {{ book.title }}
|
||||
<br>
|
||||
Untertitel: {{ book.subtitle }}
|
||||
</div>
|
||||
|
||||
<div style="color: red">
|
||||
Buch wurde nicht gefunden? Jetzt
|
||||
<VBtn
|
||||
variant="text"
|
||||
color="error"
|
||||
@click="displayedEnterBooks"
|
||||
>
|
||||
Wurde dein Buch nicht gefunden? Dann trage es jetzt ein!
|
||||
eintragen
|
||||
</VBtn>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VCardText>
|
||||
@ -121,7 +136,213 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- FROMULAR: BUCH EINTRAGEN -->
|
||||
<VCard
|
||||
v-if="book"
|
||||
v-show="showEnterBooks"
|
||||
class="mb-6"
|
||||
title="Trage dein Buch jetzt ein:"
|
||||
subtitle="Alle mit * gekennzeichneten Felder sind Pflichtfelder!"
|
||||
>
|
||||
<VCardText>
|
||||
<!-- Fieberkurve* -->
|
||||
<!-- <VCol cols="12">
|
||||
<AppTextField
|
||||
label="Fieberkurve* eingeben:"
|
||||
placeholder="Fieberkurve"
|
||||
/>
|
||||
</VCol>-->
|
||||
<!-- Fieberkurve -->
|
||||
<Fieberkurve :show-reset-button="false" :show-categories="true" class="my-4" />
|
||||
|
||||
<VRow>
|
||||
<!-- Titel* -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
v-if="book"
|
||||
v-model="book.title"
|
||||
label="Titel eingeben:"
|
||||
placeholder="Harry Potter und der Stein der Weisen"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- ISBN* -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
id="isbnInput"
|
||||
v-if="book"
|
||||
v-model="book.isbn"
|
||||
type="number"
|
||||
label="ISBN* eingeben:"
|
||||
placeholder="978-3-551-55167-7"
|
||||
clearable
|
||||
clear-icon="tabler-x"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Untertitel -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Untertitel eingeben:"
|
||||
placeholder=" "
|
||||
v-if="book"
|
||||
v-model="book.subtitle"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Genre* -> 1:n -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<!-- ToDo: Hier muss noch Anton die Gerne einfügen-->
|
||||
<AppCombobox
|
||||
v-if="book"
|
||||
v-model="book.genres"
|
||||
chips
|
||||
clearable
|
||||
multiple
|
||||
closable-chips
|
||||
clear-icon="tabler-circle-x"
|
||||
:items="genreItems"
|
||||
label="Genre/s* wählen:"
|
||||
prepend-icon="tabler-filter"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Autor/en* -> 1:n -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Autor/en* eingeben:"
|
||||
placeholder="J.K. Rowling"
|
||||
v-if="book"
|
||||
v-model="book.authors[0].name"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Verlag/e* -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Verlag/e* eingeben:"
|
||||
placeholder="Carlsen Verlag"
|
||||
v-if="book"
|
||||
v-model="book.publishers"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Sprache* -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Sprache* eingeben:"
|
||||
placeholder="Deutsch"
|
||||
v-if="book"
|
||||
v-model="book.language"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Seitenanzahl -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Seitenanzahl eingeben:"
|
||||
suffix="Seiten"
|
||||
type="number"
|
||||
placeholder="336"
|
||||
v-if="book"
|
||||
v-model="book.pageCount"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Erscheinungsdatum -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
label="Erscheinungsdatum eingeben:"
|
||||
placeholder="26. Juni 1998"
|
||||
v-if="book"
|
||||
v-model="book.publishedDate"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Format* -> Taschenbuch, Hardcover, E-Book, etc. -->
|
||||
<VCol
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
|
||||
<!-- ToDo: Hier muss noch Anton die Buch Format einfügen-->
|
||||
<AppTextField
|
||||
label="Format* eingeben:"
|
||||
placeholder="Taschenbuch"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Kurzbeschreibung* -->
|
||||
<VCol cols="12">
|
||||
<span class="mb-1">Kurzbeschreibung*</span>
|
||||
<ProductDescriptionEditor
|
||||
placeholder="Der elfjährige Harry Potter,
|
||||
der bei seinem gehässigen Onkel Vernon, seiner Tante Petunia und seinem Cousin Dudley lebt, erfährt an seinem elften Geburtstag, dass er ein Zauberer ist. Er erhält einen Platz auf der Schule für Hexerei und Zauberei Hogwarts, wo er neue Freunde findet und in die Geheimnisse der Zauberwelt eintaucht."
|
||||
class="border rounded"
|
||||
v-if="book"
|
||||
v-model="book.blurb"
|
||||
/>
|
||||
</VCol>
|
||||
<!-- Cover/Umschlagbild* -->
|
||||
<VCol cols="12">
|
||||
<!-- 👉 Cover -->
|
||||
<!--
|
||||
<VCardItem>
|
||||
<template #title>
|
||||
Buchcover hochladen
|
||||
</template>
|
||||
</VCardItem>
|
||||
-->
|
||||
<DropZone />
|
||||
</VCol>
|
||||
|
||||
|
||||
<VCol cols="12">
|
||||
<div class="demo-space-x">
|
||||
<VBtn color="success">
|
||||
Buch eintragen
|
||||
<VIcon
|
||||
end
|
||||
icon="tabler-device-floppy"
|
||||
/>
|
||||
</VBtn>
|
||||
<VBtn color="error">
|
||||
Löschen
|
||||
<VIcon
|
||||
end
|
||||
icon="tabler-x"
|
||||
/>
|
||||
</VBtn>
|
||||
</div>
|
||||
</VCol>
|
||||
</VRow>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
|
||||
|
||||
|
||||
<!-- FROMULAR 2: BUCH EINTRAGEN - kein Buch gefunden -->
|
||||
<VCard
|
||||
v-else
|
||||
v-show="showEnterBooks"
|
||||
class="mb-6"
|
||||
title="Trage dein Buch jetzt ein:"
|
||||
@ -177,8 +398,8 @@
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
<!-- ToDo: Hier muss noch Anton die Gerne einfügen-->
|
||||
<AppCombobox
|
||||
v-model="genreChips"
|
||||
chips
|
||||
clearable
|
||||
multiple
|
||||
@ -225,7 +446,6 @@
|
||||
md="6"
|
||||
>
|
||||
<AppTextField
|
||||
v-model="seitenanzahl"
|
||||
label="Seitenanzahl eingeben:"
|
||||
suffix="Seiten"
|
||||
type="number"
|
||||
@ -247,6 +467,8 @@
|
||||
cols="12"
|
||||
md="6"
|
||||
>
|
||||
|
||||
<!-- ToDo: Hier muss noch Anton die Buch Format einfügen-->
|
||||
<AppTextField
|
||||
label="Format* eingeben:"
|
||||
placeholder="Taschenbuch"
|
||||
@ -296,6 +518,9 @@ der bei seinem gehässigen Onkel Vernon, seiner Tante Petunia und seinem Cousin
|
||||
</VRow>
|
||||
</VCardText>
|
||||
</VCard>
|
||||
|
||||
|
||||
|
||||
</VCol>
|
||||
</VRow>
|
||||
</template>
|
||||
@ -305,6 +530,7 @@ import { ref, watch } from 'vue'
|
||||
import AppTextField from "@core/components/app-form-elements/AppTextField.vue"
|
||||
import DropZone from "@core/components/DropZone.vue"
|
||||
import AppCombobox from "@core/components/app-form-elements/AppCombobox.vue"
|
||||
import BookService from "@/pages/BookService.js";
|
||||
|
||||
const inputValueTitle = ref('')
|
||||
const inputValueISBN = ref('')
|
||||
@ -325,8 +551,25 @@ watch(inputValueISBN, newValue => {
|
||||
}
|
||||
})
|
||||
|
||||
let book = ref(null)
|
||||
function searchForISBN() {
|
||||
// const isbn = '9783898798822'
|
||||
// const isbn = inputValueISBN
|
||||
|
||||
BookService.getBookByIsbn(inputValueISBN.value)
|
||||
.then(response => {
|
||||
// book = response.data
|
||||
console.log("response", response)
|
||||
book.value = response
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error)
|
||||
})
|
||||
}
|
||||
|
||||
function displayBook() {
|
||||
displayedBooks.value = true
|
||||
searchForISBN()
|
||||
}
|
||||
|
||||
//////////////////
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user