navigation

This commit is contained in:
Julian Krauser 2025-03-30 17:24:17 +02:00
parent f951a1cd4c
commit 8be88a5245
16 changed files with 229 additions and 144 deletions

View file

@ -0,0 +1,84 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Ausrüstung-Type löschen</p>
</div>
<br />
<p class="text-center">Type {{ equipmentType?.type }} löschen?</p>
<br />
<div class="flex flex-row gap-2">
<button
primary
type="submit"
:disabled="status == 'loading' || status?.status == 'success'"
@click="triggerDelete"
>
löschen
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
import type { CreateEquipmentTypeViewModel } from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useEquipmentTypeStore, ["equipmentTypes"]),
equipmentType() {
return this.equipmentTypes.find((m) => m.id == this.data);
},
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useEquipmentTypeStore, ["deleteEquipmentType"]),
triggerDelete() {
this.status = "loading";
this.deleteEquipmentType(this.data)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.$router.push({ name: "admin-unit-equipment_type" });
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -337,6 +337,13 @@ const router = createRouter({
component: () => import("@/views/admin/unit/equipment/Equipment.vue"), component: () => import("@/views/admin/unit/equipment/Equipment.vue"),
beforeEnter: [resetEquipmentStores], beforeEnter: [resetEquipmentStores],
}, },
{
path: "create",
name: "admin-unit-equipment-create",
component: () => import("@/views/admin/ViewSelect.vue"),
meta: { type: "create", section: "unit", module: "equipment" },
beforeEnter: [abilityAndNavUpdate],
},
{ {
path: ":equipmentId", path: ":equipmentId",
name: "admin-unit-equipment-routing", name: "admin-unit-equipment-routing",
@ -351,8 +358,20 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "maintenance",
name: "admin-unit-equipment-xy", name: "admin-unit-equipment-maintenance",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "inspection",
name: "admin-unit-equipment-inspection",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "report",
name: "admin-unit-equipment-damage_report",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },
@ -381,6 +400,13 @@ const router = createRouter({
component: () => import("@/views/admin/unit/vehicle/Vehicle.vue"), component: () => import("@/views/admin/unit/vehicle/Vehicle.vue"),
beforeEnter: [resetVehicleStores], beforeEnter: [resetVehicleStores],
}, },
{
path: "create",
name: "admin-unit-vehicle-create",
component: () => import("@/views/admin/ViewSelect.vue"),
meta: { type: "create", section: "unit", module: "vehicle" },
beforeEnter: [abilityAndNavUpdate],
},
{ {
path: ":vehicleId", path: ":vehicleId",
name: "admin-unit-vehicle-routing", name: "admin-unit-vehicle-routing",
@ -395,8 +421,20 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "maintenance",
name: "admin-unit-vehicle-xy", name: "admin-unit-vehicle-maintenance",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "inspection",
name: "admin-unit-vehicle-inspection",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "report",
name: "admin-unit-vehicle-damage_report",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },
@ -439,8 +477,20 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "maintenance",
name: "admin-unit-respiratory_gear-xy", name: "admin-unit-respiratory_gear-maintenance",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "inspection",
name: "admin-unit-respiratory_gear-inspection",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "mission",
name: "admin-unit-respiratory_gear-mission",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },
@ -483,8 +533,32 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "mission",
name: "admin-unit-respiratory_wearer-xy", name: "admin-unit-respiratory_wearer-mission",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "education",
name: "admin-unit-respiratory_wearer-education",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "instruction",
name: "admin-unit-respiratory_wearer-instruction",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "screening",
name: "admin-unit-respiratory_wearer-screening",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "strain",
name: "admin-unit-respiratory_wearer-strain",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },
@ -527,8 +601,14 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "wearer",
name: "admin-unit-respiratory_mission-xy", name: "admin-unit-respiratory_mission-wearer",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "gear",
name: "admin-unit-respiratory_mission-gear",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },
@ -590,8 +670,8 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "xy", path: "inspection-plan",
name: "admin-unit-equipment_type-xy", name: "admin-unit-equipment_type-inspection_plan",
component: () => import("@/views/admin/ViewSelect.vue"), component: () => import("@/views/admin/ViewSelect.vue"),
props: true, props: true,
}, },

View file

@ -22,7 +22,7 @@ import { useAbilityStore } from "@/stores/ability";
import { useDamageReportStore } from "@/stores/admin/unit/damageReport/damageReport"; import { useDamageReportStore } from "@/stores/admin/unit/damageReport/damageReport";
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models"; import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
import Pagination from "@/components/Pagination.vue"; import Pagination from "@/components/Pagination.vue";
import DamageReportListItem from "../../../../components/admin/unit/damageReport/DamageReportListItem.vue"; import DamageReportListItem from "@components/admin/unit/damageReport/DamageReportListItem.vue";
</script> </script>
<script lang="ts"> <script lang="ts">

View file

@ -38,7 +38,6 @@ import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal"; import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment"; import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
@ -69,7 +68,7 @@ export default defineComponent({
...mapActions(useModalStore, ["openModal"]), ...mapActions(useModalStore, ["openModal"]),
openDeleteModal() { openDeleteModal() {
this.openModal( this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))), markRaw(defineAsyncComponent(() => import("@/components/admin/unit/member/DeleteMemberModal.vue"))),
this.equipmentId ?? "" this.equipmentId ?? ""
); );
}, },

View file

@ -22,9 +22,14 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'equipment')" primary class="!w-fit" @click="openCreateModal"> <RouterLink
v-if="can('create', 'unit', 'equipment')"
:to="{ name: 'admin-unit-equipment-create' }"
primary
class="!w-fit"
>
Gerätschaft erfassen Gerätschaft erfassen
</button> </RouterLink>
</div> </div>
</div> </div>
</template> </template>
@ -32,15 +37,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment"; import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
import { useModalStore } from "@/stores/modal";
import Pagination from "@/components/Pagination.vue"; import Pagination from "@/components/Pagination.vue";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import type { EquipmentViewModel } from "../../../../viewmodels/admin/unit/equipment/equipment.models"; import type { EquipmentViewModel } from "@/viewmodels/admin/unit/equipment/equipment.models";
import EquipmentListItem from "../../../../components/admin/unit/equipment/EquipmentListItem.vue"; import EquipmentListItem from "@/components/admin/unit/equipment/EquipmentListItem.vue";
</script> </script>
<script lang="ts"> <script lang="ts">
@ -60,12 +64,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useEquipmentStore, ["fetchEquipments"]), ...mapActions(useEquipmentStore, ["fetchEquipments"]),
...mapActions(useModalStore, ["openModal"]),
openCreateModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/equipment/CreateEquipmentModal.vue")))
);
},
}, },
}); });
</script> </script>

View file

@ -12,7 +12,6 @@
<RouterLink v-if="can('update', 'unit', 'equipment')" :to="{ name: 'admin-unit-equipment-edit' }"> <RouterLink v-if="can('update', 'unit', 'equipment')" :to="{ name: 'admin-unit-equipment-edit' }">
<PencilIcon class="w-5 h-5" /> <PencilIcon class="w-5 h-5" />
</RouterLink> </RouterLink>
<TrashIcon v-if="can('delete', 'unit', 'equipment')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div> </div>
</template> </template>
<template #diffMain> <template #diffMain>
@ -44,12 +43,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline"; import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment"; import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
</script> </script>
@ -63,9 +61,9 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-equipment-overview", title: "Übersicht" }, { route: "admin-unit-equipment-overview", title: "Übersicht" },
{ route: "admin-unit-equipment-xy", title: "Wartungen" }, { route: "admin-unit-equipment-maintenance", title: "Wartungen" },
{ route: "admin-unit-equipment-xy", title: "Prüfungen" }, { route: "admin-unit-equipment-inspection", title: "Prüfungen" },
{ route: "admin-unit-equipment-xy", title: "Schadensmeldungen" }, { route: "admin-unit-equipment-damage_report", title: "Schadensmeldungen" },
], ],
}; };
}, },
@ -78,13 +76,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useEquipmentStore, ["fetchEquipmentByActiveId"]), ...mapActions(useEquipmentStore, ["fetchEquipmentByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
this.equipmentId ?? ""
);
},
}, },
}); });
</script> </script>

View file

@ -21,7 +21,7 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'equipment_type')" primary class="!w-fit" @click="openCreateModal"> <button v-if="can('create', 'unit', 'equipment_type')" primary class="!w-fit" @click="openCreateModal">
Geräte-Typ erstellen Geräte-Typ erstellen
</button> </button>
</div> </div>

View file

@ -67,7 +67,7 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-equipment_type-overview", title: "Übersicht" }, { route: "admin-unit-equipment_type-overview", title: "Übersicht" },
{ route: "admin-unit-equipment_type-xy", title: "Prüfpläne" }, { route: "admin-unit-equipment_type-inspection_plan", title: "Prüfpläne" },
], ],
}; };
}, },
@ -83,7 +83,9 @@ export default defineComponent({
...mapActions(useModalStore, ["openModal"]), ...mapActions(useModalStore, ["openModal"]),
openDeleteModal() { openDeleteModal() {
this.openModal( this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))), markRaw(
defineAsyncComponent(() => import("@/components/admin/unit/equipmentType/CreateEquipmentTypeModal.vue"))
),
this.equipmentTypeId ?? "" this.equipmentTypeId ?? ""
); );
}, },

View file

@ -21,7 +21,7 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'respiratory_gear')" primary class="!w-fit" @click="openCreateModal"> <button v-if="can('create', 'unit', 'respiratory_gear')" primary class="!w-fit" @click="openCreateModal">
Gerät erfassen Gerät erfassen
</button> </button>
</div> </div>

View file

@ -16,14 +16,6 @@
> >
<ArrowTopRightOnSquareIcon class="w-5 h-5" /> <ArrowTopRightOnSquareIcon class="w-5 h-5" />
</RouterLink> </RouterLink>
<RouterLink v-if="can('update', 'unit', 'respiratory_gear')" :to="{ name: 'admin-unit-respiratory_gear-edit' }">
<PencilIcon class="w-5 h-5" />
</RouterLink>
<TrashIcon
v-if="can('delete', 'unit', 'respiratory_gear')"
class="w-5 h-5 cursor-pointer"
@click="openDeleteModal"
/>
</div> </div>
</template> </template>
<template #diffMain> <template #diffMain>
@ -55,12 +47,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { ArrowTopRightOnSquareIcon, PencilIcon, TrashIcon } from "@heroicons/vue/24/outline"; import { ArrowTopRightOnSquareIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear"; import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
</script> </script>
@ -74,9 +65,9 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-respiratory_gear-overview", title: "Übersicht" }, { route: "admin-unit-respiratory_gear-overview", title: "Übersicht" },
{ route: "admin-unit-respiratory_gear-xy", title: "Wartungen" }, { route: "admin-unit-respiratory_gear-maintenance", title: "Wartungen" },
{ route: "admin-unit-respiratory_gear-xy", title: "Prüfungen" }, { route: "admin-unit-respiratory_gear-inspection", title: "Prüfungen" },
{ route: "admin-unit-respiratory_gear-xy", title: "Einsätze" }, { route: "admin-unit-respiratory_gear-mission", title: "Einsätze" },
], ],
}; };
}, },
@ -89,13 +80,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useRespiratoryGearStore, ["fetchRespiratoryGearByActiveId"]), ...mapActions(useRespiratoryGearStore, ["fetchRespiratoryGearByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
this.respiratoryGearId ?? ""
);
},
}, },
}); });
</script> </script>

View file

@ -21,7 +21,7 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'respiratory_mission')" primary class="!w-fit" @click="openCreateModal"> <button v-if="can('create', 'unit', 'respiratory_mission')" primary class="!w-fit" @click="openCreateModal">
Einsatz erfassen Einsatz erfassen
</button> </button>
</div> </div>

View file

@ -6,18 +6,6 @@
<template #topBar> <template #topBar>
<div class="flex flex-row gap-2 items-center justify-between pt-5 pb-3 px-7"> <div class="flex flex-row gap-2 items-center justify-between pt-5 pb-3 px-7">
<h1 class="font-bold text-xl h-8 min-h-fit grow">AGT-Einsatz: {{ activeRespiratoryMissionObj?.title }}</h1> <h1 class="font-bold text-xl h-8 min-h-fit grow">AGT-Einsatz: {{ activeRespiratoryMissionObj?.title }}</h1>
<RouterLink
v-if="can('update', 'unit', 'respiratory_mission')"
:to="{ name: 'admin-unit-respiratory_mission-edit' }"
>
<PencilIcon class="w-5 h-5" />
</RouterLink>
<TrashIcon
v-if="can('delete', 'unit', 'respiratory_mission')"
class="w-5 h-5 cursor-pointer"
@click="openDeleteModal"
/>
</div> </div>
</template> </template>
<template #diffMain> <template #diffMain>
@ -49,12 +37,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission"; import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
</script> </script>
@ -68,8 +54,8 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-respiratory_mission-overview", title: "Übersicht" }, { route: "admin-unit-respiratory_mission-overview", title: "Übersicht" },
{ route: "admin-unit-respiratory_mission-xy", title: "Träger" }, { route: "admin-unit-respiratory_mission-wearer", title: "Träger" },
{ route: "admin-unit-respiratory_mission-xy", title: "Geräte" }, { route: "admin-unit-respiratory_mission-gear", title: "Geräte" },
], ],
}; };
}, },
@ -82,13 +68,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useRespiratoryMissionStore, ["fetchRespiratoryMissionByActiveId"]), ...mapActions(useRespiratoryMissionStore, ["fetchRespiratoryMissionByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
this.respiratoryMissionId ?? ""
);
},
}, },
}); });
</script> </script>

View file

@ -21,7 +21,7 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'respiratory_wearer')" primary class="!w-fit" @click="openCreateModal"> <button v-if="can('create', 'unit', 'respiratory_wearer')" primary class="!w-fit" @click="openCreateModal">
Träger erfassen Träger erfassen
</button> </button>
</div> </div>

View file

@ -9,18 +9,6 @@
AGT-Träger: {{ activeRespiratoryWearerObj?.member.lastname }}, AGT-Träger: {{ activeRespiratoryWearerObj?.member.lastname }},
{{ activeRespiratoryWearerObj?.member.firstname }} {{ activeRespiratoryWearerObj?.member.firstname }}
</h1> </h1>
<RouterLink
v-if="can('update', 'unit', 'respiratory_wearer')"
:to="{ name: 'admin-unit-respiratory_wearer-edit' }"
>
<PencilIcon class="w-5 h-5" />
</RouterLink>
<TrashIcon
v-if="can('delete', 'unit', 'respiratory_wearer')"
class="w-5 h-5 cursor-pointer"
@click="openDeleteModal"
/>
</div> </div>
</template> </template>
<template #diffMain> <template #diffMain>
@ -52,12 +40,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer"; import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
</script> </script>
@ -71,11 +57,11 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-respiratory_wearer-overview", title: "Übersicht" }, { route: "admin-unit-respiratory_wearer-overview", title: "Übersicht" },
{ route: "admin-unit-respiratory_wearer-xy", title: "Einsätze" }, { route: "admin-unit-respiratory_wearer-mission", title: "Einsätze" },
{ route: "admin-unit-respiratory_wearer-xy", title: "Bildungen" }, { route: "admin-unit-respiratory_wearer-education", title: "Bildungen" },
{ route: "admin-unit-respiratory_wearer-xy", title: "Unterweisungen" }, { route: "admin-unit-respiratory_wearer-instruction", title: "Unterweisungen" },
{ route: "admin-unit-respiratory_wearer-xy", title: "Untersuchungen" }, { route: "admin-unit-respiratory_wearer-screening", title: "Untersuchungen" },
{ route: "admin-unit-respiratory_wearer-xy", title: "Belastungen" }, { route: "admin-unit-respiratory_wearer-strain", title: "Belastungen" },
], ],
}; };
}, },
@ -88,13 +74,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useRespiratoryWearerStore, ["fetchRespiratoryWearerByActiveId"]), ...mapActions(useRespiratoryWearerStore, ["fetchRespiratoryWearerByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
this.respiratoryWearerId ?? ""
);
},
}, },
}); });
</script> </script>

View file

@ -21,9 +21,14 @@
</Pagination> </Pagination>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
<button v-if="can('create', 'unit', 'equipment')" primary class="!w-fit" @click="openCreateModal"> <RouterLink
v-if="can('create', 'unit', 'equipment')"
:to="{ name: 'admin-unit-vehicle-create' }"
primary
class="!w-fit"
>
Fahrzeug erstellen Fahrzeug erstellen
</button> </RouterLink>
</div> </div>
</div> </div>
</template> </template>
@ -31,15 +36,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle"; import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
import { useModalStore } from "@/stores/modal";
import Pagination from "@/components/Pagination.vue"; import Pagination from "@/components/Pagination.vue";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import type { VehicleViewModel } from "../../../../viewmodels/admin/unit/vehicle/vehicle.models"; import type { VehicleViewModel } from "@/viewmodels/admin/unit/vehicle/vehicle.models";
import VehicleListItem from "../../../../components/admin/unit/vehicle/VehicleListItem.vue"; import VehicleListItem from "@/components/admin/unit/vehicle/VehicleListItem.vue";
</script> </script>
<script lang="ts"> <script lang="ts">
@ -59,12 +63,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useVehicleStore, ["fetchVehicles"]), ...mapActions(useVehicleStore, ["fetchVehicles"]),
...mapActions(useModalStore, ["openModal"]),
openCreateModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/vehicle/CreateVehicleModal.vue")))
);
},
}, },
}); });
</script> </script>

View file

@ -12,7 +12,6 @@
<RouterLink v-if="can('update', 'unit', 'vehicle')" :to="{ name: 'admin-unit-vehicle-edit' }"> <RouterLink v-if="can('update', 'unit', 'vehicle')" :to="{ name: 'admin-unit-vehicle-edit' }">
<PencilIcon class="w-5 h-5" /> <PencilIcon class="w-5 h-5" />
</RouterLink> </RouterLink>
<TrashIcon v-if="can('delete', 'unit', 'vehicle')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div> </div>
</template> </template>
<template #diffMain> <template #diffMain>
@ -44,12 +43,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue"; import { defineComponent } from "vue";
import { mapActions, mapState } from "pinia"; import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue"; import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router"; import { RouterLink, RouterView } from "vue-router";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline"; import { PencilIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability"; import { useAbilityStore } from "@/stores/ability";
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle"; import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
</script> </script>
@ -63,9 +61,9 @@ export default defineComponent({
return { return {
tabs: [ tabs: [
{ route: "admin-unit-vehicle-overview", title: "Übersicht" }, { route: "admin-unit-vehicle-overview", title: "Übersicht" },
{ route: "admin-unit-vehicle-xy", title: "Wartungen" }, { route: "admin-unit-vehicle-maintenance", title: "Wartungen" },
{ route: "admin-unit-vehicle-xy", title: "Prüfungen" }, { route: "admin-unit-vehicle-inspection", title: "Prüfungen" },
{ route: "admin-unit-vehicle-xy", title: "Schadensmeldungen" }, { route: "admin-unit-vehicle-damage_report", title: "Schadensmeldungen" },
], ],
}; };
}, },
@ -78,13 +76,6 @@ export default defineComponent({
}, },
methods: { methods: {
...mapActions(useVehicleStore, ["fetchVehicleByActiveId"]), ...mapActions(useVehicleStore, ["fetchVehicleByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
this.vehicleId ?? ""
);
},
}, },
}); });
</script> </script>