Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vorbereitung zur Demo #41

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion frontend/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ 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']
MessstelleOverview: typeof import('./src/components/messstelle/MessstelleOverview.vue')['default']
MessstelleOverviewPanel: typeof import('./src/components/messstelle/MessstelleOverviewPanel.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 +50,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 Expand Up @@ -107,6 +113,7 @@ declare module '@vue/runtime-core' {
ZaehldauerSoZIcon: typeof import('./src/components/icons/ZaehldauerIcons/ZaehldauerSoZIcon.vue')['default']
ZaehlstelleInfo: typeof import('./src/components/zaehlstelle/ZaehlstelleInfo.vue')['default']
ZaehlstelleMap: typeof import('./src/components/map/ZaehlstelleMap.vue')['default']
ZaehlstelleOverview: typeof import('./src/components/zaehlstelle/ZaehlstelleOverview.vue')['default']
ZaehlungCard: typeof import('./src/components/zaehlung/ZaehlungCard.vue')['default']
ZaehlungCardMap: typeof import('./src/components/map/ZaehlungCardMap.vue')['default']
ZaehlungDialog: typeof import('./src/components/zaehlung/ZaehlungDialog.vue')['default']
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@
icon
small
v-on="on"
@click="navigateToOpenZaehlungen"
@click="navigateToErhebungsstellenOverview"
>
<v-icon>mdi-clipboard-list-outline</v-icon>
</v-btn>
</template>
<span> Offene Zählungen </span>
<span> Zählungen & Messstellen </span>
</v-tooltip>
<v-tooltip bottom>
<template #activator="{ on, attrs }">
Expand Down Expand Up @@ -410,6 +410,10 @@ export default class App extends Vue {
this.selectedSuggestion.type === this.suggestionTypeZaehlung
) {
this.showZaehlung(this.selectedSuggestion);
} else if (
this.selectedSuggestion.type === this.suggestionTypeMessstelle
) {
this.showMessstelle(this.selectedSuggestion);
} else {
this.search();
}
Expand Down Expand Up @@ -478,8 +482,8 @@ export default class App extends Vue {
window.open(App.URL_HANDBUCH_LINK);
}

navigateToOpenZaehlungen() {
this.$router.push(`/offeneZaehlungen`);
navigateToErhebungsstellenOverview() {
this.$router.push(`/erhebungsstellenOverview`);
}

navigateToConfig() {
Expand Down
96 changes: 36 additions & 60 deletions frontend/src/api/service/MessstelleService.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,40 @@
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";
import MessstelleOverviewDTO from "@/domain/dto/messstelle/MessstelleOverviewDTO";

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 getAllMessstellenForOverview(): Promise<
Array<MessstelleOverviewDTO>
> {
return FetchService.getData(
`${this.ENDPOINT}/loadAllMessstellenForOverview`,
"Beim Laden aller offenen 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
Loading