navigation
This commit is contained in:
parent
f951a1cd4c
commit
8be88a5245
16 changed files with 229 additions and 144 deletions
|
@ -21,9 +21,14 @@
|
|||
</Pagination>
|
||||
|
||||
<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
|
||||
</button>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -31,15 +36,14 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||
import { defineComponent } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { VehicleViewModel } from "../../../../viewmodels/admin/unit/vehicle/vehicle.models";
|
||||
import VehicleListItem from "../../../../components/admin/unit/vehicle/VehicleListItem.vue";
|
||||
import type { VehicleViewModel } from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
||||
import VehicleListItem from "@/components/admin/unit/vehicle/VehicleListItem.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -59,12 +63,6 @@ export default defineComponent({
|
|||
},
|
||||
methods: {
|
||||
...mapActions(useVehicleStore, ["fetchVehicles"]),
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openCreateModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/vehicle/CreateVehicleModal.vue")))
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<RouterLink v-if="can('update', 'unit', 'vehicle')" :to="{ name: 'admin-unit-vehicle-edit' }">
|
||||
<PencilIcon class="w-5 h-5" />
|
||||
</RouterLink>
|
||||
<TrashIcon v-if="can('delete', 'unit', 'vehicle')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
|
||||
</div>
|
||||
</template>
|
||||
<template #diffMain>
|
||||
|
@ -44,12 +43,11 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||
import { defineComponent } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { RouterLink, RouterView } from "vue-router";
|
||||
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
import { PencilIcon } from "@heroicons/vue/24/outline";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
|
||||
</script>
|
||||
|
@ -63,9 +61,9 @@ export default defineComponent({
|
|||
return {
|
||||
tabs: [
|
||||
{ route: "admin-unit-vehicle-overview", title: "Übersicht" },
|
||||
{ route: "admin-unit-vehicle-xy", title: "Wartungen" },
|
||||
{ route: "admin-unit-vehicle-xy", title: "Prüfungen" },
|
||||
{ route: "admin-unit-vehicle-xy", title: "Schadensmeldungen" },
|
||||
{ route: "admin-unit-vehicle-maintenance", title: "Wartungen" },
|
||||
{ route: "admin-unit-vehicle-inspection", title: "Prüfungen" },
|
||||
{ route: "admin-unit-vehicle-damage_report", title: "Schadensmeldungen" },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
@ -78,13 +76,6 @@ export default defineComponent({
|
|||
},
|
||||
methods: {
|
||||
...mapActions(useVehicleStore, ["fetchVehicleByActiveId"]),
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openDeleteModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/DeleteMemberModal.vue"))),
|
||||
this.vehicleId ?? ""
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue