2025-05-16 10:27:08 +02:00
|
|
|
<template>
|
|
|
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
|
|
|
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
|
|
|
<p>{{ inspectionPoint.title }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="p-2">
|
|
|
|
<p v-if="inspectionPoint.description" class="pb-2">Beschreibung: {{ inspectionPoint.description }}</p>
|
|
|
|
<hr v-if="inspectionPoint.description" />
|
2025-07-12 17:04:27 +02:00
|
|
|
<div class="flex flex-row gap-2">
|
|
|
|
<button
|
2025-05-16 10:27:08 +02:00
|
|
|
v-for="option in options"
|
|
|
|
:key="option.key"
|
|
|
|
:primary="value == option.key"
|
|
|
|
:primary-outline="value != option.key"
|
2025-07-12 17:04:27 +02:00
|
|
|
:disabled="!editable"
|
2025-05-16 10:27:08 +02:00
|
|
|
:value="option.key"
|
2025-07-12 17:04:27 +02:00
|
|
|
@click="value = option.key"
|
2025-05-16 10:27:08 +02:00
|
|
|
>
|
|
|
|
{{ option.title }}
|
2025-07-12 17:04:27 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
2025-05-16 10:27:08 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineComponent, type PropType } from "vue";
|
2025-05-24 12:55:24 +02:00
|
|
|
import { RadioGroup, RadioGroupOption } from "@headlessui/vue";
|
2025-06-04 12:49:42 +02:00
|
|
|
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
2025-05-16 10:27:08 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
inspectionPoint: {
|
|
|
|
type: Object as PropType<InspectionPointViewModel>,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
modelValue: {
|
2025-07-10 10:49:44 +02:00
|
|
|
type: String as PropType<"true" | "false" | "">,
|
|
|
|
default: "",
|
2025-05-16 10:27:08 +02:00
|
|
|
},
|
2025-07-10 13:22:38 +02:00
|
|
|
editable: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2025-05-16 10:27:08 +02:00
|
|
|
},
|
|
|
|
emits: ["update:model-value"],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
options: [
|
|
|
|
{ key: "true", title: "OK" },
|
|
|
|
{ key: "false", title: "nicht OK" },
|
2025-07-12 17:04:27 +02:00
|
|
|
] as Array<{ key: "true" | "false"; title: string }>,
|
2025-05-16 10:27:08 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
value: {
|
|
|
|
get() {
|
|
|
|
return this.modelValue;
|
|
|
|
},
|
|
|
|
set(val: string) {
|
|
|
|
this.$emit("update:model-value", val);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2025-07-10 10:49:44 +02:00
|
|
|
mounted() {
|
|
|
|
if (this.value == "") this.value = "false";
|
|
|
|
},
|
2025-05-16 10:27:08 +02:00
|
|
|
});
|
|
|
|
</script>
|