Dashboard, Datenblatt usw.

This commit is contained in:
Moritz Utcke
2025-02-19 18:12:48 +11:00
parent 198912c792
commit 69566f1c74
39 changed files with 1479 additions and 420 deletions

View File

@@ -1,19 +1,27 @@
<script lang="ts">
import { Buffer } from "buffer";
import { AufnahmeClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "./Ausweis/types.js";
import { Enums } from "@ibcornelsen/database/client";
import { openWindowWithPost } from "#lib/helpers/window.js";
export let ausweis: VerbrauchsausweisWohnenClient;
export let objekt: ObjektClient;
export let aufnahme: AufnahmeClient;
export let bilder: UploadedGebaeudeBild[];
export let ausweisart: Enums.Ausweisart
$: base64Ausweis = Buffer.from(JSON.stringify(ausweis), "utf-8").toString("base64")
$: base64Aufnahme = Buffer.from(JSON.stringify(aufnahme), "utf-8").toString("base64")
$: base64Objekt = Buffer.from(JSON.stringify(objekt), "utf-8").toString("base64")
$: base64Bilder = Buffer.from(JSON.stringify(bilder), "utf-8").toString("base64")
</script>
<a class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" target="_blank" href="/pdf/datenblatt?ausweis={base64Ausweis}&objekt=${base64Objekt}&aufnahme={base64Aufnahme}&bilder={base64Bilder}">
<button class="border-2 rounded-lg bg-white text-center hover:shadow-md no-underline p-3 cursor-pointer" on:click={() => {
openWindowWithPost("/pdf/datenblatt", {
ausweis: JSON.stringify(ausweis),
aufnahme: JSON.stringify(aufnahme),
objekt: JSON.stringify(objekt),
bilder: JSON.stringify(bilder),
ausweisart
})
}}>
<img src="/images/datenblatt.webp" alt="Datenblatt" />
<span class="text-black font-medium text-lg">Datenblatt</span>
</a>
</button>