demo data
This commit is contained in:
parent
5faa4b7906
commit
36ca3d90a7
29 changed files with 304 additions and 99 deletions
|
@ -1,8 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<RouterLink
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
||||||
:to="{ name: 'admin-unit-damage_report-overview', params: { damageReportId: damageReport.id } }"
|
|
||||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
|
||||||
>
|
|
||||||
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||||
<p>
|
<p>
|
||||||
{{ damageReport.affectedEquipment.name }}
|
{{ damageReport.affectedEquipment.name }}
|
||||||
|
@ -12,7 +9,7 @@
|
||||||
<p v-if="damageReport.affectedEquipment">Code: {{ damageReport.affectedEquipment.code }}</p>
|
<p v-if="damageReport.affectedEquipment">Code: {{ damageReport.affectedEquipment.code }}</p>
|
||||||
<p v-if="damageReport.description">Beschreibung: {{ damageReport.description }}</p>
|
<p v-if="damageReport.description">Beschreibung: {{ damageReport.description }}</p>
|
||||||
</div>
|
</div>
|
||||||
</RouterLink>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
14
src/demodata/damageReport.ts
Normal file
14
src/demodata/damageReport.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import type { DamageReportViewModel } from "../viewmodels/admin/unit/damageReport/damageReport.models";
|
||||||
|
import { equipmentDemoData } from "./equipment";
|
||||||
|
|
||||||
|
export const damageReportDemoData: Array<DamageReportViewModel> = [
|
||||||
|
{
|
||||||
|
id: "sdfgh",
|
||||||
|
reported: new Date(),
|
||||||
|
status: "",
|
||||||
|
done: false,
|
||||||
|
description: "knjgljna g",
|
||||||
|
affectedEquipmentId: equipmentDemoData[0].id,
|
||||||
|
affectedEquipment: equipmentDemoData[0],
|
||||||
|
},
|
||||||
|
];
|
13
src/demodata/equipment.ts
Normal file
13
src/demodata/equipment.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import type { EquipmentViewModel } from "../viewmodels/admin/unit/equipment/equipment.models";
|
||||||
|
import { equipmentTypeDemoData } from "./equipmentType";
|
||||||
|
|
||||||
|
export const equipmentDemoData: Array<EquipmentViewModel> = [
|
||||||
|
{
|
||||||
|
id: "abc",
|
||||||
|
code: "0456984224498",
|
||||||
|
name: "B-Schlauch",
|
||||||
|
location: "HLF",
|
||||||
|
equipmentTypeId: equipmentTypeDemoData[0].id,
|
||||||
|
equipmentType: equipmentTypeDemoData[0],
|
||||||
|
},
|
||||||
|
];
|
10
src/demodata/equipmentType.ts
Normal file
10
src/demodata/equipmentType.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import type { EquipmentTypeViewModel } from "../viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||||
|
|
||||||
|
export const equipmentTypeDemoData: Array<EquipmentTypeViewModel> = [
|
||||||
|
{
|
||||||
|
id: "xyz",
|
||||||
|
type: "B-Schlauch",
|
||||||
|
description: "Shläuche vom Typ B",
|
||||||
|
inspectionInterval: "1m",
|
||||||
|
},
|
||||||
|
];
|
10
src/demodata/respiratoryGear.ts
Normal file
10
src/demodata/respiratoryGear.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import type { RespiratoryGearViewModel } from "../viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||||
|
import { equipmentDemoData } from "./equipment";
|
||||||
|
|
||||||
|
export const respiratoryGearDemoData: Array<RespiratoryGearViewModel> = [
|
||||||
|
{
|
||||||
|
id: "adfsg",
|
||||||
|
equipmentId: equipmentDemoData[0].id,
|
||||||
|
equipment: equipmentDemoData[0],
|
||||||
|
},
|
||||||
|
];
|
11
src/demodata/respiratoryMission.ts
Normal file
11
src/demodata/respiratoryMission.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import type { RespiratoryMissionViewModel } from "../viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||||
|
import { equipmentDemoData } from "./equipment";
|
||||||
|
|
||||||
|
export const respiratoryMissionDemoData: Array<RespiratoryMissionViewModel> = [
|
||||||
|
{
|
||||||
|
id: "adfsg",
|
||||||
|
date: new Date(),
|
||||||
|
title: "B5",
|
||||||
|
description: "B5 Einsatz",
|
||||||
|
},
|
||||||
|
];
|
17
src/demodata/respiratoryWearer.ts
Normal file
17
src/demodata/respiratoryWearer.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import type { RespiratoryWearerViewModel } from "../viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||||
|
|
||||||
|
export const respiratoryWearerDemoData: Array<RespiratoryWearerViewModel> = [
|
||||||
|
{
|
||||||
|
id: "dfghj",
|
||||||
|
memberId: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||||
|
member: {
|
||||||
|
id: "9469991d-fa22-4899-82ce-b1ba5de990dc",
|
||||||
|
salutation: { id: 3, salutation: "Herr" },
|
||||||
|
firstname: "Julian",
|
||||||
|
lastname: "Krauser",
|
||||||
|
nameaffix: "",
|
||||||
|
birthdate: new Date("2003-09-20"),
|
||||||
|
internalId: "1312",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
14
src/demodata/vehicle.ts
Normal file
14
src/demodata/vehicle.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import type { VehicleViewModel } from "../viewmodels/admin/unit/vehicle/vehicle.models";
|
||||||
|
|
||||||
|
export const vehicleDemoData: Array<VehicleViewModel> = [
|
||||||
|
{
|
||||||
|
id: "kjhb",
|
||||||
|
name: "HLF",
|
||||||
|
type: "HLF 20/10",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "kjhb",
|
||||||
|
name: "LF",
|
||||||
|
type: "LF 8/6",
|
||||||
|
},
|
||||||
|
];
|
|
@ -1,7 +1,7 @@
|
||||||
import { useNewsletterStore } from "@/stores/admin/club/newsletter/newsletter";
|
import { useNewsletterStore } from "@/stores/admin/club/newsletter/newsletter";
|
||||||
import { useNewsletterDatesStore } from "@/stores/admin/club/newsletter/newsletterDates";
|
import { useNewsletterDatesStore } from "@/stores/admin/club/newsletter/newsletterDates";
|
||||||
import { useNewsletterRecipientsStore } from "@/stores/admin/club/newsletter/newsletterRecipients";
|
import { useNewsletterRecipientsStore } from "@/stores/admin/club/newsletter/newsletterRecipients";
|
||||||
import { useNewsletterPrintoutStore } from "../stores/admin/club/newsletter/newsletterPrintout";
|
import { useNewsletterPrintoutStore } from "../../stores/admin/club/newsletter/newsletterPrintout";
|
||||||
|
|
||||||
export async function setNewsletterId(to: any, from: any, next: any) {
|
export async function setNewsletterId(to: any, from: any, next: any) {
|
||||||
const newsletter = useNewsletterStore();
|
const newsletter = useNewsletterStore();
|
|
@ -3,7 +3,7 @@ import { useProtocolAgendaStore } from "@/stores/admin/club/protocol/protocolAge
|
||||||
import { useProtocolDecisionStore } from "@/stores/admin/club/protocol/protocolDecision";
|
import { useProtocolDecisionStore } from "@/stores/admin/club/protocol/protocolDecision";
|
||||||
import { useProtocolPresenceStore } from "@/stores/admin/club/protocol/protocolPresence";
|
import { useProtocolPresenceStore } from "@/stores/admin/club/protocol/protocolPresence";
|
||||||
import { useProtocolVotingStore } from "@/stores/admin/club/protocol/protocolVoting";
|
import { useProtocolVotingStore } from "@/stores/admin/club/protocol/protocolVoting";
|
||||||
import { useProtocolPrintoutStore } from "../stores/admin/club/protocol/protocolPrintout";
|
import { useProtocolPrintoutStore } from "../../stores/admin/club/protocol/protocolPrintout";
|
||||||
|
|
||||||
export async function setProtocolId(to: any, from: any, next: any) {
|
export async function setProtocolId(to: any, from: any, next: any) {
|
||||||
const protocol = useProtocolStore();
|
const protocol = useProtocolStore();
|
|
@ -6,11 +6,17 @@ import { loadAccountData } from "./accountGuard";
|
||||||
import { isSetup } from "./setupGuard";
|
import { isSetup } from "./setupGuard";
|
||||||
import { abilityAndNavUpdate } from "./adminGuard";
|
import { abilityAndNavUpdate } from "./adminGuard";
|
||||||
import type { PermissionType, PermissionSection, PermissionModule } from "@/types/permissionTypes";
|
import type { PermissionType, PermissionSection, PermissionModule } from "@/types/permissionTypes";
|
||||||
import { resetMemberStores, setMemberId } from "./memberGuard";
|
import { resetMemberStores, setMemberId } from "./club/memberGuard";
|
||||||
import { resetProtocolStores, setProtocolId } from "./protocolGuard";
|
import { resetProtocolStores, setProtocolId } from "./club/protocolGuard";
|
||||||
import { resetNewsletterStores, setNewsletterId } from "./newsletterGuard";
|
import { resetNewsletterStores, setNewsletterId } from "./club/newsletterGuard";
|
||||||
import { config } from "../config";
|
import { config } from "../config";
|
||||||
import { setBackupPage } from "./backupGuard";
|
import { setBackupPage } from "./management/backupGuard";
|
||||||
|
import { resetEquipmentTypeStores, setEquipmentTypeId } from "./unit/equipmentType";
|
||||||
|
import { resetEquipmentStores, setEquipmentId } from "./unit/equipment";
|
||||||
|
import { resetVehicleStores, setVehicleId } from "./unit/vehicle";
|
||||||
|
import { resetRespiratoryGearStores, setRespiratoryGearId } from "./unit/respiratoryGear";
|
||||||
|
import { resetRespiratoryWearerStores, setRespiratoryWearerId } from "./unit/respiratoryWearer";
|
||||||
|
import { resetRespiratoryMissionStores, setRespiratoryMissionId } from "./unit/respiratoryMission";
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
|
@ -329,12 +335,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-equipment",
|
name: "admin-unit-equipment",
|
||||||
component: () => import("@/views/admin/unit/equipment/Equipment.vue"),
|
component: () => import("@/views/admin/unit/equipment/Equipment.vue"),
|
||||||
|
beforeEnter: [resetEquipmentStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":equipmentId",
|
path: ":equipmentId",
|
||||||
name: "admin-unit-equipment-routing",
|
name: "admin-unit-equipment-routing",
|
||||||
component: () => import("@/views/admin/unit/equipment/EquipmentRouting.vue"),
|
component: () => import("@/views/admin/unit/equipment/EquipmentRouting.vue"),
|
||||||
beforeEnter: [] /** set equipment ID */,
|
beforeEnter: [setEquipmentId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -372,12 +379,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-vehicle",
|
name: "admin-unit-vehicle",
|
||||||
component: () => import("@/views/admin/unit/vehicle/Vehicle.vue"),
|
component: () => import("@/views/admin/unit/vehicle/Vehicle.vue"),
|
||||||
|
beforeEnter: [resetVehicleStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":vehicleId",
|
path: ":vehicleId",
|
||||||
name: "admin-unit-vehicle-routing",
|
name: "admin-unit-vehicle-routing",
|
||||||
component: () => import("@/views/admin/unit/vehicle/VehicleRouting.vue"),
|
component: () => import("@/views/admin/unit/vehicle/VehicleRouting.vue"),
|
||||||
beforeEnter: [] /** set vehicle ID */,
|
beforeEnter: [setVehicleId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -415,12 +423,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-respiratory_gear",
|
name: "admin-unit-respiratory_gear",
|
||||||
component: () => import("@/views/admin/unit/respiratoryGear/RespiratoryGear.vue"),
|
component: () => import("@/views/admin/unit/respiratoryGear/RespiratoryGear.vue"),
|
||||||
|
beforeEnter: [resetRespiratoryGearStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":respiratoryGearId",
|
path: ":respiratoryGearId",
|
||||||
name: "admin-unit-respiratory_gear-routing",
|
name: "admin-unit-respiratory_gear-routing",
|
||||||
component: () => import("@/views/admin/unit/respiratoryGear/RespiratoryGearRouting.vue"),
|
component: () => import("@/views/admin/unit/respiratoryGear/RespiratoryGearRouting.vue"),
|
||||||
beforeEnter: [] /** set respiratory_gear ID */,
|
beforeEnter: [setRespiratoryGearId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -458,12 +467,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-respiratory_wearer",
|
name: "admin-unit-respiratory_wearer",
|
||||||
component: () => import("@/views/admin/unit/respiratoryWearer/RespiratoryWearer.vue"),
|
component: () => import("@/views/admin/unit/respiratoryWearer/RespiratoryWearer.vue"),
|
||||||
|
beforeEnter: [resetRespiratoryWearerStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":respiratoryWearerId",
|
path: ":respiratoryWearerId",
|
||||||
name: "admin-unit-respiratory_wearer-routing",
|
name: "admin-unit-respiratory_wearer-routing",
|
||||||
component: () => import("@/views/admin/unit/respiratoryWearer/RespiratoryWearerRouting.vue"),
|
component: () => import("@/views/admin/unit/respiratoryWearer/RespiratoryWearerRouting.vue"),
|
||||||
beforeEnter: [] /** set respiratory_wearer ID */,
|
beforeEnter: [setRespiratoryWearerId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -501,12 +511,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-respiratory_mission",
|
name: "admin-unit-respiratory_mission",
|
||||||
component: () => import("@/views/admin/unit/respiratoryMission/RespiratoryMission.vue"),
|
component: () => import("@/views/admin/unit/respiratoryMission/RespiratoryMission.vue"),
|
||||||
|
beforeEnter: [resetRespiratoryMissionStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":respiratoryMissionId",
|
path: ":respiratoryMissionId",
|
||||||
name: "admin-unit-respiratory_mission-routing",
|
name: "admin-unit-respiratory_mission-routing",
|
||||||
component: () => import("@/views/admin/unit/respiratoryMission/RespiratoryMissionRouting.vue"),
|
component: () => import("@/views/admin/unit/respiratoryMission/RespiratoryMissionRouting.vue"),
|
||||||
beforeEnter: [] /** set respiratory_mission ID */,
|
beforeEnter: [setRespiratoryMissionId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -558,12 +569,13 @@ const router = createRouter({
|
||||||
path: "",
|
path: "",
|
||||||
name: "admin-unit-equipment_type",
|
name: "admin-unit-equipment_type",
|
||||||
component: () => import("@/views/admin/unit/equipmentType/EquipmentType.vue"),
|
component: () => import("@/views/admin/unit/equipmentType/EquipmentType.vue"),
|
||||||
|
beforeEnter: [resetEquipmentTypeStores],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ":equipmentTypeId",
|
path: ":equipmentTypeId",
|
||||||
name: "admin-unit-equipment_type-routing",
|
name: "admin-unit-equipment_type-routing",
|
||||||
component: () => import("@/views/admin/unit/equipmentType/EquipmentTypeRouting.vue"),
|
component: () => import("@/views/admin/unit/equipmentType/EquipmentTypeRouting.vue"),
|
||||||
beforeEnter: [] /** set equipment_type ID */,
|
beforeEnter: [setEquipmentTypeId],
|
||||||
props: true,
|
props: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { useBackupStore } from "../stores/admin/management/backup";
|
import { useBackupStore } from "@/stores/admin/management/backup";
|
||||||
|
|
||||||
export async function setBackupPage(to: any, from: any, next: any) {
|
export async function setBackupPage(to: any, from: any, next: any) {
|
||||||
const backup = useBackupStore();
|
const backup = useBackupStore();
|
20
src/router/unit/equipment.ts
Normal file
20
src/router/unit/equipment.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
||||||
|
|
||||||
|
export async function setEquipmentId(to: any, from: any, next: any) {
|
||||||
|
const EquipmentStore = useEquipmentStore();
|
||||||
|
EquipmentStore.activeEquipment = to.params?.equipmentId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetEquipmentStores(to: any, from: any, next: any) {
|
||||||
|
const EquipmentStore = useEquipmentStore();
|
||||||
|
EquipmentStore.activeEquipment = null;
|
||||||
|
EquipmentStore.activeEquipmentObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
20
src/router/unit/equipmentType.ts
Normal file
20
src/router/unit/equipmentType.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useEquipmentTypeStore } from "@/stores/admin/unit/equipmentType/equipmentType";
|
||||||
|
|
||||||
|
export async function setEquipmentTypeId(to: any, from: any, next: any) {
|
||||||
|
const equipmentTypeStore = useEquipmentTypeStore();
|
||||||
|
equipmentTypeStore.activeEquipmentType = to.params?.equipmentTypeId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetEquipmentTypeStores(to: any, from: any, next: any) {
|
||||||
|
const equipmentTypeStore = useEquipmentTypeStore();
|
||||||
|
equipmentTypeStore.activeEquipmentType = null;
|
||||||
|
equipmentTypeStore.activeEquipmentTypeObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
20
src/router/unit/respiratoryGear.ts
Normal file
20
src/router/unit/respiratoryGear.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
|
||||||
|
|
||||||
|
export async function setRespiratoryGearId(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryGearStore = useRespiratoryGearStore();
|
||||||
|
RespiratoryGearStore.activeRespiratoryGear = to.params?.respiratoryGearId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetRespiratoryGearStores(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryGearStore = useRespiratoryGearStore();
|
||||||
|
RespiratoryGearStore.activeRespiratoryGear = null;
|
||||||
|
RespiratoryGearStore.activeRespiratoryGearObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
20
src/router/unit/respiratoryMission.ts
Normal file
20
src/router/unit/respiratoryMission.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
|
||||||
|
|
||||||
|
export async function setRespiratoryMissionId(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryMissionStore = useRespiratoryMissionStore();
|
||||||
|
RespiratoryMissionStore.activeRespiratoryMission = to.params?.respiratoryMissionId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetRespiratoryMissionStores(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryMissionStore = useRespiratoryMissionStore();
|
||||||
|
RespiratoryMissionStore.activeRespiratoryMission = null;
|
||||||
|
RespiratoryMissionStore.activeRespiratoryMissionObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
20
src/router/unit/respiratoryWearer.ts
Normal file
20
src/router/unit/respiratoryWearer.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
|
||||||
|
|
||||||
|
export async function setRespiratoryWearerId(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryWearerStore = useRespiratoryWearerStore();
|
||||||
|
RespiratoryWearerStore.activeRespiratoryWearer = to.params?.respiratoryWearerId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetRespiratoryWearerStores(to: any, from: any, next: any) {
|
||||||
|
const RespiratoryWearerStore = useRespiratoryWearerStore();
|
||||||
|
RespiratoryWearerStore.activeRespiratoryWearer = null;
|
||||||
|
RespiratoryWearerStore.activeRespiratoryWearerObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
20
src/router/unit/vehicle.ts
Normal file
20
src/router/unit/vehicle.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import { useVehicleStore } from "@/stores/admin/unit/vehicle/vehicle";
|
||||||
|
|
||||||
|
export async function setVehicleId(to: any, from: any, next: any) {
|
||||||
|
const VehicleStore = useVehicleStore();
|
||||||
|
VehicleStore.activeVehicle = to.params?.vehicleId ?? null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resetVehicleStores(to: any, from: any, next: any) {
|
||||||
|
const VehicleStore = useVehicleStore();
|
||||||
|
VehicleStore.activeVehicle = null;
|
||||||
|
VehicleStore.activeVehicleObj = null;
|
||||||
|
|
||||||
|
//useXYStore().$reset();
|
||||||
|
|
||||||
|
next();
|
||||||
|
}
|
|
@ -6,6 +6,8 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
} from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import type { VehicleViewModel } from "../../../../viewmodels/admin/unit/vehicle/vehicle.models";
|
||||||
|
import { damageReportDemoData } from "../../../../demodata/damageReport";
|
||||||
|
|
||||||
export const useDamageReportStore = defineStore("damageReport", {
|
export const useDamageReportStore = defineStore("damageReport", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -13,11 +15,14 @@ export const useDamageReportStore = defineStore("damageReport", {
|
||||||
damageReports: [] as Array<DamageReportViewModel & { tab_pos: number }>,
|
damageReports: [] as Array<DamageReportViewModel & { tab_pos: number }>,
|
||||||
totalCount: 0 as number,
|
totalCount: 0 as number,
|
||||||
loading: "loading" as "loading" | "fetched" | "failed",
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
loadingActive: "loading" as "loading" | "fetched" | "failed",
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchDamageReports(offset = 0, count = 25, search = "", clear = false) {
|
fetchDamageReports(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.damageReports = damageReportDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.damageReports.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.damageReports = [];
|
if (clear) this.damageReports = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -63,9 +68,6 @@ export const useDamageReportStore = defineStore("damageReport", {
|
||||||
fetchDamageReportById(id: string) {
|
fetchDamageReportById(id: string) {
|
||||||
return http.get(`/admin/damageReport/${id}`);
|
return http.get(`/admin/damageReport/${id}`);
|
||||||
},
|
},
|
||||||
fetchDamageReportStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/damageReport/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createDamageReport(damageReport: CreateDamageReportViewModel): Promise<AxiosResponse<any, any>> {
|
async createDamageReport(damageReport: CreateDamageReportViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/damageReport`, {
|
const result = await http.post(`/admin/damageReport`, {
|
||||||
// TODO: data
|
// TODO: data
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/equipment/equipment.models";
|
} from "@/viewmodels/admin/unit/equipment/equipment.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { equipmentDemoData } from "../../../../demodata/equipment";
|
||||||
|
|
||||||
export const useEquipmentStore = defineStore("equipment", {
|
export const useEquipmentStore = defineStore("equipment", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useEquipmentStore = defineStore("equipment", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchEquipments(offset = 0, count = 25, search = "", clear = false) {
|
fetchEquipments(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.equipments = equipmentDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.equipments.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.equipments = [];
|
if (clear) this.equipments = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -63,6 +68,9 @@ export const useEquipmentStore = defineStore("equipment", {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchEquipmentByActiveId() {
|
fetchEquipmentByActiveId() {
|
||||||
|
this.activeEquipmentObj = equipmentDemoData.find((e) => e.id == this.activeEquipment) as EquipmentViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/equipment/${this.activeEquipment}`)
|
.get(`/admin/equipment/${this.activeEquipment}`)
|
||||||
|
@ -77,14 +85,6 @@ export const useEquipmentStore = defineStore("equipment", {
|
||||||
fetchEquipmentById(id: string) {
|
fetchEquipmentById(id: string) {
|
||||||
return http.get(`/admin/equipment/${id}`);
|
return http.get(`/admin/equipment/${id}`);
|
||||||
},
|
},
|
||||||
async printEquipmentByActiveId() {
|
|
||||||
return http.get(`/admin/equipment/${this.activeEquipment}/print`, {
|
|
||||||
responseType: "blob",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fetchEquipmentStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/equipment/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createEquipment(equipment: CreateEquipmentViewModel): Promise<AxiosResponse<any, any>> {
|
async createEquipment(equipment: CreateEquipmentViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/equipment`, {
|
const result = await http.post(`/admin/equipment`, {
|
||||||
// TODO: data
|
// TODO: data
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
} from "@/viewmodels/admin/unit/equipmentType/equipmentType.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { equipmentTypeDemoData } from "../../../../demodata/equipmentType";
|
||||||
|
|
||||||
export const useEquipmentTypeStore = defineStore("equipmentType", {
|
export const useEquipmentTypeStore = defineStore("equipmentType", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useEquipmentTypeStore = defineStore("equipmentType", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchEquipmentTypes(offset = 0, count = 25, search = "", clear = false) {
|
fetchEquipmentTypes(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.equipmentTypes = equipmentTypeDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.equipmentTypes.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.equipmentTypes = [];
|
if (clear) this.equipmentTypes = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -48,21 +53,17 @@ export const useEquipmentTypeStore = defineStore("equipmentType", {
|
||||||
return { ...res, data: res.data.equipments };
|
return { ...res, data: res.data.equipments };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getEquipmentTypesByIds(ids: Array<string>): Promise<AxiosResponse<any, any>> {
|
|
||||||
return await http
|
|
||||||
.post(`/admin/equipmentType/ids`, {
|
|
||||||
ids,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
return { ...res, data: res.data.equipments };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async searchEquipmentTypes(search: string): Promise<AxiosResponse<any, any>> {
|
async searchEquipmentTypes(search: string): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.get(`/admin/equipmentType?search=${search}&noLimit=true`).then((res) => {
|
return await http.get(`/admin/equipmentType?search=${search}&noLimit=true`).then((res) => {
|
||||||
return { ...res, data: res.data.equipments };
|
return { ...res, data: res.data.equipments };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchEquipmentTypeByActiveId() {
|
fetchEquipmentTypeByActiveId() {
|
||||||
|
this.activeEquipmentTypeObj = equipmentTypeDemoData.find(
|
||||||
|
(e) => e.id == this.activeEquipmentType
|
||||||
|
) as EquipmentTypeViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/equipmentType/${this.activeEquipmentType}`)
|
.get(`/admin/equipmentType/${this.activeEquipmentType}`)
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
} from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { respiratoryGearDemoData } from "../../../../demodata/respiratoryGear";
|
||||||
|
|
||||||
export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchRespiratoryGears(offset = 0, count = 25, search = "", clear = false) {
|
fetchRespiratoryGears(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.respiratoryGears = respiratoryGearDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.respiratoryGears.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.respiratoryGears = [];
|
if (clear) this.respiratoryGears = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -48,21 +53,17 @@ export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
||||||
return { ...res, data: res.data.respiratoryGears };
|
return { ...res, data: res.data.respiratoryGears };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getRespiratoryGearsByIds(ids: Array<string>): Promise<AxiosResponse<any, any>> {
|
|
||||||
return await http
|
|
||||||
.post(`/admin/respiratoryGear/ids`, {
|
|
||||||
ids,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
return { ...res, data: res.data.respiratoryGears };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async searchRespiratoryGears(search: string): Promise<AxiosResponse<any, any>> {
|
async searchRespiratoryGears(search: string): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.get(`/admin/respiratoryGear?search=${search}&noLimit=true`).then((res) => {
|
return await http.get(`/admin/respiratoryGear?search=${search}&noLimit=true`).then((res) => {
|
||||||
return { ...res, data: res.data.respiratoryGears };
|
return { ...res, data: res.data.respiratoryGears };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchRespiratoryGearByActiveId() {
|
fetchRespiratoryGearByActiveId() {
|
||||||
|
this.activeRespiratoryGearObj = respiratoryGearDemoData.find(
|
||||||
|
(e) => e.id == this.activeRespiratoryGear
|
||||||
|
) as RespiratoryGearViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/respiratoryGear/${this.activeRespiratoryGear}`)
|
.get(`/admin/respiratoryGear/${this.activeRespiratoryGear}`)
|
||||||
|
@ -77,14 +78,6 @@ export const useRespiratoryGearStore = defineStore("respiratoryGear", {
|
||||||
fetchRespiratoryGearById(id: string) {
|
fetchRespiratoryGearById(id: string) {
|
||||||
return http.get(`/admin/respiratoryGear/${id}`);
|
return http.get(`/admin/respiratoryGear/${id}`);
|
||||||
},
|
},
|
||||||
async printRespiratoryGearByActiveId() {
|
|
||||||
return http.get(`/admin/respiratoryGear/${this.activeRespiratoryGear}/print`, {
|
|
||||||
responseType: "blob",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fetchRespiratoryGearStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/respiratoryGear/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createRespiratoryGear(respiratoryGear: CreateRespiratoryGearViewModel): Promise<AxiosResponse<any, any>> {
|
async createRespiratoryGear(respiratoryGear: CreateRespiratoryGearViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/respiratoryGear`, {
|
const result = await http.post(`/admin/respiratoryGear`, {
|
||||||
// TODO: data
|
// TODO: data
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
} from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { respiratoryMissionDemoData } from "../../../../demodata/respiratoryMission";
|
||||||
|
|
||||||
export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchRespiratoryMissions(offset = 0, count = 25, search = "", clear = false) {
|
fetchRespiratoryMissions(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.respiratoryMissions = respiratoryMissionDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.respiratoryMissions.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.respiratoryMissions = [];
|
if (clear) this.respiratoryMissions = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -52,21 +57,17 @@ export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
||||||
return { ...res, data: res.data.respiratoryMissions };
|
return { ...res, data: res.data.respiratoryMissions };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getRespiratoryMissionsByIds(ids: Array<string>): Promise<AxiosResponse<any, any>> {
|
|
||||||
return await http
|
|
||||||
.post(`/admin/respiratoryMission/ids`, {
|
|
||||||
ids,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
return { ...res, data: res.data.respiratoryMissions };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async searchRespiratoryMissions(search: string): Promise<AxiosResponse<any, any>> {
|
async searchRespiratoryMissions(search: string): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.get(`/admin/respiratoryMission?search=${search}&noLimit=true`).then((res) => {
|
return await http.get(`/admin/respiratoryMission?search=${search}&noLimit=true`).then((res) => {
|
||||||
return { ...res, data: res.data.respiratoryMissions };
|
return { ...res, data: res.data.respiratoryMissions };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchRespiratoryMissionByActiveId() {
|
fetchRespiratoryMissionByActiveId() {
|
||||||
|
this.activeRespiratoryMissionObj = this.respiratoryMissions.find(
|
||||||
|
(e) => e.id == this.activeRespiratoryMission
|
||||||
|
) as RespiratoryMissionViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/respiratoryMission/${this.activeRespiratoryMission}`)
|
.get(`/admin/respiratoryMission/${this.activeRespiratoryMission}`)
|
||||||
|
@ -81,14 +82,6 @@ export const useRespiratoryMissionStore = defineStore("respiratoryMission", {
|
||||||
fetchRespiratoryMissionById(id: string) {
|
fetchRespiratoryMissionById(id: string) {
|
||||||
return http.get(`/admin/respiratoryMission/${id}`);
|
return http.get(`/admin/respiratoryMission/${id}`);
|
||||||
},
|
},
|
||||||
async printRespiratoryMissionByActiveId() {
|
|
||||||
return http.get(`/admin/respiratoryMission/${this.activeRespiratoryMission}/print`, {
|
|
||||||
responseType: "blob",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fetchRespiratoryMissionStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/respiratoryMission/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createRespiratoryMission(
|
async createRespiratoryMission(
|
||||||
respiratoryMission: CreateRespiratoryMissionViewModel
|
respiratoryMission: CreateRespiratoryMissionViewModel
|
||||||
): Promise<AxiosResponse<any, any>> {
|
): Promise<AxiosResponse<any, any>> {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
} from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { respiratoryWearerDemoData } from "../../../../demodata/respiratoryWearer";
|
||||||
|
|
||||||
export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchRespiratoryWearers(offset = 0, count = 25, search = "", clear = false) {
|
fetchRespiratoryWearers(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.respiratoryWearers = respiratoryWearerDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.respiratoryWearers.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.respiratoryWearers = [];
|
if (clear) this.respiratoryWearers = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -52,21 +57,17 @@ export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
||||||
return { ...res, data: res.data.respiratoryWearers };
|
return { ...res, data: res.data.respiratoryWearers };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getRespiratoryWearersByIds(ids: Array<string>): Promise<AxiosResponse<any, any>> {
|
|
||||||
return await http
|
|
||||||
.post(`/admin/respiratoryWearer/ids`, {
|
|
||||||
ids,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
return { ...res, data: res.data.respiratoryWearers };
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async searchRespiratoryWearers(search: string): Promise<AxiosResponse<any, any>> {
|
async searchRespiratoryWearers(search: string): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.get(`/admin/respiratoryWearer?search=${search}&noLimit=true`).then((res) => {
|
return await http.get(`/admin/respiratoryWearer?search=${search}&noLimit=true`).then((res) => {
|
||||||
return { ...res, data: res.data.respiratoryWearers };
|
return { ...res, data: res.data.respiratoryWearers };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchRespiratoryWearerByActiveId() {
|
fetchRespiratoryWearerByActiveId() {
|
||||||
|
this.activeRespiratoryWearerObj = respiratoryWearerDemoData.find(
|
||||||
|
(e) => e.id == this.activeRespiratoryWearer
|
||||||
|
) as RespiratoryWearerViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/respiratoryWearer/${this.activeRespiratoryWearer}`)
|
.get(`/admin/respiratoryWearer/${this.activeRespiratoryWearer}`)
|
||||||
|
@ -81,14 +82,6 @@ export const useRespiratoryWearerStore = defineStore("respiratoryWearer", {
|
||||||
fetchRespiratoryWearerById(id: string) {
|
fetchRespiratoryWearerById(id: string) {
|
||||||
return http.get(`/admin/respiratoryWearer/${id}`);
|
return http.get(`/admin/respiratoryWearer/${id}`);
|
||||||
},
|
},
|
||||||
async printRespiratoryWearerByActiveId() {
|
|
||||||
return http.get(`/admin/respiratoryWearer/${this.activeRespiratoryWearer}/print`, {
|
|
||||||
responseType: "blob",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fetchRespiratoryWearerStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/respiratoryWearer/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createRespiratoryWearer(
|
async createRespiratoryWearer(
|
||||||
respiratoryWearer: CreateRespiratoryWearerViewModel
|
respiratoryWearer: CreateRespiratoryWearerViewModel
|
||||||
): Promise<AxiosResponse<any, any>> {
|
): Promise<AxiosResponse<any, any>> {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
} from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
} from "@/viewmodels/admin/unit/vehicle/vehicle.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
|
import { vehicleDemoData } from "../../../../demodata/vehicle";
|
||||||
|
|
||||||
export const useVehicleStore = defineStore("vehicle", {
|
export const useVehicleStore = defineStore("vehicle", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -20,6 +21,10 @@ export const useVehicleStore = defineStore("vehicle", {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchVehicles(offset = 0, count = 25, search = "", clear = false) {
|
fetchVehicles(offset = 0, count = 25, search = "", clear = false) {
|
||||||
|
this.vehicles = vehicleDemoData.map((e, i) => ({ ...e, tab_pos: i }));
|
||||||
|
this.totalCount = this.vehicles.length;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
if (clear) this.vehicles = [];
|
if (clear) this.vehicles = [];
|
||||||
this.loading = "loading";
|
this.loading = "loading";
|
||||||
http
|
http
|
||||||
|
@ -63,6 +68,9 @@ export const useVehicleStore = defineStore("vehicle", {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchVehicleByActiveId() {
|
fetchVehicleByActiveId() {
|
||||||
|
this.activeVehicleObj = vehicleDemoData.find((e) => e.id == this.activeVehicle) as VehicleViewModel;
|
||||||
|
this.loading = "fetched";
|
||||||
|
return;
|
||||||
this.loadingActive = "loading";
|
this.loadingActive = "loading";
|
||||||
http
|
http
|
||||||
.get(`/admin/vehicle/${this.activeVehicle}`)
|
.get(`/admin/vehicle/${this.activeVehicle}`)
|
||||||
|
@ -77,14 +85,6 @@ export const useVehicleStore = defineStore("vehicle", {
|
||||||
fetchVehicleById(id: string) {
|
fetchVehicleById(id: string) {
|
||||||
return http.get(`/admin/vehicle/${id}`);
|
return http.get(`/admin/vehicle/${id}`);
|
||||||
},
|
},
|
||||||
async printVehicleByActiveId() {
|
|
||||||
return http.get(`/admin/vehicle/${this.activeVehicle}/print`, {
|
|
||||||
responseType: "blob",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fetchVehicleStatisticsById(id: string) {
|
|
||||||
return http.get(`/admin/vehicle/${id}/statistics`);
|
|
||||||
},
|
|
||||||
async createVehicle(vehicle: CreateVehicleViewModel): Promise<AxiosResponse<any, any>> {
|
async createVehicle(vehicle: CreateVehicleViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/vehicle`, {
|
const result = await http.post(`/admin/vehicle`, {
|
||||||
// TODO: data
|
// TODO: data
|
||||||
|
|
|
@ -4,6 +4,7 @@ export interface DamageReportViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
reported: Date;
|
reported: Date;
|
||||||
status: string;
|
status: string;
|
||||||
|
done: boolean;
|
||||||
description: string;
|
description: string;
|
||||||
affectedEquipmentId: string;
|
affectedEquipmentId: string;
|
||||||
affectedEquipment: EquipmentViewModel;
|
affectedEquipment: EquipmentViewModel;
|
||||||
|
@ -17,4 +18,5 @@ export interface CreateDamageReportViewModel {
|
||||||
export interface UpdateDamageReportViewModel {
|
export interface UpdateDamageReportViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
done: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
export interface VehicleViewModel {
|
export interface VehicleViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateVehicleViewModel {
|
export interface CreateVehicleViewModel {
|
||||||
name: string;
|
name: string;
|
||||||
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateVehicleViewModel {
|
export interface UpdateVehicleViewModel {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<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">
|
<h1 class="font-bold text-xl h-8 min-h-fit grow">
|
||||||
{{ activeVehicleObj?.lastname }}, {{ activeVehicleObj?.firstname }}
|
{{ activeVehicleObj?.name }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<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' }">
|
||||||
|
|
Loading…
Add table
Reference in a new issue