Skip to content

Commit

Permalink
Messfaehigkeit ergaenzt
Browse files Browse the repository at this point in the history
  • Loading branch information
Der-Alex-K committed Jun 7, 2024
1 parent 5f9ecae commit 8fd54df
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ declare module '@vue/runtime-core' {
KontaktForm: typeof import('./src/components/zaehlung/form/KontaktForm.vue')['default']
LageplanForm: typeof import('./src/components/messstelle/LageplanForm.vue')['default']
LhmTextField: typeof import('./src/components/common/LhmTextField.vue')['default']
MessfaehigkeitForm: typeof import('./src/components/messstelle/MessfaehigkeitForm.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']
Expand Down Expand Up @@ -94,6 +95,7 @@ declare module '@vue/runtime-core' {
VProgressLinear: typeof import('vuetify/lib')['VProgressLinear']
VRow: typeof import('vuetify/lib')['VRow']
VSheet: typeof import('vuetify/lib')['VSheet']
VSimpleTable: typeof import('vuetify/lib')['VSimpleTable']
VSnackbar: typeof import('vuetify/lib')['VSnackbar']
VSpacer: typeof import('vuetify/lib')['VSpacer']
VSpeedDial: typeof import('vuetify/lib')['VSpeedDial']
Expand Down
77 changes: 77 additions & 0 deletions frontend/src/components/messstelle/MessfaehigkeitForm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<template>
<v-sheet
width="100%"
:min-height="height"
:max-height="height"
>
<v-card elevation="0">
<v-card-text>
<v-form>
<v-data-table
class="overflow-y-auto"
:height="tableHeight"
dense
:headers="header"
:items="messfahigkeiten"
:items-per-page="-1"
hide-default-footer
fixed-header
:item-class="activeMessfaehigkeit"
/>
</v-form>
</v-card-text>
</v-card>
</v-sheet>
</template>

<script setup lang="ts">
import MessfaehigkeitDTO from "@/domain/dto/messstelle/MessfaehigkeitDTO";
import { computed, ComputedRef } from "vue";
import _ from "lodash";
interface Props {
height: string;
messfahigkeiten: Array<MessfaehigkeitDTO>;
}
const props = defineProps<Props>();
const tableHeight: ComputedRef<string> = computed(() => {
return parseInt(props.height.replace("px", "")) - 136 + "px";
});
function activeMessfaehigkeit(item: MessfaehigkeitDTO) {
return _.isEmpty(item.gueltigBis) ? "light-green lighten-3" : "";
}
const header = computed(() => {
return [
{
text: "Fahrzeugklassen",
align: "start",
sortable: false,
value: "fahrzeugklassen",
divider: true,
},
{
text: "Intervallwert",
align: "start",
sortable: false,
value: "intervall",
divider: true,
},
{
text: "gültig ab",
align: "start",
sortable: false,
value: "gueltigAb",
divider: true,
},
{
text: "gültig bis",
align: "start",
sortable: false,
value: "gueltigBis",
},
];
});
</script>
11 changes: 11 additions & 0 deletions frontend/src/components/messstelle/UpdateMessstelleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
Messquerschnitt
<v-icon>mdi-routes</v-icon>
</v-tab>
<v-tab>
Messfähigkeit
<v-icon>mdi-car-multiple</v-icon>
</v-tab>
<v-tab>
Standort
<v-icon>mdi-map-marker-outline</v-icon>
Expand Down Expand Up @@ -74,6 +78,12 @@
:disabled="isMessstelleReadonly"
/>
</v-tab-item>
<v-tab-item ref="messfaehigkeit">
<messfaehigkeit-form
:messfahigkeiten="messstelle.messfaehigkeiten"
:height="contentHeightVh"
/>
</v-tab-item>
<v-tab-item ref="standort">
<standort-tab-item
v-model="messstelle"
Expand Down Expand Up @@ -120,6 +130,7 @@ import { MessstelleStatus } from "@/domain/enums/MessstelleStatus";
import LageplanForm from "@/components/messstelle/LageplanForm.vue";
import { useVuetify } from "@/util/useVuetify";
import StandortTabItem from "@/components/messstelle/StandortTabItem.vue";
import MessfaehigkeitForm from "@/components/messstelle/MessfaehigkeitForm.vue";
const activeTab: Ref<number> = ref(0);
const validMst: Ref<boolean> = ref(false);
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/domain/dto/messstelle/MessfaehigkeitDTO.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default interface MessfaehigkeitDTO {
gueltigAb: string;
gueltigBis: string;
intervall: string;
fahrzeugklassen: string;
standort: string;
}
2 changes: 2 additions & 0 deletions frontend/src/domain/dto/messstelle/MessstelleEditDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import BaseEntity from "@/domain/BaseEntity";
import MessquerschnittEditDTO from "@/domain/dto/messstelle/MessquerschnittEditDTO";
import { MessstelleStatus } from "@/domain/enums/MessstelleStatus";
import MessfaehigkeitDTO from "@/domain/dto/messstelle/MessfaehigkeitDTO";

export default interface MessstelleEditDTO extends BaseEntity {
mstId: string;
Expand All @@ -25,4 +26,5 @@ export default interface MessstelleEditDTO extends BaseEntity {
sichtbarDatenportal: boolean;

messquerschnitte: Array<MessquerschnittEditDTO>;
messfaehigkeiten: Array<MessfaehigkeitDTO>;
}
8 changes: 8 additions & 0 deletions frontend/src/util/DateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ export function useDateUtils() {
});
}

function isDateAfter(
dateToCheck: string,
dateAfter: Date | string
): boolean {
return new Date(dateToCheck).valueOf() > new Date(dateAfter).valueOf();
}

return {
sortDatesDescAsStrings,
formatDate,
isDateAfter,
};
}

0 comments on commit 8fd54df

Please sign in to comment.