From 7de7546371d7ddd8dbedcf41caa9adc296bcd256 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 29 May 2023 11:22:40 +0200 Subject: [PATCH] finished seats of seatplan editor --- .../components/seatplan/editor/properties.vue | 74 ++++++++---- .../src/components/seatplan/editor/window.vue | 26 +++-- .../seatplanComponents/seats/circular.vue | 6 +- .../seatplanComponents/seats/rectangular.vue | 101 ++++++++++++++++ .../seatplanComponents/seats/trapezoid.vue | 108 ++++++++++++++++++ 5 files changed, 274 insertions(+), 41 deletions(-) diff --git a/src/webapp/src/components/seatplan/editor/properties.vue b/src/webapp/src/components/seatplan/editor/properties.vue index 822a948..3bad54e 100644 --- a/src/webapp/src/components/seatplan/editor/properties.vue +++ b/src/webapp/src/components/seatplan/editor/properties.vue @@ -10,33 +10,51 @@ @@ -44,38 +62,44 @@ export default { name: 'propertiesSeatplan', props: { - posSize: { + draggables: { type: Object, - "default": { 'x': 100, 'y': 100, 'w': 200, 'h': 100, 'origin': 1 } + "default": {} }, scaleFactor: { type: Number, "default": 1, }, + active: { + type: Number, + "default": 1, + }, }, data () { return { - isEditing: { 'w':false }, - internal: { 'x': 100, 'y': 100, 'w': 200, 'h': 100 }, + internal: {}, } }, methods: { - activateEditing ( option ) { - this.isEditing[ option ] = true; - for ( let value in this.posSize ) { - this.internal[ value ] = this.posSize[ value ]; + loadInternal () { + for ( let value in this.draggables ) { + this.internal[ value ] = this.draggables[ value ]; } }, - resubmit ( option ) { - console.log( 'ok' ); - this.isEditing[ option ] = false; - this.$emit( 'updated', this.internal ) + resubmit () { + this.$emit( 'updated', this.internal ); } }, watch: { - posSize() { - console.log( 'posSize changed' ); + draggables ( value ) { + this.loadInternal(); + }, + active ( value ) { + this.loadInternal(); } + }, + created () { + this.loadInternal(); } } diff --git a/src/webapp/src/components/seatplan/editor/window.vue b/src/webapp/src/components/seatplan/editor/window.vue index 7364133..a469a42 100644 --- a/src/webapp/src/components/seatplan/editor/window.vue +++ b/src/webapp/src/components/seatplan/editor/window.vue @@ -9,13 +9,15 @@