base components on collections
This commit is contained in:
parent
b6d6dd0796
commit
3e87bbc267
24 changed files with 1347 additions and 57 deletions
|
@ -6,7 +6,38 @@
|
|||
</div>
|
||||
</template>
|
||||
<template #diffMain>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-center px-7"></div>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-center px-7">
|
||||
<div class="w-full flex flex-row max-lg:flex-wrap justify-center">
|
||||
<div
|
||||
v-for="tab in tabs"
|
||||
:key="tab.route"
|
||||
@click="isActive = tab.route"
|
||||
class="w-1/2 md:w-1/3 lg:w-full p-0.5 first:pl-0 last:pr-0 cursor-pointer"
|
||||
>
|
||||
<p
|
||||
:class="[
|
||||
'w-full rounded-lg py-2.5 text-sm text-center font-medium leading-5 focus:ring-0 outline-none',
|
||||
isActive == tab.route
|
||||
? 'bg-red-200 shadow border-b-2 border-primary rounded-b-none'
|
||||
: ' hover:bg-red-200',
|
||||
]"
|
||||
>
|
||||
{{ tab.title }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Pagination
|
||||
:items="damageReports"
|
||||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
@load-data="(offset, count, search) => fetchDamageReports(offset, count, search)"
|
||||
@search="(search) => fetchDamageReports(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
<template #pageRow="{ row }: { row: DamageReportViewModel }">
|
||||
<DamageReportListItem :damageReport="row" />
|
||||
</template>
|
||||
</Pagination>
|
||||
</div>
|
||||
</template>
|
||||
</MainTemplate>
|
||||
</template>
|
||||
|
@ -15,12 +46,35 @@
|
|||
import { defineComponent } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import { useDamageReportStore } from "@/stores/admin/unit/damageReport/damageReport";
|
||||
import type { DamageReportViewModel } from "@/viewmodels/admin/unit/damageReport/damageReport.models";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import DamageReportListItem from "../../../../components/admin/unit/damageReport/DamageReportListItem.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
tabs: [
|
||||
{ route: "overview", title: "offen" },
|
||||
{ route: "membership", title: "bearbeitet" },
|
||||
],
|
||||
isActive: "overview",
|
||||
currentPage: 0,
|
||||
maxEntriesPerPage: 25,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useDamageReportStore, ["damageReports", "totalCount", "loading"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchDamageReports(0, this.maxEntriesPerPage, "", true);
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useDamageReportStore, ["fetchDamageReports"]),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
useSearch
|
||||
useScanner
|
||||
@load-data="(offset, count, search) => fetchEquipmentTypes(offset, count, search)"
|
||||
@search="(search) => fetchEquipmentTypes(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
|
|
|
@ -8,16 +8,15 @@
|
|||
<template #diffMain>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-center px-7">
|
||||
<Pagination
|
||||
:items="equipments"
|
||||
:items="respiratoryGears"
|
||||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
useSearch
|
||||
useScanner
|
||||
@load-data="(offset, count, search) => fetchEquipments(offset, count, search)"
|
||||
@search="(search) => fetchEquipments(0, maxEntriesPerPage, search, true)"
|
||||
@load-data="(offset, count, search) => fetchRespiratoryGears(offset, count, search)"
|
||||
@search="(search) => fetchRespiratoryGears(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
<template #pageRow="{ row }: { row: EquipmentViewModel }">
|
||||
<EquipmentListItem :equipment="row" />
|
||||
<template #pageRow="{ row }: { row: RespiratoryGearViewModel }">
|
||||
<RespiratoryGearListItem :respiratoryGear="row" />
|
||||
</template>
|
||||
</Pagination>
|
||||
|
||||
|
@ -35,12 +34,12 @@
|
|||
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
||||
import { useRespiratoryGearStore } from "@/stores/admin/unit/respiratoryGear/respiratoryGear";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { EquipmentViewModel } from "../../../../viewmodels/admin/unit/equipment/equipment.models";
|
||||
import EquipmentListItem from "../../../../components/admin/unit/equipment/EquipmentListItem.vue";
|
||||
import type { RespiratoryGearViewModel } from "@/viewmodels/admin/unit/respiratoryGear/respiratoryGear.models";
|
||||
import RespiratoryGearListItem from "@/components/admin/unit/respiratoryGear/RespiratoryGearListItem.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -52,18 +51,20 @@ export default defineComponent({
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useEquipmentStore, ["equipments", "totalCount", "loading"]),
|
||||
...mapState(useRespiratoryGearStore, ["respiratoryGears", "totalCount", "loading"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchEquipments(0, this.maxEntriesPerPage, "", true);
|
||||
this.fetchRespiratoryGears(0, this.maxEntriesPerPage, "", true);
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useEquipmentStore, ["fetchEquipments"]),
|
||||
...mapActions(useRespiratoryGearStore, ["fetchRespiratoryGears"]),
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openCreateModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/equipment/CreateEquipmentModal.vue")))
|
||||
markRaw(
|
||||
defineAsyncComponent(() => import("@/components/admin/unit/respiratoryGear/CreateRespiratoryGearModal.vue"))
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -8,16 +8,15 @@
|
|||
<template #diffMain>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-center px-7">
|
||||
<Pagination
|
||||
:items="equipments"
|
||||
:items="respiratoryMissions"
|
||||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
useSearch
|
||||
useScanner
|
||||
@load-data="(offset, count, search) => fetchEquipments(offset, count, search)"
|
||||
@search="(search) => fetchEquipments(0, maxEntriesPerPage, search, true)"
|
||||
@load-data="(offset, count, search) => fetchRespiratoryMissions(offset, count, search)"
|
||||
@search="(search) => fetchRespiratoryMissions(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
<template #pageRow="{ row }: { row: EquipmentViewModel }">
|
||||
<EquipmentListItem :equipment="row" />
|
||||
<template #pageRow="{ row }: { row: RespiratoryMissionViewModel }">
|
||||
<RespiratoryMissionListItem :respiratoryMission="row" />
|
||||
</template>
|
||||
</Pagination>
|
||||
|
||||
|
@ -35,12 +34,12 @@
|
|||
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
||||
import { useRespiratoryMissionStore } from "@/stores/admin/unit/respiratoryMission/respiratoryMission";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { EquipmentViewModel } from "../../../../viewmodels/admin/unit/equipment/equipment.models";
|
||||
import EquipmentListItem from "../../../../components/admin/unit/equipment/EquipmentListItem.vue";
|
||||
import type { RespiratoryMissionViewModel } from "@/viewmodels/admin/unit/respiratoryMission/respiratoryMission.models";
|
||||
import RespiratoryMissionListItem from "@/components/admin/unit/respiratoryMission/RespiratoryMissionListItem.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -52,18 +51,22 @@ export default defineComponent({
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useEquipmentStore, ["equipments", "totalCount", "loading"]),
|
||||
...mapState(useRespiratoryMissionStore, ["respiratoryMissions", "totalCount", "loading"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchEquipments(0, this.maxEntriesPerPage, "", true);
|
||||
this.fetchRespiratoryMissions(0, this.maxEntriesPerPage, "", true);
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useEquipmentStore, ["fetchEquipments"]),
|
||||
...mapActions(useRespiratoryMissionStore, ["fetchRespiratoryMissions"]),
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openCreateModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/equipment/CreateEquipmentModal.vue")))
|
||||
markRaw(
|
||||
defineAsyncComponent(
|
||||
() => import("@/components/admin/unit/respiratoryMission/CreateRespiratoryMissionModal.vue")
|
||||
)
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -8,16 +8,15 @@
|
|||
<template #diffMain>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-center px-7">
|
||||
<Pagination
|
||||
:items="equipments"
|
||||
:items="respiratoryWearers"
|
||||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
useSearch
|
||||
useScanner
|
||||
@load-data="(offset, count, search) => fetchEquipments(offset, count, search)"
|
||||
@search="(search) => fetchEquipments(0, maxEntriesPerPage, search, true)"
|
||||
@load-data="(offset, count, search) => fetchRespiratoryWearers(offset, count, search)"
|
||||
@search="(search) => fetchRespiratoryWearers(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
<template #pageRow="{ row }: { row: EquipmentViewModel }">
|
||||
<EquipmentListItem :equipment="row" />
|
||||
<template #pageRow="{ row }: { row: RespiratoryWearerViewModel }">
|
||||
<RespiratoryWearerListItem :respiratoryWearer="row" />
|
||||
</template>
|
||||
</Pagination>
|
||||
|
||||
|
@ -35,12 +34,12 @@
|
|||
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||
import { mapActions, mapState } from "pinia";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import { useEquipmentStore } from "@/stores/admin/unit/equipment/equipment";
|
||||
import { useRespiratoryWearerStore } from "@/stores/admin/unit/respiratoryWearer/respiratoryWearer";
|
||||
import { useModalStore } from "@/stores/modal";
|
||||
import Pagination from "@/components/Pagination.vue";
|
||||
import { useAbilityStore } from "@/stores/ability";
|
||||
import type { EquipmentViewModel } from "../../../../viewmodels/admin/unit/equipment/equipment.models";
|
||||
import EquipmentListItem from "../../../../components/admin/unit/equipment/EquipmentListItem.vue";
|
||||
import type { RespiratoryWearerViewModel } from "@/viewmodels/admin/unit/respiratoryWearer/respiratoryWearer.models";
|
||||
import RespiratoryWearerListItem from "@/components/admin/unit/respiratoryWearer/RespiratoryWearerListItem.vue";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
@ -52,18 +51,22 @@ export default defineComponent({
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(useEquipmentStore, ["equipments", "totalCount", "loading"]),
|
||||
...mapState(useRespiratoryWearerStore, ["respiratoryWearers", "totalCount", "loading"]),
|
||||
...mapState(useAbilityStore, ["can"]),
|
||||
},
|
||||
mounted() {
|
||||
this.fetchEquipments(0, this.maxEntriesPerPage, "", true);
|
||||
this.fetchRespiratoryWearers(0, this.maxEntriesPerPage, "", true);
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useEquipmentStore, ["fetchEquipments"]),
|
||||
...mapActions(useRespiratoryWearerStore, ["fetchRespiratoryWearers"]),
|
||||
...mapActions(useModalStore, ["openModal"]),
|
||||
openCreateModal() {
|
||||
this.openModal(
|
||||
markRaw(defineAsyncComponent(() => import("@/components/admin/unit/equipment/CreateEquipmentModal.vue")))
|
||||
markRaw(
|
||||
defineAsyncComponent(
|
||||
() => import("@/components/admin/unit/respiratoryWearer/CreateRespiratoryWearerModal.vue")
|
||||
)
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
:totalCount="totalCount"
|
||||
:indicateLoading="loading == 'loading'"
|
||||
useSearch
|
||||
useScanner
|
||||
@load-data="(offset, count, search) => fetchVehicles(offset, count, search)"
|
||||
@search="(search) => fetchVehicles(0, maxEntriesPerPage, search, true)"
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue