2023-06-13 22:03:32 +02:00
|
|
|
<template>
|
|
|
|
<page-layout>
|
|
|
|
<template #toolbar>
|
|
|
|
<page-toolbar-button :href="meta.links.index" color="primary" icon="undo">Zurück</page-toolbar-button>
|
|
|
|
</template>
|
2023-07-06 13:56:19 +02:00
|
|
|
<template #right>
|
2023-06-13 22:03:32 +02:00
|
|
|
<f-save-button form="form"></f-save-button>
|
2023-07-06 13:56:19 +02:00
|
|
|
</template>
|
|
|
|
<form id="form" class="p-3 grid gap-3" @submit.prevent="submit">
|
2023-06-14 17:29:22 +02:00
|
|
|
<ui-box heading="Metadatem">
|
|
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
2023-07-27 17:22:06 +02:00
|
|
|
<f-text id="name" v-model="model.name" name="name" label="Name" size="sm" required></f-text>
|
|
|
|
<f-select id="gateway_id" v-model="model.gateway_id" name="gateway_id" :options="meta.gateways" label="Verbindung" size="sm" required></f-select>
|
2023-06-14 17:29:22 +02:00
|
|
|
</div>
|
|
|
|
</ui-box>
|
2023-07-27 17:22:06 +02:00
|
|
|
<ui-box v-if="members !== null" heading="Filterregeln">
|
2023-06-13 22:03:32 +02:00
|
|
|
<div class="grid gap-4 sm:grid-cols-2">
|
2023-06-14 17:10:50 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="activity_ids"
|
2023-07-27 17:22:06 +02:00
|
|
|
v-model="model.filter.activity_ids"
|
2023-06-14 17:10:50 +02:00
|
|
|
name="activity_ids"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.filterActivities"
|
2023-06-14 17:10:50 +02:00
|
|
|
label="Tätigkeit"
|
|
|
|
size="sm"
|
2023-07-27 17:22:06 +02:00
|
|
|
@update:model-value="reload(1)"
|
2023-06-14 17:10:50 +02:00
|
|
|
></f-multipleselect>
|
|
|
|
<f-multipleselect
|
|
|
|
id="subactivity_ids"
|
2023-07-27 17:22:06 +02:00
|
|
|
v-model="model.filter.subactivity_ids"
|
2023-06-14 17:10:50 +02:00
|
|
|
name="subactivity_ids"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.filterSubactivities"
|
2023-06-14 17:10:50 +02:00
|
|
|
label="Unterttätigkeit"
|
|
|
|
size="sm"
|
2023-07-27 17:22:06 +02:00
|
|
|
@update:model-value="reload(1)"
|
2023-06-14 17:10:50 +02:00
|
|
|
></f-multipleselect>
|
2023-06-14 17:29:22 +02:00
|
|
|
<f-multipleselect
|
2023-07-10 11:36:58 +02:00
|
|
|
id="include"
|
2023-07-27 17:22:06 +02:00
|
|
|
v-model="model.filter.include"
|
2023-07-10 11:36:58 +02:00
|
|
|
name="include"
|
2023-06-14 23:20:37 +02:00
|
|
|
:options="members.meta.members"
|
2023-06-14 17:29:22 +02:00
|
|
|
label="Zusätzliche Mitglieder"
|
|
|
|
size="sm"
|
2023-07-27 17:22:06 +02:00
|
|
|
@update:model-value="reload(1)"
|
2023-06-14 17:29:22 +02:00
|
|
|
></f-multipleselect>
|
2023-07-10 11:36:58 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="exclude"
|
2023-07-27 17:22:06 +02:00
|
|
|
v-model="model.filter.exclude"
|
2023-07-10 11:36:58 +02:00
|
|
|
name="exclude"
|
|
|
|
:options="members.meta.members"
|
|
|
|
label="Mitglieder ausschließen"
|
|
|
|
size="sm"
|
2023-07-27 17:22:06 +02:00
|
|
|
@update:model-value="reload(1)"
|
2023-07-10 11:36:58 +02:00
|
|
|
></f-multipleselect>
|
2023-06-14 23:20:37 +02:00
|
|
|
<f-multipleselect
|
|
|
|
id="groupIds"
|
2023-07-27 17:22:06 +02:00
|
|
|
v-model="model.filter.group_ids"
|
2023-06-14 23:20:37 +02:00
|
|
|
name="groupIds"
|
|
|
|
:options="members.meta.groups"
|
|
|
|
label="Gruppierungen"
|
|
|
|
size="sm"
|
2023-07-27 17:22:06 +02:00
|
|
|
@update:model-value="reload(1)"
|
2023-06-14 23:20:37 +02:00
|
|
|
></f-multipleselect>
|
2023-06-13 22:03:32 +02:00
|
|
|
</div>
|
|
|
|
</ui-box>
|
2023-07-27 17:22:06 +02:00
|
|
|
<ui-box v-if="members !== null" heading="Mitglieder">
|
2023-06-14 17:10:50 +02:00
|
|
|
<table cellspacing="0" cellpadding="0" border="0" class="custom-table custom-table-sm hidden md:table">
|
|
|
|
<thead>
|
|
|
|
<th></th>
|
|
|
|
<th>Nachname</th>
|
|
|
|
<th>Vorname</th>
|
|
|
|
<th>E-Mail-Adresse</th>
|
|
|
|
<th>E-Mail-Adresse Eltern</th>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tr v-for="(member, index) in members.data" :key="index">
|
|
|
|
<td><ui-age-groups :member="member"></ui-age-groups></td>
|
|
|
|
<td v-text="member.lastname"></td>
|
|
|
|
<td v-text="member.firstname"></td>
|
|
|
|
<td v-text="member.email"></td>
|
|
|
|
<td v-text="member.email_parents"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2023-07-27 17:22:06 +02:00
|
|
|
<ui-pagination class="mt-4" :value="members.meta" :only="['data']" @reload="reload"></ui-pagination>
|
2023-06-13 22:03:32 +02:00
|
|
|
</ui-box>
|
|
|
|
</form>
|
|
|
|
</page-layout>
|
|
|
|
</template>
|
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
<script setup>
|
|
|
|
import {ref, inject, defineProps} from 'vue';
|
|
|
|
import {useIndex} from '../../composables/useIndex.js';
|
2023-06-14 17:10:50 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
const props = defineProps({
|
|
|
|
data: {
|
|
|
|
default: () => undefined,
|
|
|
|
type: Object,
|
2023-06-13 22:03:32 +02:00
|
|
|
},
|
2023-07-27 17:22:06 +02:00
|
|
|
meta: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
2023-06-13 22:03:32 +02:00
|
|
|
},
|
2023-07-27 17:22:06 +02:00
|
|
|
});
|
2023-06-13 22:03:32 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
const {toFilterString, router} = useIndex({data: [], meta: {}});
|
2023-06-14 23:20:37 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
const model = ref(props.data === undefined ? {...props.meta.default_model} : {...props.data});
|
|
|
|
const members = ref(null);
|
|
|
|
const axios = inject('axios');
|
2023-06-13 22:03:32 +02:00
|
|
|
|
2023-07-27 17:22:06 +02:00
|
|
|
async function reload(page) {
|
|
|
|
members.value = (
|
|
|
|
await axios.post('/api/member/search', {
|
|
|
|
page: page || 1,
|
|
|
|
filter: toFilterString(model.value.filter),
|
|
|
|
})
|
|
|
|
).data;
|
|
|
|
}
|
|
|
|
|
|
|
|
reload();
|
|
|
|
|
|
|
|
async function submit() {
|
|
|
|
model.value.id ? await axios.patch(model.value.links.update, model.value) : await axios.post('/maildispatcher', model.value);
|
|
|
|
router.visit(props.meta.links.index);
|
|
|
|
}
|
2023-06-13 22:03:32 +02:00
|
|
|
</script>
|