From d7db00173c92ef1bd3412836a247139f9db24a6f Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Wed, 16 Aug 2023 14:06:59 +0200 Subject: [PATCH] more and more --- src/components/AreaControlCard.vue | 99 +++------------- .../irrigation/irrigationAreaConfCard.vue | 30 +++-- .../irrigation/irrigationAreaConfLine.vue | 66 +++-------- .../irrigation/irrigationEventCard.vue | 91 +++++++++++---- src/stores/configSelect.js | 2 +- src/views/IrrigationView.vue | 2 +- src/views/QuickAreaControlView.vue | 7 +- src/views/irrigationEventView.vue | 109 ++++++++++++++---- 8 files changed, 211 insertions(+), 195 deletions(-) diff --git a/src/components/AreaControlCard.vue b/src/components/AreaControlCard.vue index 81e6781..2510026 100644 --- a/src/components/AreaControlCard.vue +++ b/src/components/AreaControlCard.vue @@ -4,7 +4,7 @@ import { reactive, onBeforeUnmount, ref } from 'vue' const props = defineProps(['areaId']) const api = new IrrigationApi() -let minutesSlider = ref(17) +let minutesSlider = ref(20) let updateInterval let area = reactive({ @@ -65,95 +65,28 @@ onBeforeUnmount(() => { - diff --git a/src/components/irrigation/irrigationAreaConfCard.vue b/src/components/irrigation/irrigationAreaConfCard.vue index 6d8ffee..bb01573 100644 --- a/src/components/irrigation/irrigationAreaConfCard.vue +++ b/src/components/irrigation/irrigationAreaConfCard.vue @@ -15,19 +15,24 @@
- -
- +
-

Konfigurationen

- +
+

Konfigurationen

+ +
+
@@ -38,6 +43,8 @@ import IrrigationApi from '../../helper/irrigationApi'; import IrrigationAreaConfLine from './irrigationAreaConfLine.vue'; import { reactive, ref } from 'vue'; +import { useRouter } from 'vue-router' +import { areaConfigSelect } from '../../stores/configSelect.js'; const area = reactive({ name: "", @@ -50,6 +57,8 @@ const props = defineProps(['areaId']); const emit = defineEmits(["areaDeleted"]); const api = new IrrigationApi(); const changed = ref(false); +const store = areaConfigSelect(); +const router = useRouter(); api.getArea(props.areaId, (data) => { area.name = data.name; @@ -65,7 +74,6 @@ api.getValves((data) => { }); function sthChanged() { - console.log(area.valveId) changed.value = true; } @@ -95,4 +103,10 @@ function confDeleted(id) { } } +function addAreaConf() { + store.$state.areaId = props.areaId; + store.$state.areaConf = 'new'; + router.push('/irrigationEventView'); +} + diff --git a/src/components/irrigation/irrigationAreaConfLine.vue b/src/components/irrigation/irrigationAreaConfLine.vue index c966a2f..b1b8736 100644 --- a/src/components/irrigation/irrigationAreaConfLine.vue +++ b/src/components/irrigation/irrigationAreaConfLine.vue @@ -1,12 +1,16 @@