From 4cb6cb14e3eded0477f2ad990b378dee77ff7dfc Mon Sep 17 00:00:00 2001 From: julia221501 Date: Thu, 22 Sep 2022 09:43:03 +0200 Subject: [PATCH 1/2] =?UTF-8?q?NWK=20Ansichtseinstellungen=20an=20PDF=20?= =?UTF-8?q?=C3=BCbergeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SideMenu.vue | 23 +++++++++++++++++++++- src/views/Pdf.vue | 39 ++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/components/SideMenu.vue b/src/components/SideMenu.vue index 95dbe19..e1d35b7 100644 --- a/src/components/SideMenu.vue +++ b/src/components/SideMenu.vue @@ -74,7 +74,24 @@ Kennzahlen exportieren - + @@ -201,6 +218,10 @@ export default defineComponent({ toggleConnections: () => store.commit("view/toggle", "connections"), alteriNames: computed(() => store.state.view.alteriNames), toggleAlteriNames: () => store.commit("view/toggle", "alteriNames"), + showAge: computed(() => store.state.view.ageInNwk), + toggleAge: () => store.commit("view/toggle", "ageInNwk"), + showRole: computed(() => store.state.view.roleInNwk), + toggleRoleShort: () => store.commit("view/toggle", "roleInNwk"), }; }, }); diff --git a/src/views/Pdf.vue b/src/views/Pdf.vue index 0d6af2f..5f8b4b5 100644 --- a/src/views/Pdf.vue +++ b/src/views/Pdf.vue @@ -78,11 +78,12 @@ import NetworkMap from "@/components/NetworkMap.vue"; import { useStore } from "@/store"; import { defineComponent, computed, onMounted } from "vue"; +import { useRouter } from "vue-router"; export default defineComponent({ name: "Pdf", components: { NetworkMap }, - setup() { + setup: function () { const store = useStore(); // knows list of Alter from vuex const alteri = computed(() => store.state.nwk.alteri); @@ -92,15 +93,51 @@ export default defineComponent({ window.print(); }; + // TODO currently: workaround -> schönere Lösung + const readHttpGet = () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let pseudo: any = useRouter().currentRoute.value.query.pseudo; + pseudo = /true/i.test(pseudo); + pseudo ? store.commit("pseudonym/toggle") : ""; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let hor: any = useRouter().currentRoute.value.query.hor; + hor = /true/i.test(hor); + hor ? "" : store.commit("view/toggle", "horizons"); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let con: any = useRouter().currentRoute.value.query.con; + con = /true/i.test(con); + con ? "" : store.commit("view/toggle", "connections"); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let alt: any = useRouter().currentRoute.value.query.alt; + alt = /true/i.test(alt); + alt ? "" : store.commit("view/toggle", "alteriNames"); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let age: any = useRouter().currentRoute.value.query.age; + age = /true/i.test(age); + age ? store.commit("view/toggle", "ageInNwk") : ""; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let role: any = useRouter().currentRoute.value.query.role; + role = /true/i.test(role); + role ? store.commit("view/toggle", "roleInNwk") : ""; + }; + onMounted(() => { // the print dialog will open immediately createPdf(); + readHttpGet(); }); return { alteri, ego, createPdf, + pseudonyms: computed(() => store.state.pseudonym.active), + horizons: computed(() => store.state.view.horizons), }; }, }); From 5463a7cf9464e071e8372e1d7aed992f55db506b Mon Sep 17 00:00:00 2001 From: julia221501 Date: Thu, 22 Sep 2022 11:25:55 +0200 Subject: [PATCH 2/2] =?UTF-8?q?PDF=20vue=20nicht=20ben=C3=B6tigte=20Code-Z?= =?UTF-8?q?eilen=20gel=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Pdf.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/views/Pdf.vue b/src/views/Pdf.vue index 5f8b4b5..ad400b3 100644 --- a/src/views/Pdf.vue +++ b/src/views/Pdf.vue @@ -136,8 +136,6 @@ export default defineComponent({ alteri, ego, createPdf, - pseudonyms: computed(() => store.state.pseudonym.active), - horizons: computed(() => store.state.view.horizons), }; }, });