This commit is contained in:
Julian Krauser 2025-04-01 16:11:39 +02:00
parent 716823f536
commit 553eeb7bfb
21 changed files with 1318 additions and 0 deletions

View file

@ -17,6 +17,7 @@ import { resetVehicleStores, setVehicleId } from "./unit/vehicle";
import { resetRespiratoryGearStores, setRespiratoryGearId } from "./unit/respiratoryGear";
import { resetRespiratoryWearerStores, setRespiratoryWearerId } from "./unit/respiratoryWearer";
import { resetRespiratoryMissionStores, setRespiratoryMissionId } from "./unit/respiratoryMission";
import { resetWearableStores, setWearableId } from "./unit/wearable";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@ -450,6 +451,57 @@ const router = createRouter({
},
],
},
{
path: "wearable",
name: "admin-unit-wearable-route",
component: () => import("@/views/RouterView.vue"),
meta: { type: "read", section: "unit", module: "wearable" },
beforeEnter: [abilityAndNavUpdate],
children: [
{
path: "",
name: "admin-unit-wearable",
component: () => import("@/views/admin/unit/wearable/Wearable.vue"),
beforeEnter: [resetWearableStores],
},
{
path: "create",
name: "admin-unit-wearable-create",
component: () => import("@/views/admin/unit/wearable/CreateWearable.vue"),
meta: { type: "create", section: "unit", module: "wearable" },
beforeEnter: [abilityAndNavUpdate],
},
{
path: ":wearableId",
name: "admin-unit-wearable-routing",
component: () => import("@/views/admin/unit/wearable/WearableRouting.vue"),
beforeEnter: [setWearableId],
props: true,
children: [
{
path: "overview",
name: "admin-unit-wearable-overview",
component: () => import("@/views/admin/unit/wearable/Overview.vue"),
props: true,
},
{
path: "report",
name: "admin-unit-wearable-damage_report",
component: () => import("@/views/admin/ViewSelect.vue"),
props: true,
},
{
path: "edit",
name: "admin-unit-wearable-edit",
component: () => import("@/views/admin/unit/wearable/UpdateWearable.vue"),
meta: { type: "update", section: "unit", module: "wearable" },
beforeEnter: [abilityAndNavUpdate],
props: true,
},
],
},
],
},
{
path: "respiratory-gear",
name: "admin-unit-respiratory_gear-route",
@ -687,6 +739,28 @@ const router = createRouter({
},
],
},
{
path: "wearable-type",
name: "admin-unit-wearable_type-route",
component: () => import("@/views/RouterView.vue"),
meta: { type: "read", section: "unit", module: "wearable_type" },
beforeEnter: [abilityAndNavUpdate],
children: [
{
path: "",
name: "admin-unit-wearable_type",
component: () => import("@/views/admin/unit/wearableType/WearableType.vue"),
},
{
path: ":wearableTypeId/edit",
name: "admin-unit-wearable_type-edit",
component: () => import("@/views/admin/unit/wearableType/UpdateWearableType.vue"),
meta: { type: "update", section: "unit", module: "wearable_type" },
beforeEnter: [abilityAndNavUpdate],
props: true,
},
],
},
],
},
{

View file

@ -0,0 +1,20 @@
import { useWearableStore } from "@/stores/admin/unit/wearable/wearable";
export async function setWearableId(to: any, from: any, next: any) {
const WearableStore = useWearableStore();
WearableStore.activeWearable = to.params?.wearableId ?? null;
//useXYStore().$reset();
next();
}
export async function resetWearableStores(to: any, from: any, next: any) {
const WearableStore = useWearableStore();
WearableStore.activeWearable = null;
WearableStore.activeWearableObj = null;
//useXYStore().$reset();
next();
}