inspection plan execute
This commit is contained in:
parent
b359044cb5
commit
70e9b47483
17 changed files with 429 additions and 134 deletions
|
@ -18,6 +18,7 @@ import { resetRespiratoryMissionStores, setRespiratoryMissionId } from "./unit/r
|
|||
import { resetWearableStores, setWearableId } from "./unit/wearable";
|
||||
import { resetInspectionPlanStores, setInspectionPlanId } from "./unit/inspectionPlan";
|
||||
import { setVehicleTypeId } from "./unit/vehicleType";
|
||||
import { resetInspectionStores, setInspectionId } from "./unit/inspection";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
|
@ -860,7 +861,7 @@ const router = createRouter({
|
|||
name: "admin-unit-inspection-route",
|
||||
component: () => import("@/views/RouterView.vue"),
|
||||
meta: { type: "create", section: "unit", module: "inspection" },
|
||||
beforeEnter: [abilityAndNavUpdate],
|
||||
beforeEnter: [abilityAndNavUpdate, resetInspectionStores],
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
|
@ -875,10 +876,10 @@ const router = createRouter({
|
|||
props: true,
|
||||
},
|
||||
{
|
||||
path: "execute/:inspection",
|
||||
path: "execute/:inspectionId",
|
||||
name: "admin-unit-inspection-execute",
|
||||
component: () => import("@/views/admin/unit/inspection/InspectionExecute.vue"),
|
||||
beforeEnter: [],
|
||||
beforeEnter: [setInspectionId],
|
||||
props: true,
|
||||
},
|
||||
],
|
||||
|
|
20
src/router/unit/inspection.ts
Normal file
20
src/router/unit/inspection.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useInspectionStore } from "@/stores/admin/unit/inspection/inspection";
|
||||
|
||||
export async function setInspectionId(to: any, from: any, next: any) {
|
||||
const InspectionStore = useInspectionStore();
|
||||
InspectionStore.activeInspection = to.params?.inspectionId ?? null;
|
||||
|
||||
//useXYStore().$reset();
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
export async function resetInspectionStores(to: any, from: any, next: any) {
|
||||
const InspectionStore = useInspectionStore();
|
||||
InspectionStore.activeInspection = null;
|
||||
InspectionStore.activeInspectionObj = null;
|
||||
|
||||
//useXYStore().$reset();
|
||||
|
||||
next();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue