diff --git a/src/components/admin/club/member/MemberNameListModal.vue b/src/components/admin/club/member/MemberPrintModal.vue similarity index 80% rename from src/components/admin/club/member/MemberNameListModal.vue rename to src/components/admin/club/member/MemberPrintModal.vue index dab66ad..6558751 100644 --- a/src/components/admin/club/member/MemberNameListModal.vue +++ b/src/components/admin/club/member/MemberPrintModal.vue @@ -9,7 +9,6 @@ download - @@ -31,25 +30,29 @@ export default defineComponent({ }, computed: { ...mapState(useModalStore, ["data"]), + ...mapState(useMemberStore, ["activeMemberObj"]), }, mounted() { this.fetchItem(); }, methods: { ...mapActions(useModalStore, ["closeModal"]), - ...mapActions(useMemberStore, ["printMemberList"]), + ...mapActions(useMemberStore, ["printMemberByActiveId"]), fetchItem() { this.status = "loading"; - this.printMemberList() + this.printMemberByActiveId() .then((response) => { this.status = { status: "success" }; const blob = new Blob([response.data], { type: "application/pdf" }); (this.$refs.viewer as HTMLIFrameElement).src = window.URL.createObjectURL(blob); const fileURL = window.URL.createObjectURL(new Blob([response.data])); - const fileLink = (this.$refs.download as HTMLAnchorElement) + const fileLink = this.$refs.download as HTMLAnchorElement; fileLink.href = fileURL; - fileLink.setAttribute("download", "Mitgliederliste.pdf"); + fileLink.setAttribute( + "download", + `Mitglied-Ausdruck ${this.activeMemberObj?.firstname}_${this.activeMemberObj?.lastname}.pdf` + ); }) .catch(() => { this.status = { status: "failed" }; diff --git a/src/components/admin/configuration/templateUsage/TemplateUsageListItem.vue b/src/components/admin/configuration/templateUsage/TemplateUsageListItem.vue index 021b55d..9b2b462 100644 --- a/src/components/admin/configuration/templateUsage/TemplateUsageListItem.vue +++ b/src/components/admin/configuration/templateUsage/TemplateUsageListItem.vue @@ -42,10 +42,11 @@

Höhe [mm]:

@@ -71,10 +72,11 @@

Höhe [mm]:

@@ -134,8 +136,8 @@ export default defineComponent({ const headerId = fromData.header.value === "def" ? null : fromData.header.value; const bodyId = fromData.body.value === "def" ? null : fromData.body.value; const footerId = fromData.footer.value === "def" ? null : fromData.footer.value; - const headerHeight = fromData.footer.value === "" ? null : parseInt(fromData.headerHeight.value); - const footerHeight = fromData.footer.value === "" ? null : parseInt(fromData.footerHeight.value); + const headerHeight = fromData.headerHeight.value === "" ? null : parseInt(fromData.headerHeight.value); + const footerHeight = fromData.footerHeight.value === "" ? null : parseInt(fromData.footerHeight.value); this.status = "loading"; this.updateTemplateUsage({ @@ -160,6 +162,8 @@ export default defineComponent({ (this.$refs.header as HTMLSelectElement).value = String(this.templateUsage.header?.id ?? "def"); (this.$refs.body as HTMLSelectElement).value = String(this.templateUsage.body?.id ?? "def"); (this.$refs.footer as HTMLSelectElement).value = String(this.templateUsage.footer?.id ?? "def"); + (this.$refs.headerHeight as HTMLInputElement).value = (this.templateUsage.headerHeight ?? "").toString(); + (this.$refs.footerHeight as HTMLInputElement).value = (this.templateUsage.footerHeight ?? "").toString(); }, }, }); diff --git a/src/router/index.ts b/src/router/index.ts index 6defe12..e2e484c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -295,6 +295,13 @@ const router = createRouter({ meta: { type: "read", section: "club", module: "query" }, beforeEnter: [abilityAndNavUpdate], }, + { + path: "listprint", + name: "admin-club-listprint", + component: () => import("@/views/admin/club/listprint/ListPrint.vue"), + meta: { type: "read", section: "club", module: "listprint" }, + beforeEnter: [abilityAndNavUpdate], + }, ], }, { diff --git a/src/stores/admin/club/listprint.ts b/src/stores/admin/club/listprint.ts new file mode 100644 index 0000000..65f6cff --- /dev/null +++ b/src/stores/admin/club/listprint.ts @@ -0,0 +1,40 @@ +import { defineStore } from "pinia"; +import { http } from "@/serverCom"; + +export const useListPrintStore = defineStore("listprint", { + actions: { + async printList({ + title, + queryStore, + headerId, + bodyId, + footerId, + headerHeight, + footerHeight, + }: { + title: string; + queryStore: string; + headerId?: string; + bodyId?: string; + footerId?: string; + headerHeight?: number; + footerHeight?: number; + }) { + return http.post( + `/admin/listprint`, + { + title, + queryStore, + headerId, + bodyId, + footerId, + headerHeight, + footerHeight, + }, + { + responseType: "blob", + } + ); + }, + }, +}); diff --git a/src/stores/admin/club/member/member.ts b/src/stores/admin/club/member/member.ts index 3f48547..30d778b 100644 --- a/src/stores/admin/club/member/member.ts +++ b/src/stores/admin/club/member/member.ts @@ -87,6 +87,11 @@ export const useMemberStore = defineStore("member", { }) .catch((err) => {}); }, + async printMemberByActiveId() { + return http.get(`/admin/member/${this.activeMember}/print`, { + responseType: "blob", + }); + }, fetchMemberStatisticsById(id: string) { return http.get(`/admin/member/${id}/statistics`); }, @@ -119,10 +124,5 @@ export const useMemberStore = defineStore("member", { this.fetchMembers(); return result; }, - async printMemberList() { - return http.get(`/admin/member/print/namelist`, { - responseType: "blob", - }); - }, }, }); diff --git a/src/stores/admin/club/protocol/protocolAgenda.ts b/src/stores/admin/club/protocol/protocolAgenda.ts index 68e48a8..b032a3a 100644 --- a/src/stores/admin/club/protocol/protocolAgenda.ts +++ b/src/stores/admin/club/protocol/protocolAgenda.ts @@ -54,6 +54,7 @@ export const useProtocolAgendaStore = defineStore("protocolAgenda", { id: Number(res.data), topic: "", context: "", + sort: this.agenda.length, protocolId: Number(protocolId), }); }) diff --git a/src/stores/admin/club/protocol/protocolDecision.ts b/src/stores/admin/club/protocol/protocolDecision.ts index 069cd74..ade8210 100644 --- a/src/stores/admin/club/protocol/protocolDecision.ts +++ b/src/stores/admin/club/protocol/protocolDecision.ts @@ -55,6 +55,7 @@ export const useProtocolDecisionStore = defineStore("protocolDecision", { id: Number(res.data), topic: "", context: "", + sort: this.decision.length, protocolId: Number(protocolId), }); }) diff --git a/src/stores/admin/club/protocol/protocolVoting.ts b/src/stores/admin/club/protocol/protocolVoting.ts index e5e797a..dd2c5fb 100644 --- a/src/stores/admin/club/protocol/protocolVoting.ts +++ b/src/stores/admin/club/protocol/protocolVoting.ts @@ -58,6 +58,7 @@ export const useProtocolVotingStore = defineStore("protocolVoting", { favour: 0, abstain: 0, against: 0, + sort: this.voting.length, protocolId: Number(protocolId), }); }) diff --git a/src/stores/admin/navigation.ts b/src/stores/admin/navigation.ts index c32fb96..cc9024a 100644 --- a/src/stores/admin/navigation.ts +++ b/src/stores/admin/navigation.ts @@ -92,6 +92,7 @@ export const useNavigationStore = defineStore("navigation", { ...(abilityStore.can("read", "club", "protocol") ? [{ key: "protocol", title: "Protokolle" }] : []), ...(abilityStore.can("read", "club", "newsletter") ? [{ key: "newsletter", title: "Newsletter" }] : []), ...(abilityStore.can("read", "club", "query") ? [{ key: "query_builder", title: "Query Builder" }] : []), + ...(abilityStore.can("read", "club", "listprint") ? [{ key: "listprint", title: "Liste Drucken" }] : []), ], }, configuration: { diff --git a/src/types/permissionTypes.ts b/src/types/permissionTypes.ts index a031c0e..e9ed138 100644 --- a/src/types/permissionTypes.ts +++ b/src/types/permissionTypes.ts @@ -6,6 +6,7 @@ export type PermissionModule = | "newsletter" | "newsletter_config" | "protocol" + | "listprint" | "qualification" | "award" | "executive_position" @@ -50,6 +51,7 @@ export const permissionModules: Array = [ "newsletter", "newsletter_config", "protocol", + "listprint", "qualification", "award", "executive_position", @@ -68,7 +70,7 @@ export const permissionModules: Array = [ ]; export const permissionTypes: Array = ["read", "create", "update", "delete"]; export const sectionsAndModules: SectionsAndModulesObject = { - club: ["member", "calendar", "newsletter", "protocol", "query"], + club: ["member", "calendar", "newsletter", "protocol", "query", "listprint"], configuration: [ "qualification", "award", diff --git a/src/viewmodels/admin/club/protocol/protocolAgenda.models.ts b/src/viewmodels/admin/club/protocol/protocolAgenda.models.ts index 6015315..1056b9a 100644 --- a/src/viewmodels/admin/club/protocol/protocolAgenda.models.ts +++ b/src/viewmodels/admin/club/protocol/protocolAgenda.models.ts @@ -2,6 +2,7 @@ export interface ProtocolAgendaViewModel { id: number; topic: string; context: string; + sort: number; protocolId: number; } @@ -9,4 +10,5 @@ export interface SyncProtocolAgendaViewModel { id?: number; topic: string; context: string; + sort?: number; } diff --git a/src/viewmodels/admin/club/protocol/protocolDecision.models.ts b/src/viewmodels/admin/club/protocol/protocolDecision.models.ts index 19e1d61..93775d5 100644 --- a/src/viewmodels/admin/club/protocol/protocolDecision.models.ts +++ b/src/viewmodels/admin/club/protocol/protocolDecision.models.ts @@ -2,6 +2,7 @@ export interface ProtocolDecisionViewModel { id: number; topic: string; context: string; + sort: number; protocolId: number; } @@ -9,4 +10,5 @@ export interface SyncProtocolDecisionViewModel { id?: number; topic: string; context: string; + sort?: number; } diff --git a/src/viewmodels/admin/club/protocol/protocolVoting.models.ts b/src/viewmodels/admin/club/protocol/protocolVoting.models.ts index cb61f68..c602588 100644 --- a/src/viewmodels/admin/club/protocol/protocolVoting.models.ts +++ b/src/viewmodels/admin/club/protocol/protocolVoting.models.ts @@ -5,6 +5,7 @@ export interface ProtocolVotingViewModel { favour: number; abstain: number; against: number; + sort: number; protocolId: number; } @@ -15,5 +16,5 @@ export interface SyncProtocolVotingViewModel { favour: number; abstain: number; against: number; - protocolId: number; + sort?: number; } diff --git a/src/views/admin/club/listprint/ListPrint.vue b/src/views/admin/club/listprint/ListPrint.vue new file mode 100644 index 0000000..b193917 --- /dev/null +++ b/src/views/admin/club/listprint/ListPrint.vue @@ -0,0 +1,155 @@ +