Bankverbindungs-Buttons bei SEPA-Mandaten ergänzen #183
This commit is contained in:
@@ -349,6 +349,35 @@ const triggerInputChange = (datapoint) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getDatapointValue = (datapoint) => {
|
||||||
|
if (datapoint.key.includes(".")) {
|
||||||
|
const [parentKey, childKey] = datapoint.key.split(".")
|
||||||
|
return item.value[parentKey]?.[childKey] || null
|
||||||
|
}
|
||||||
|
|
||||||
|
return item.value[datapoint.key] || null
|
||||||
|
}
|
||||||
|
|
||||||
|
const setDatapointValue = (datapoint, value) => {
|
||||||
|
if (datapoint.key.includes(".")) {
|
||||||
|
const [parentKey, childKey] = datapoint.key.split(".")
|
||||||
|
if (!item.value[parentKey]) item.value[parentKey] = {}
|
||||||
|
item.value[parentKey][childKey] = value
|
||||||
|
} else {
|
||||||
|
item.value[datapoint.key] = value
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerInputChange(datapoint)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getEntityModalCreateQuery = (datapoint) => {
|
||||||
|
if (datapoint.entityModalCreateQueryFunction) {
|
||||||
|
return datapoint.entityModalCreateQueryFunction(item.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return datapoint.entityModalCreateQuery || {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const createItem = async () => {
|
const createItem = async () => {
|
||||||
let ret = null
|
let ret = null
|
||||||
@@ -595,6 +624,13 @@ const updateItem = async () => {
|
|||||||
color="white"
|
color="white"
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
/>
|
/>
|
||||||
|
<EntityModalButtons
|
||||||
|
v-if="datapoint.entityModalButtonsType"
|
||||||
|
:type="datapoint.entityModalButtonsType"
|
||||||
|
:id="getDatapointValue(datapoint)"
|
||||||
|
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||||
|
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||||
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
<InputGroup class="w-full" v-else>
|
<InputGroup class="w-full" v-else>
|
||||||
<UInput
|
<UInput
|
||||||
@@ -708,6 +744,13 @@ const updateItem = async () => {
|
|||||||
color="white"
|
color="white"
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
/>
|
/>
|
||||||
|
<EntityModalButtons
|
||||||
|
v-if="datapoint.entityModalButtonsType"
|
||||||
|
:type="datapoint.entityModalButtonsType"
|
||||||
|
:id="getDatapointValue(datapoint)"
|
||||||
|
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||||
|
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||||
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
</div>
|
</div>
|
||||||
@@ -828,6 +871,13 @@ const updateItem = async () => {
|
|||||||
color="white"
|
color="white"
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
/>
|
/>
|
||||||
|
<EntityModalButtons
|
||||||
|
v-if="datapoint.entityModalButtonsType"
|
||||||
|
:type="datapoint.entityModalButtonsType"
|
||||||
|
:id="getDatapointValue(datapoint)"
|
||||||
|
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||||
|
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||||
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
<InputGroup class="w-full" v-else>
|
<InputGroup class="w-full" v-else>
|
||||||
<UInput
|
<UInput
|
||||||
@@ -941,6 +991,13 @@ const updateItem = async () => {
|
|||||||
color="white"
|
color="white"
|
||||||
icon="i-heroicons-x-mark"
|
icon="i-heroicons-x-mark"
|
||||||
/>
|
/>
|
||||||
|
<EntityModalButtons
|
||||||
|
v-if="datapoint.entityModalButtonsType"
|
||||||
|
:type="datapoint.entityModalButtonsType"
|
||||||
|
:id="getDatapointValue(datapoint)"
|
||||||
|
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||||
|
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||||
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
</UFormField>
|
</UFormField>
|
||||||
</UForm>
|
</UForm>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: [String, Number],
|
||||||
},
|
},
|
||||||
createQuery: {
|
createQuery: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -1212,6 +1212,7 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectDataType: "entitybankaccounts",
|
selectDataType: "entitybankaccounts",
|
||||||
selectOptionAttribute: "displayLabel",
|
selectOptionAttribute: "displayLabel",
|
||||||
selectSearchAttributes: ["displayLabel", "iban", "bankName"],
|
selectSearchAttributes: ["displayLabel", "iban", "bankName"],
|
||||||
|
entityModalButtonsType: "entitybankaccounts",
|
||||||
inputColumn: "Mandat"
|
inputColumn: "Mandat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user