#23-cleanup-&-enhancements #24
3 changed files with 34 additions and 12 deletions
|
@ -18,13 +18,19 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col p-2 gap-2">
|
<div class="flex flex-col p-2 gap-2">
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div class="flex flex-col md:flex-row gap-2 md:items-center">
|
||||||
|
<div class="flex flex-row w-full gap-2 items-center">
|
||||||
<p class="min-w-16">Kopfzeile:</p>
|
<p class="min-w-16">Kopfzeile:</p>
|
||||||
<select ref="header" id="header" :value="templateUsage.header?.id ?? 'def'">
|
<select ref="header" id="header" :value="templateUsage.header?.id ?? 'def'">
|
||||||
<option value="def">Standard-Vorlage verwenden</option>
|
<option value="def">Standard-Vorlage verwenden</option>
|
||||||
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-row gap-2 items-center">
|
||||||
|
<p class="whitespace-nowrap">Höhe [mm]:</p>
|
||||||
|
<input id="headerHeight" type="number" :min="15" v-model="templateUsage.headerHeight" class="!w-24" placeholder="15">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div class="flex flex-row gap-2 items-center">
|
||||||
<p class="min-w-16">Hauptteil:</p>
|
<p class="min-w-16">Hauptteil:</p>
|
||||||
<select ref="body" id="body" :value="templateUsage.body?.id ?? 'def'">
|
<select ref="body" id="body" :value="templateUsage.body?.id ?? 'def'">
|
||||||
|
@ -32,13 +38,19 @@
|
||||||
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row gap-2 items-center">
|
<div class="flex flex-col md:flex-row gap-2 md:items-center">
|
||||||
|
<div class="flex flex-row w-full gap-2 items-center">
|
||||||
<p class="min-w-16">Fußzeile:</p>
|
<p class="min-w-16">Fußzeile:</p>
|
||||||
<select ref="footer" id="footer" :value="templateUsage.footer?.id ?? 'def'">
|
<select ref="footer" id="footer" :value="templateUsage.footer?.id ?? 'def'">
|
||||||
<option value="def">Standard-Vorlage verwenden</option>
|
<option value="def">Standard-Vorlage verwenden</option>
|
||||||
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
<option v-for="template in templates" :key="template.id" :value="template.id">{{ template.template }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-row gap-2 items-center">
|
||||||
|
<p class="whitespace-nowrap">Höhe [mm]:</p>
|
||||||
|
<input id="footerHeight" type="number" :min="15" v-model="templateUsage.footerHeight" class="!w-24" placeholder="15">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -91,6 +103,8 @@ export default defineComponent({
|
||||||
const headerId = fromData.header.value === "def" ? null : fromData.header.value;
|
const headerId = fromData.header.value === "def" ? null : fromData.header.value;
|
||||||
const bodyId = fromData.body.value === "def" ? null : fromData.body.value;
|
const bodyId = fromData.body.value === "def" ? null : fromData.body.value;
|
||||||
const footerId = fromData.footer.value === "def" ? null : fromData.footer.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);
|
||||||
|
|
||||||
this.status = "loading"
|
this.status = "loading"
|
||||||
this.updateTemplateUsage({
|
this.updateTemplateUsage({
|
||||||
|
@ -98,6 +112,8 @@ export default defineComponent({
|
||||||
headerId: headerId,
|
headerId: headerId,
|
||||||
bodyId: bodyId,
|
bodyId: bodyId,
|
||||||
footerId: footerId,
|
footerId: footerId,
|
||||||
|
headerHeight:headerHeight,
|
||||||
|
footerHeight: footerHeight
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.status = { status: "success" };
|
this.status = { status: "success" };
|
||||||
|
|
|
@ -35,6 +35,8 @@ export const useTemplateUsageStore = defineStore("templateUsage", {
|
||||||
headerId: templateUsage.headerId,
|
headerId: templateUsage.headerId,
|
||||||
bodyId: templateUsage.bodyId,
|
bodyId: templateUsage.bodyId,
|
||||||
footerId: templateUsage.footerId,
|
footerId: templateUsage.footerId,
|
||||||
|
headerHeight: templateUsage.headerHeight,
|
||||||
|
footerHeight: templateUsage.footerHeight,
|
||||||
});
|
});
|
||||||
this.fetchTemplateUsages();
|
this.fetchTemplateUsages();
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -5,6 +5,8 @@ export interface TemplateUsageViewModel {
|
||||||
header: { id: number; template: string } | null;
|
header: { id: number; template: string } | null;
|
||||||
body: { id: number; template: string } | null;
|
body: { id: number; template: string } | null;
|
||||||
footer: { id: number; template: string } | null;
|
footer: { id: number; template: string } | null;
|
||||||
|
headerHeight: number | null;
|
||||||
|
footerHeight: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateTemplateUsageViewModel {
|
export interface UpdateTemplateUsageViewModel {
|
||||||
|
@ -12,4 +14,6 @@ export interface UpdateTemplateUsageViewModel {
|
||||||
headerId: number | null;
|
headerId: number | null;
|
||||||
bodyId: number | null;
|
bodyId: number | null;
|
||||||
footerId: number | null;
|
footerId: number | null;
|
||||||
|
headerHeight: number | null;
|
||||||
|
footerHeight: number | null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue