+ + +
+ +
+ + +
+ Karten und Verlauf
+
+
{{ "Ankerperson: " + ego.name }}
+ + Gedruckte Karte: {{ visibleNWKVersion?.title || "" }} + vom + + {{ + visibleNWKVersion?.date?.substring(8, 10) + + "." + + visibleNWKVersion?.date?.substring(5, 7) + + "." + + visibleNWKVersion?.date?.substring(0, 4) + }} +{{ ego.currentGender ? "Geschlecht: " + ego.currentGender : "" }}
{{ ego.age.length >= 1 ? "Alter: " + ego.age : "" }}
{{ ego.note.length >= 1 ? "Notiz: " + ego.note : "" }}
@@ -90,9 +102,28 @@ export default defineComponent({ const ego = computed(() => store.state.nwk.ego); const createPdf = () => { - window.print(); + (document.title = + store.state.nwk.ego.name + + " " + + visibleNWKVersion.value?.title + + " " + + visibleNWKVersion.value?.date?.substring(8, 10) + + "." + + visibleNWKVersion.value?.date?.substring(5, 7) + + "." + + visibleNWKVersion.value?.date?.substring(0, 4) + + ".pdf"), + window.print(); }; + const currentVersion = computed(() => store.state.record.currentVersion); + + const visibleNWKVersion = computed(() => + store.state.record.versions.find( + (version) => version.id === currentVersion.value + ) + ); + // TODO currently: workaround -> schönere Lösung const readHttpGet = () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -137,6 +168,9 @@ export default defineComponent({ alteri, ego, createPdf, + visibleNWKVersion, + currentVersion: currentVersion, + versions: computed(() => store.state.record.versions), }; }, });