inspection Point base form
This commit is contained in:
parent
e7078960ba
commit
eb4d338583
19 changed files with 457 additions and 25 deletions
|
@ -14,6 +14,8 @@
|
|||
type="number"
|
||||
required
|
||||
v-model="value"
|
||||
:min="inspectionPoint.min"
|
||||
:max="inspectionPoint.max"
|
||||
/>
|
||||
<textarea v-else :id="inspectionPoint.id" :name="inspectionPoint.id" required class="h-18" v-model="value" />
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
<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 gap-2">
|
||||
<ClipboardDocumentCheckIcon v-if="modelValue.type == InspectionPointEnum.oknok" class="w-6 h-6" />
|
||||
<CalculatorIcon v-else-if="modelValue.type == InspectionPointEnum.number" class="w-6 h-6" />
|
||||
<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" />
|
||||
|
||||
<div class="flex flex-col">
|
||||
<ChevronUpIcon v-if="index != 0" class="text-white w-4 h-4 stroke-2 cursor-pointer" @click="$emit('up')" />
|
||||
<ChevronDownIcon
|
||||
v-if="index != totalCount - 1"
|
||||
class="text-white w-4 h-4 stroke-2 cursor-pointer"
|
||||
@click="$emit('down')"
|
||||
/>
|
||||
</div>
|
||||
<TrashIcon class="h-5 w-5 cursor-pointer" @click="$emit('remove')" />
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<textarea name="description" placeholder="Beschreibung" v-model="description"></textarea>
|
||||
<div v-if="modelValue.type == InspectionPointEnum.number">
|
||||
<label for="min">Mindestens</label>
|
||||
<input type="number" v-model="min" min="0" />
|
||||
</div>
|
||||
<div v-if="modelValue.type == InspectionPointEnum.number">
|
||||
<label for="max">Maximal</label>
|
||||
<input type="number" v-model="max" min="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, type PropType } from "vue";
|
||||
import type { InspectionPointViewModel } from "@/viewmodels/admin/unit/inspection/inspectionPlan.models";
|
||||
import { InspectionPointEnum } from "@/enums/inspectionEnum";
|
||||
import {
|
||||
BoldIcon,
|
||||
CalculatorIcon,
|
||||
ClipboardDocumentCheckIcon,
|
||||
TrashIcon,
|
||||
ChevronUpIcon,
|
||||
ChevronDownIcon,
|
||||
DocumentIcon,
|
||||
} from "@heroicons/vue/24/outline";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
props: {
|
||||
index: { type: Number, default: 0 },
|
||||
totalCount: { type: Number, default: 0 },
|
||||
modelValue: {
|
||||
type: Object as PropType<InspectionPointViewModel>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
emits: ["up", "down", "remove", "update:model-value"],
|
||||
computed: {
|
||||
title: {
|
||||
get() {
|
||||
return this.modelValue.title;
|
||||
},
|
||||
set(val: InspectionPointViewModel) {
|
||||
this.$emit("update:model-value", { ...this.modelValue, title: val });
|
||||
},
|
||||
},
|
||||
description: {
|
||||
get() {
|
||||
return this.modelValue.description;
|
||||
},
|
||||
set(val: InspectionPointViewModel) {
|
||||
this.$emit("update:model-value", { ...this.modelValue, description: val });
|
||||
},
|
||||
},
|
||||
min: {
|
||||
get() {
|
||||
return this.modelValue.min;
|
||||
},
|
||||
set(val: InspectionPointViewModel) {
|
||||
this.$emit("update:model-value", { ...this.modelValue, min: val });
|
||||
},
|
||||
},
|
||||
max: {
|
||||
get() {
|
||||
return this.modelValue.max;
|
||||
},
|
||||
set(val: InspectionPointViewModel) {
|
||||
this.$emit("update:model-value", { ...this.modelValue, max: val });
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
|
@ -6,6 +6,9 @@
|
|||
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||
<p>{{ vehicle.name }}</p>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<p v-if="vehicle.code">Code: {{ vehicle.code }}</p>
|
||||
</div>
|
||||
</RouterLink>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue