maintainance view and wearable inspection integration
This commit is contained in:
parent
50fa0128ea
commit
6575948841
26 changed files with 877 additions and 66 deletions
|
@ -19,6 +19,7 @@ import { resetWearableStores, setWearableId } from "./unit/wearable";
|
|||
import { resetInspectionPlanStores, setInspectionPlanId } from "./unit/inspectionPlan";
|
||||
import { setVehicleTypeId } from "./unit/vehicleType";
|
||||
import { resetInspectionStores, setInspectionId } from "./unit/inspection";
|
||||
import { setWearableTypeId } from "./unit/wearableType";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
|
@ -498,6 +499,12 @@ const router = createRouter({
|
|||
component: () => import("@/views/admin/ViewSelect.vue"),
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: "inspection",
|
||||
name: "admin-unit-wearable-inspection",
|
||||
component: () => import("@/views/admin/unit/wearable/Inspection.vue"),
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: "report",
|
||||
name: "admin-unit-wearable-damage_report",
|
||||
|
@ -706,6 +713,25 @@ const router = createRouter({
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "maintenance",
|
||||
name: "admin-unit-maintenance-route",
|
||||
component: () => import("@/views/admin/unit/maintenance/MaintenanceRouting.vue"),
|
||||
meta: { type: "read", section: "unit", module: "maintenance" },
|
||||
beforeEnter: [abilityAndNavUpdate],
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
name: "admin-unit-maintenance",
|
||||
component: () => import("@/views/admin/unit/maintenance/Maintenance.vue"),
|
||||
},
|
||||
{
|
||||
path: "done",
|
||||
name: "admin-unit-maintenance-done",
|
||||
component: () => import("@/views/admin/unit/maintenance/Maintenance.vue"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "equipment-type",
|
||||
name: "admin-unit-equipment_type-route",
|
||||
|
@ -806,12 +832,33 @@ const router = createRouter({
|
|||
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],
|
||||
path: ":wearableTypeId",
|
||||
name: "admin-unit-wearable_type-routing",
|
||||
component: () => import("@/views/admin/unit/wearableType/WearableTypeRouting.vue"),
|
||||
beforeEnter: [setWearableTypeId],
|
||||
props: true,
|
||||
children: [
|
||||
{
|
||||
path: "overview",
|
||||
name: "admin-unit-wearable_type-overview",
|
||||
component: () => import("@/views/admin/unit/wearableType/Overview.vue"),
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: "inspection-plan",
|
||||
name: "admin-unit-wearable_type-inspection_plan",
|
||||
component: () => import("@/views/admin/unit/wearableType/InspectionPlans.vue"),
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: "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,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
21
src/router/unit/wearableType.ts
Normal file
21
src/router/unit/wearableType.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { useWearableTypeStore } from "@/stores/admin/unit/wearableType/wearableType";
|
||||
import { useWearableTypeInspectionPlanStore } from "@/stores/admin/unit/wearableType/inspectionPlan";
|
||||
|
||||
export async function setWearableTypeId(to: any, from: any, next: any) {
|
||||
const wearableTypeStore = useWearableTypeStore();
|
||||
wearableTypeStore.activeWearableType = to.params?.wearableTypeId ?? null;
|
||||
|
||||
useWearableTypeInspectionPlanStore().$reset();
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
export async function resetWearableTypeStores(to: any, from: any, next: any) {
|
||||
const wearableTypeStore = useWearableTypeStore();
|
||||
wearableTypeStore.activeWearableType = null;
|
||||
wearableTypeStore.activeWearableTypeObj = null;
|
||||
|
||||
useWearableTypeInspectionPlanStore().$reset();
|
||||
|
||||
next();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue