fix memberrlation
This commit is contained in:
@@ -11,18 +11,22 @@ const relations = ref([])
|
||||
|
||||
const normalizeId = (value) => {
|
||||
if (value === null || value === undefined || value === "") return null
|
||||
if (typeof value === "object") return normalizeId(value.id)
|
||||
const parsed = Number(value)
|
||||
return Number.isNaN(parsed) ? String(value) : parsed
|
||||
}
|
||||
|
||||
const relationLabel = computed(() => {
|
||||
const id = normalizeId(props.row?.infoData?.memberrelation)
|
||||
const relation = props.row?.memberrelation
|
||||
if (relation && typeof relation === "object" && relation.type) return relation.type
|
||||
|
||||
const id = normalizeId(relation)
|
||||
if (!id) return ""
|
||||
return relations.value.find((i) => normalizeId(i.id) === id)?.type || ""
|
||||
})
|
||||
|
||||
const relationId = computed(() => {
|
||||
return normalizeId(props.row?.infoData?.memberrelation)
|
||||
return normalizeId(props.row?.memberrelation)
|
||||
})
|
||||
|
||||
const loadRelations = async () => {
|
||||
|
||||
@@ -535,7 +535,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
disabledInTable: true
|
||||
},
|
||||
{
|
||||
key: "infoData.memberrelation",
|
||||
key: "memberrelation",
|
||||
label: "Mitgliedsverhältnis",
|
||||
component: memberrelation,
|
||||
inputType: "select",
|
||||
|
||||
Reference in New Issue
Block a user