From 835486d04fff15ec667cf6512158b62864c6d258 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 20 May 2025 17:13:06 +0200 Subject: [PATCH] Added Support for Conditional Rendering of Inputs Added Some InputColumns in anticipation of required InputColumns --- stores/data.js | 107 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 24 deletions(-) diff --git a/stores/data.js b/stores/data.js index c2ad032..edfe855 100644 --- a/stores/data.js +++ b/stores/data.js @@ -92,12 +92,14 @@ export const useDataStore = defineStore('data', () => { key: "created_at", label: "Erstellt am", component: created_at, + inputColumn: "Allgemeines" },{ key: "name", label: "Name", title: true, required: true, - inputType: "text" + inputType: "text", + inputColumn: "Allgemeines" },{ key: "categorie", label: "Kategorie", @@ -109,6 +111,7 @@ export const useDataStore = defineStore('data', () => { {label:"In Bearbeitung"}, {label:"Abgeschlossen"} ], + inputColumn: "Allgemeines" },{ key: "profile", label: "Mitarbeiter", @@ -117,6 +120,7 @@ export const useDataStore = defineStore('data', () => { selectDataType: "profiles", selectOptionAttribute: "fullName", selectSearchAttributes: ['fullName'], + inputColumn: "Zuweisungen" },{ key: "project", label: "Projekt", @@ -125,6 +129,7 @@ export const useDataStore = defineStore('data', () => { selectDataType: "projects", selectOptionAttribute: "name", selectSearchAttributes: ['name'], + inputColumn: "Zuweisungen" },{ key: "customer", label: "Kunde", @@ -133,6 +138,7 @@ export const useDataStore = defineStore('data', () => { selectDataType: "customers", selectOptionAttribute: "name", selectSearchAttributes: ['name'], + inputColumn: "Zuweisungen" },{ key: "plant", label: "Objekt", @@ -141,11 +147,17 @@ export const useDataStore = defineStore('data', () => { selectDataType: "plants", selectOptionAttribute: "name", selectSearchAttributes: ['name'], + inputColumn: "Zuweisungen" },{ key: "description", - label: "Beschreibung" + label: "Beschreibung", + inputColumn: "Allgemeines" }, ], + inputColumns: [ + "Allgemeines", + "Zuweisungen" + ], showTabs: [{label: 'Informationen'}] }, customers: { @@ -169,12 +181,23 @@ export const useDataStore = defineStore('data', () => { } } }], + inputColumns: [ + "Allgemeines", + "Kontaktdaten" + ], templateColumns: [ { key: 'customerNumber', label: "Kundennummer", inputIsNumberRange: true, - inputType: "text" + inputType: "text", + inputColumn: "Allgemeines" + }, { + key: "isCompany", + label: "Firmenkunde", + component: isCompany, + inputType: "bool", + inputColumn: "Allgemeines" }, { key: "name", label: "Firmenname", @@ -184,6 +207,10 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return !item.isCompany }, + showFunction: function (item) { + return item.isCompany + }, + inputColumn: "Allgemeines" }, { key: "nameAddition", label: "Firmenname Zusatz", @@ -191,6 +218,10 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return !item.isCompany }, + showFunction: function (item) { + return item.isCompany + }, + inputColumn: "Allgemeines" },{ key: "salutation", label: "Anrede", @@ -213,6 +244,10 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return item.isCompany }, + showFunction: function (item) { + return !item.isCompany + }, + inputColumn: "Allgemeines" },{ key: "title", label: "Titel", @@ -235,6 +270,10 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return item.isCompany }, + showFunction: function (item) { + return !item.isCompany + }, + inputColumn: "Allgemeines" },{ key: "firstname", label: "Vorname",//TODO: Add Conditional Rendering to Datatypes @@ -258,10 +297,15 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return item.isCompany }, + showFunction: function (item) { + return !item.isCompany + }, + inputColumn: "Allgemeines" },{ key: "lastname", label: "Nachname", title: true, + required: true, inputType: "text", inputChangeFunction: function (row) { row.name = "" @@ -281,35 +325,39 @@ export const useDataStore = defineStore('data', () => { disabledFunction: function (item) { return item.isCompany }, - }, { - key: "isCompany", - label: "Firmenkunde", - component: isCompany, - inputType: "bool" + showFunction: function (item) { + return !item.isCompany + }, + inputColumn: "Allgemeines" },{ key: "active", label: "Aktiv", component: active, - inputType: "bool" + inputType: "bool", + inputColumn: "Allgemeines" }, { key: "customPaymentDays", label: "Zahlungsziel in Tagen", - inputType: "number" + inputType: "number", + inputColumn: "Allgemeines" }, { key: "customSurchargePercentage", label: "Individueller Aufschlag", - inputType: "number" + inputType: "number", + inputColumn: "Allgemeines" }, { key: "infoData.street", label: "Straße + Hausnummer", inputType: "text", - disabledInTable: true + disabledInTable: true, + inputColumn: "Kontaktdaten" }, { key: "infoData.special", label: "Adresszusatz", inputType: "text", - disabledInTable: true + disabledInTable: true, + inputColumn: "Kontaktdaten" }, { key: "infoData.zip", @@ -320,13 +368,15 @@ export const useDataStore = defineStore('data', () => { row.infoData.city = (await useZipCheck(row.infoData.zip)) } }, - disabledInTable: true + disabledInTable: true, + inputColumn: "Kontaktdaten" }, { key: "infoData.city", label: "Stadt", inputType: "text", - disabledInTable: true + disabledInTable: true, + inputColumn: "Kontaktdaten" }, { key: "infoData.country", @@ -335,42 +385,50 @@ export const useDataStore = defineStore('data', () => { selectDataType: "countrys", selectOptionAttribute: "name", selectValueAttribute: "name", - disabledInTable: true + disabledInTable: true, + inputColumn: "Kontaktdaten" }, { key: "address", label: "Adresse", - component: address + component: address, + inputColumn: "Kontaktdaten" }, { key: "infoData.tel", label: "Telefon", - inputType: "text" + inputType: "text", + inputColumn: "Kontaktdaten" }, { key: "infoData.email", label: "E-Mail", - inputType: "text" + inputType: "text", + inputColumn: "Kontaktdaten" }, { key: "infoData.invoiceEmail", label: "E-Mail für Rechnungen", - inputType: "text" + inputType: "text", + inputColumn: "Kontaktdaten" }, { key: "infoData.web", label: "Web", - inputType: "text" + inputType: "text", + inputColumn: "Kontaktdaten" }, { key: "infoData.ustid", label: "USt-Id", - inputType: "text" + inputType: "text", + inputColumn: "Kontaktdaten" }, { key: "notes", label: "Notizen", - inputType: "textarea" + inputType: "textarea", + inputColumn: "Allgemeines" }, { key: "profiles", @@ -380,7 +438,8 @@ export const useDataStore = defineStore('data', () => { selectOptionAttribute: "fullName", selectSearchAttributes: ['fullName'], selectMultiple: true, - component: profiles + component: profiles, + inputColumn: "Allgemeines" }, ], showTabs: [{label: 'Informationen'},{label: 'Ansprechpartner'},{label: 'Dateien'},{label: 'Ausgangsbelege'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Termine'},{label: 'Verträge'}]