ff-operation/src/views/admin/operation/mission/MissionDetail.vue

119 lines
3.8 KiB
Vue
Raw Normal View History

2025-02-24 11:46:02 +01:00
<template>
<div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
<div>
<label for="title">Einsatztitel</label>
2025-02-26 13:21:09 +01:00
<input type="text" id="title" v-model="title" />
2025-02-24 11:46:02 +01:00
</div>
<div class="flex flex-col sm:flex-row gap-2">
<ForceSelect title="Einsatzleiter" :available-forces="availableForces" />
<ForceSelect title="Bericht Ersteller" :available-forces="availableForces" />
</div>
<div class="flex flex-col sm:flex-row gap-2">
<div class="grow">
<label for="title">Einsatzbeginn</label>
<input type="datetime-local" id="title" />
</div>
2025-02-26 13:21:09 +01:00
{{ title }}
2025-02-24 11:46:02 +01:00
<div class="grow">
<label for="title">Einsatzende</label>
<input type="datetime-local" id="title" />
</div>
<div class="w-full sm:w-fit min-w-fit">
<p>Dauer</p>
<p
class="rounded-md shadow-sm relative block w-full sm:w-fit px-3 py-2 border border-gray-300 text-gray-900 sm:text-sm"
>
00h 00m
</p>
</div>
</div>
<div>
<label for="title">Stichwort</label>
<input type="text" id="title" />
</div>
<div>
<label for="title">Einsatzort</label>
<input type="text" id="title" />
</div>
<div>
<label for="title">Weitere Anwesende (andere Wehren, Polizei, Rettungsdienst)</label>
<input type="text" id="title" />
</div>
<div class="flex flex-col sm:flex-row gap-2">
<div class="w-full">
<label for="title">Anzahl getretteter Personen</label>
<input type="number" id="title" value="0" />
</div>
<div class="w-full">
<label for="title">Anzahl geborgener Personen</label>
<input type="number" id="title" value="0" />
</div>
</div>
<div class="flex flex-col">
<label for="summary">Einsatzbeschreibung</label>
<QuillEditor
id="summary"
theme="snow"
style="height: 250px; max-height: 250px; min-height: 250px"
contentType="html"
2025-02-26 13:21:09 +01:00
:options="{ modules: moduleOptions }"
2025-02-24 11:46:02 +01:00
:enable="can('create', 'operation', 'mission')"
:style="!can('create', 'operation', 'mission') ? 'opacity: 75%; background: rgb(243 244 246)' : ''"
2025-02-26 13:21:09 +01:00
@ready="initEditor"
2025-02-24 11:46:02 +01:00
/>
<!--v-model:content=""-->
</div>
<div class="flex flex-col">
<p>Eingesetzte Fahrzeuge</p>
</div>
<div class="flex flex-col">
<p>Eingesetztes Material</p>
</div>
<div class="flex flex-col">
<p>Kontaktdaten</p>
</div>
</div>
<!-- <div class="flex flex-row gap-4">
<button primary class="!w-fit">Knopf</button>
</div> -->
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
2025-02-26 13:21:09 +01:00
import { mapActions, mapState, mapWritableState } from "pinia";
2025-02-24 11:46:02 +01:00
import { useAbilityStore } from "@/stores/ability";
2025-02-26 13:21:09 +01:00
import { Quill, QuillEditor } from "@vueup/vue-quill";
import QuillCursors from "quill-cursors";
2025-02-24 11:46:02 +01:00
import "@vueup/vue-quill/dist/vue-quill.snow.css";
2025-02-26 13:21:09 +01:00
import { QuillBinding } from "y-quill";
import { moduleOptions } from "@/helpers/quillConfig";
2025-02-24 11:46:02 +01:00
import ForceSelect from "@/components/admin/ForceSelect.vue";
import { useForceStore } from "@/stores/admin/configuration/force";
2025-02-26 13:21:09 +01:00
import { useMissionDetailStore } from "@/stores/admin/operation/missionDetail";
2025-02-24 11:46:02 +01:00
</script>
<script lang="ts">
export default defineComponent({
data() {
2025-02-26 13:21:09 +01:00
return {
binding: undefined as undefined | QuillBinding,
cursors: undefined as undefined | QuillCursors,
};
2025-02-24 11:46:02 +01:00
},
computed: {
...mapState(useAbilityStore, ["can"]),
...mapState(useForceStore, ["availableForces"]),
2025-02-26 13:21:09 +01:00
...mapWritableState(useMissionDetailStore, ["editor", "title"]),
},
created() {
Quill.register("modules/cursors", QuillCursors);
},
methods: {
initEditor(quill: Quill) {
this.binding = new QuillBinding(this.editor, quill);
this.cursors = quill.getModule("cursors") as QuillCursors;
},
2025-02-24 11:46:02 +01:00
},
});
</script>