Skip to content

Commit

Permalink
Feat/dave 112 edit messstelle (#35)
Browse files Browse the repository at this point in the history
* demodaten angepasst

* tooltip messstelle angepasst

* Testdatenangepasst

* messstelle tooltip angepasst

* working draft

* working draft

* cleanup

* cleanup2

* Sprint 3  (#32)

* Feat/dave 118 anpassungen tooltip und marker (#28)

* demodaten angepasst

* tooltip messstelle angepasst

* Testdatenangepasst

* messstelle tooltip angepasst

* name entfernt und durch id ersetzt, (#30)

* testdaten angepasst (#31)

* Feature/dave 150 zurueckspringen karte (#29)

* 🚧 koordinaten werden als query string in url gespeichert und ausgelesen

* 🚧 aktuelle position wird auch für messstellen gespeichert

* center wert wird an map übergeben

* 🎨

---------

Co-authored-by: DanielOber <145556033+DanielOber@users.noreply.github.com>
Co-authored-by: VJ <145964798+vjohnslhm@users.noreply.github.com>

* edit messstelle angefangen

* merged from sprint

* Revert "merged from sprint"

This reverts commit f9dc47b.

* removed unused attr.

* removed unused attr.

* umgestellt auf composition api

* review comments implemented

* docu

* if-else reorganized

* add Todo

* edit Messstelle implementiert, Messquerschnitt vorbereitet

* edit Messquerschnitt implementiert

* Layout angepasst

* Tooltip angepasst

* Sprint 4 (#34)

* Feat/dave 118 anpassungen tooltip und marker (#28)

* demodaten angepasst

* tooltip messstelle angepasst

* Testdatenangepasst

* messstelle tooltip angepasst

* name entfernt und durch id ersetzt, (#30)

* testdaten angepasst (#31)

* Feature/dave 150 zurueckspringen karte (#29)

* 🚧 koordinaten werden als query string in url gespeichert und ausgelesen

* 🚧 aktuelle position wird auch für messstellen gespeichert

* center wert wird an map übergeben

* 🎨

* Feat/dave 128 suche detektordaten adminportal (#33)

* 🐛 no-console rule wieder aktiviert (#23)

---------

Co-authored-by: DanielOber <145556033+DanielOber@users.noreply.github.com>
Co-authored-by: VJ <145964798+vjohnslhm@users.noreply.github.com>
Co-authored-by: martind260 <99957516+martind260@users.noreply.github.com>
Co-authored-by: alexander.kerscher <alexander.kerscher@muenchen.de>

* Anmerkungen umgesetzt

---------

Co-authored-by: DanielOber <145556033+DanielOber@users.noreply.github.com>
Co-authored-by: martin.dietrich <martin.dietrich@muenchen.de>
Co-authored-by: Bianca <150359703+BiancaBriller@users.noreply.github.com>
Co-authored-by: VJ <145964798+vjohnslhm@users.noreply.github.com>
Co-authored-by: martind260 <99957516+martind260@users.noreply.github.com>
  • Loading branch information
6 people committed Jan 15, 2024
1 parent 8db1fed commit 5660378
Show file tree
Hide file tree
Showing 17 changed files with 768 additions and 125 deletions.
6 changes: 5 additions & 1 deletion frontend/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ declare module '@vue/runtime-core' {
KnotenLageForm: typeof import('./src/components/zaehlung/form/KnotenLageForm.vue')['default']
KontaktForm: typeof import('./src/components/zaehlung/form/KontaktForm.vue')['default']
LhmTextField: typeof import('./src/components/common/LhmTextField.vue')['default']
MessstelleInfo: typeof import('./src/components/MessstelleInfo.vue')['default']
MessquerschnittForm: typeof import('./src/components/messstelle/MessquerschnittForm.vue')['default']
MessstelleForm: typeof import('./src/components/messstelle/MessstelleForm.vue')['default']
MessstelleInfo: typeof import('./src/components/messstelle/MessstelleInfo.vue')['default']
MiniMap: typeof import('./src/components/map/MiniMap.vue')['default']
OpenZaehlungPanel: typeof import('./src/components/zaehlung/OpenZaehlungPanel.vue')['default']
QuelleIcon: typeof import('./src/components/icons/QuelleIcon.vue')['default']
Expand All @@ -46,6 +48,8 @@ declare module '@vue/runtime-core' {
TheSnackbar: typeof import('./src/components/common/TheSnackbar.vue')['default']
TooltipWithIcon: typeof import('./src/components/icons/TooltipWithIcon.vue')['default']
UnreadMessages: typeof import('./src/components/app/UnreadMessages.vue')['default']
UpdateMessstelleDialog: typeof import('./src/components/messstelle/UpdateMessstelleDialog.vue')['default']
UpdateMessstelleDialogForm: typeof import('./src/components/messstelle/UpdateMessstelleDialogForm.vue')['default']
UpdateZaehlstelleDialog: typeof import('./src/components/zaehlstelle/UpdateZaehlstelleDialog.vue')['default']
UpdateZaehlstelleForm: typeof import('./src/components/zaehlstelle/UpdateZaehlstelleForm.vue')['default']
VApp: typeof import('vuetify/lib')['VApp']
Expand Down
86 changes: 26 additions & 60 deletions frontend/src/api/service/MessstelleService.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,30 @@
import MessstelleDTO from "@/domain/dto/MessstelleDTO";
import MessstelleEditDTO from "@/domain/dto/messstelle/MessstelleEditDTO";
import FetchService from "@/api/service/FetchService";
import BackendIdDTO from "@/domain/dto/bearbeiten/BackendIdDTO";
import MessstelleInfoDTO from "@/domain/dto/messstelle/MessstelleInfoDTO";

export default class MessstelleService {
static getMessstelleById(id: string): MessstelleDTO {
switch (id) {
case "randomID":
return {
createdTime: "heute",
entityVersion: 0,
id: "randomID",
mstId: "MSTID1",
name: "Messstelle 1",
stadtbezirkNummer: 13,
lat: 48.1887227,
lng: 11.4290655,
customSuchwoerter: ["suchwort1", "suchwort2"],
kommentar: "string",
sichtbarDatenportal: true,
};
case "randomID2":
return {
createdTime: "heute",
entityVersion: 0,
mstId: "MSTID2",
id: "randomID2",
name: "Messstelle 2",
stadtbezirkNummer: 13,
lat: 48.1316995,
lng: 11.6227731,
customSuchwoerter: ["suchwort1", "suchwort2"],
kommentar: "string",
sichtbarDatenportal: true,
};
case "randomID3":
return {
createdTime: "heute",
entityVersion: 0,
id: "randomID3",
mstId: "MSTID3",
name: "Messstelle 3",
stadtbezirkNummer: 13,
lat: 48.1315995,
lng: 11.6217731,
customSuchwoerter: ["suchwort1", "suchwort2"],
kommentar: "string",
sichtbarDatenportal: true,
};
default:
return {
createdTime: "error",
entityVersion: 0,
id: "error",
mstId: "error",
name: "error",
stadtbezirkNummer: 13,
lat: 48.1315995,
lng: 11.6217731,
customSuchwoerter: ["error", "error2"],
kommentar: "error",
sichtbarDatenportal: true,
};
}
private static readonly ENDPOINT: string =
"api/dave-backend-service/messstelle";
static getMessstelleInfo(id: string): Promise<MessstelleInfoDTO> {
return FetchService.getData(
`${this.ENDPOINT}/info?id=${id}`,
"Beim Laden der Messstellen-Info ist ein Fehler aufgetreten."
);
}

static getMessstelleToEdit(id: string): Promise<MessstelleEditDTO> {
return FetchService.getData(
`${this.ENDPOINT}/edit?id=${id}`,
"Beim Laden der Messstellen ist ein Fehler aufgetreten."
);
}

static saveMessstelle(data: MessstelleEditDTO): Promise<BackendIdDTO> {
return FetchService.patchData(
data,
`${this.ENDPOINT}/update`,
"Beim Aktualisieren der Daten ist ein Fehler aufgetreten. Bitte Daten kontrollieren."
);
}
}
27 changes: 0 additions & 27 deletions frontend/src/components/MessstelleInfo.vue

This file was deleted.

11 changes: 6 additions & 5 deletions frontend/src/components/map/ZaehlstelleMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ import markerIconDiamondViolet from "@/assets/cards-diamond-violet.png";
import markerIconDiamondRed from "@/assets/cards-diamond-red.png";
import TooltipMessstelleDTO from "@/domain/dto/TooltipMessstelleDTO";
import AnzeigeKarteDTO from "@/domain/dto/AnzeigeKarteDTO";
import MessstelleKarteDTO from "@/domain/dto/MessstelleKarteDTO";
import MessstelleKarteDTO from "@/domain/dto/messstelle/MessstelleKarteDTO";
/* eslint-enable no-unused-vars */
@Component({
Expand Down Expand Up @@ -490,7 +490,11 @@ export default class ZaehlstelleMap extends Vue {
}
let tooltip = "<div><b>";
if (tooltipDto.mstId) {
tooltip = `${tooltip}Messstelle: ${tooltipDto.mstId}</b><br/>`;
tooltip = `${tooltip}Messstelle: ${tooltipDto.mstId}`;
if (tooltipDto.detektierteVerkehrsarten) {
tooltip = `${tooltip} (${tooltipDto.detektierteVerkehrsarten})`;
}
tooltip = `${tooltip}</b><br/>`;
}
if (tooltipDto.standort) {
tooltip = `${tooltip}${tooltipDto.standort}<br/>`;
Expand All @@ -511,9 +515,6 @@ export default class ZaehlstelleMap extends Vue {
if (tooltipDto.abbaudatum) {
tooltip = `${tooltip}Abbau: ${tooltipDto.abbaudatum}<br/>`;
}
if (tooltipDto.detektierteVerkehrsarten) {
tooltip = `${tooltip}Verkehrsarten: ${tooltipDto.detektierteVerkehrsarten}<br/>`;
}
if (tooltipDto.datumLetztePlausibleMessung) {
tooltip = `${tooltip}Letzte plausible Messung: ${tooltipDto.datumLetztePlausibleMessung}<br/>`;
}
Expand Down
141 changes: 141 additions & 0 deletions frontend/src/components/messstelle/MessquerschnittForm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<template>
<v-sheet
width="100%"
:height="height"
:max-height="height"
class="overflow-y-auto"
>
<v-card-text>
<v-form>
<v-row dense>
<v-col
cols="12"
md="4"
>
<v-autocomplete
v-model="selectedMessquerschnitt"
outlined
:items="editMessstelle.messquerschnitte"
item-text="mqId"
return-object
dense
label="ID Messquerschnitt"
></v-autocomplete>
</v-col>
<v-spacer />
</v-row>
<v-row dense>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="selectedMessquerschnitt.strassenname"
caption="Straßenname"
/>
</v-col>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="selectedMessquerschnitt.fahrtrichtung"
caption="Fahrtrichtung"
/>
</v-col>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="selectedMessquerschnitt.fahrzeugKlassen"
caption="FZ-Klassen"
/>
</v-col>
</v-row>
<v-row dense>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="selectedMessquerschnitt.lageMessquerschnitt"
caption="Lage"
/>
</v-col>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="`${selectedMessquerschnitt.anzahlFahrspuren}`"
caption="Anzahl Fahrstreifen"
/>
</v-col>
<v-col
cols="12"
md="4"
>
<lhm-text-field
:text="`${selectedMessquerschnitt.anzahlDetektoren}`"
caption="Anzahl Detektoren"
/>
</v-col>
</v-row>
<v-row dense>
<v-col
cols="12"
md="12"
>
<v-textarea
v-model="selectedMessquerschnitt.standort"
label="Standort MQ"
outlined
dense
rows="2"
row-height="10"
counter="255"
maxlength="255"
></v-textarea>
</v-col>
</v-row>
</v-form>
</v-card-text>
</v-sheet>
</template>

<script setup lang="ts">
import { computed, ComputedRef, ref, Ref } from "vue";
/* eslint-disable no-unused-vars */
import MessstelleEditDTO from "@/domain/dto/messstelle/MessstelleEditDTO";
import LhmTextField from "@/components/common/LhmTextField.vue";
import MessquerschnittEditDTO from "@/domain/dto/messstelle/MessquerschnittEditDTO";
/* eslint-enable no-unused-vars */
interface Props {
height: string;
value: MessstelleEditDTO;
}
const props = defineProps<Props>();
const emits = defineEmits<{
(e: "input", v: MessstelleEditDTO): void;
}>();
const editMessstelle = computed({
get: () => props.value,
set: (v) => emits("input", v),
});
const model: Ref<string> = ref(editMessstelle.value.messquerschnitte[0].mqId);
const selectedMessquerschnitt: Ref<MessquerschnittEditDTO> = ref(
editMessstelle.value.messquerschnitte[0]
);
const stadtbezirk: ComputedRef<string> = computed(() => {
return `${editMessstelle.value.stadtbezirkNummer} - ${editMessstelle.value.stadtbezirk}`;
});
</script>
Loading

0 comments on commit 5660378

Please sign in to comment.