feat(frontend): Add RadioGroup, calculate highest compliance status

This commit is contained in:
2025-03-02 08:44:12 +01:00
parent 54bb370bfb
commit 8388cbe1a8
5 changed files with 83 additions and 17 deletions

View File

@@ -1,14 +1,29 @@
<template>
<UFormField :label="label" :name="name">
<UInput v-model="model" />
<UFormField :label="label">
<UInput v-model="modelValue" />
</UFormField>
</template>
<script setup lang="ts">
defineProps<{
import type { FormOptionDto } from '~/.api-client'
const props = defineProps<{
label?: string
name?: string
formOptions: FormOptionDto[]
}>()
const model = defineModel({ type: String })
const emit = defineEmits<{
(e: 'update:formOptions', value: FormOptionDto[]): void
}>()
const modelValue = computed({
get: () => props.formOptions?.[0].value ?? '',
set: (val) => {
if (val && props.formOptions?.[0].value) {
const updatedModelValue = [...props.formOptions]
updatedModelValue[0] = { ...updatedModelValue[0], value: val.toString() }
emit('update:formOptions', updatedModelValue)
}
}
})
</script>