From 7d7277d4755cfe4aef501e2a56864eb0dcf58004 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 28 Nov 2021 09:56:02 +0100 Subject: [PATCH 01/23] if creation is edited, insert text in form --- admin/src/components/CreationFormular.vue | 9 ++++++--- admin/src/components/UserTable.vue | 16 +++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index 49e10e7bb..a1b913d92 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -73,7 +73,6 @@ :min="rangeMin" :max="rangeMax" step="10" - @load="checkFormForUpdate('range')" > @@ -86,7 +85,6 @@ v-model="text" :state="text.length >= 10" placeholder="Mindestens 10 Zeichen eingeben" - @load="checkFormForUpdate('text')" rows="3" > @@ -159,7 +157,7 @@ export default { data() { return { radioSelected: '', - text: '', + text: !this.creationUserData.note ? '' : this.creationUserData.note, value: 0, rangeMin: 0, rangeMax: 1000, @@ -180,6 +178,7 @@ export default { createdIndex: null, } }, + methods: { // Auswählen eines Zeitraumes updateRadioSelected(name, index, openCreation) { @@ -196,7 +195,10 @@ export default { this.rangeMax = openCreation } }, + /* checkFormForUpdate(input) { + console.log('checkFormForUpdate', input) + console.log('checkFormForUpdate creationUserData', this.creationUserData) switch (input) { case 'text': this.text = this.creationUserData.text @@ -209,6 +211,7 @@ export default { alert("I don't know such values") } }, + */ submitCreation() { // Formular Prüfen ob ein Zeitraum ausgewählt wurde. Ansonsten abbrechen und Hinweis anzeigen if (this.radioSelected === '') { diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index 816d95952..fa0b395a4 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -66,7 +66,7 @@ :pagetype="type" :creation="row.item.creation" :item="row.item" - :creationUserData="creationData" + :creationUserData="creationUserData" @update-creation-data="updateCreationData" @update-user-data="updateUserData" /> @@ -150,7 +150,7 @@ export default { }, data() { return { - creationData: {}, + creationUserData: {}, overlay: false, overlayBookmarkType: '', overlayItem: [], @@ -223,13 +223,13 @@ export default { if (!row.detailsShowing) { alert('offen edit loslegen') // this.item = rowItem - this.creationData = rowItem - // alert(this.creationData) + this.creationUserData = rowItem + console.log('editCreationUserTable creationUserData', this.creationUserData) } row.toggleDetails() }, updateCreationData(data) { - this.creationData = { + this.creationUserData = { ...data, } }, @@ -237,6 +237,12 @@ export default { rowItem.creation = newCreation }, }, + watch: { + creationUserData: function () { + alert('yolo') + console.log(this.creationUserData) + }, + }, }