save inspectionPoints

This commit is contained in:
Julian Krauser 2025-07-09 16:01:15 +02:00
parent eb4d338583
commit 23bdde5fc2
13 changed files with 407 additions and 72 deletions

View file

@ -6,7 +6,7 @@
<BoldIcon v-else-if="modelValue.type == InspectionPointEnum.text" class="w-6 h-6" />
<DocumentIcon v-else-if="modelValue.type == InspectionPointEnum.file" class="w-6 h-6" />
<input type="text" placeholder="Titel" v-model="title" />
<input type="text" placeholder="Titel" class="grow !w-fit" v-model="title" />
<div class="flex flex-col">
<ChevronUpIcon v-if="index != 0" class="text-white w-4 h-4 stroke-2 cursor-pointer" @click="$emit('up')" />
@ -28,6 +28,13 @@
<label for="max">Maximal</label>
<input type="number" v-model="max" min="0" />
</div>
<div v-if="modelValue.type == InspectionPointEnum.file">
<p>Dateiart</p>
<div class="flex flex-row gap-2">
<button :primary="others == 'img'" :primary-outline="others != 'img'" @click="others = 'img'">Bild</button>
<button :primary="others == 'pdf'" :primary-outline="others != 'pdf'" @click="others = 'pdf'">PDF</button>
</div>
</div>
</div>
</div>
</template>
@ -63,7 +70,7 @@ export default defineComponent({
get() {
return this.modelValue.title;
},
set(val: InspectionPointViewModel) {
set(val: string) {
this.$emit("update:model-value", { ...this.modelValue, title: val });
},
},
@ -71,7 +78,7 @@ export default defineComponent({
get() {
return this.modelValue.description;
},
set(val: InspectionPointViewModel) {
set(val: string) {
this.$emit("update:model-value", { ...this.modelValue, description: val });
},
},
@ -79,16 +86,24 @@ export default defineComponent({
get() {
return this.modelValue.min;
},
set(val: InspectionPointViewModel) {
this.$emit("update:model-value", { ...this.modelValue, min: val });
set(val: string) {
this.$emit("update:model-value", { ...this.modelValue, min: val == "" ? null : val });
},
},
max: {
get() {
return this.modelValue.max;
},
set(val: InspectionPointViewModel) {
this.$emit("update:model-value", { ...this.modelValue, max: val });
set(val: string) {
this.$emit("update:model-value", { ...this.modelValue, max: val == "" ? null : val });
},
},
others: {
get() {
return this.modelValue.others;
},
set(val: string) {
this.$emit("update:model-value", { ...this.modelValue, others: val == "" ? null : val });
},
},
},