fix memberrlation

This commit is contained in:
2026-02-21 21:21:27 +01:00
parent 70636f6ac5
commit 30d761f899
6 changed files with 165 additions and 4 deletions

View File

@@ -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 () => {