Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
6e82675557 | |||
1b531b1152 | |||
131b3747de | |||
883559d8a5 |
5 changed files with 33 additions and 8 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "ff-admin",
|
"name": "ff-admin",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ff-admin",
|
"name": "ff-admin",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^6.1.15",
|
"@fullcalendar/core": "^6.1.15",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ff-admin",
|
"name": "ff-admin",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"description": "Feuerwehr/Verein Mitgliederverwaltung UI",
|
"description": "Feuerwehr/Verein Mitgliederverwaltung UI",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -19,13 +19,25 @@
|
||||||
<ComboboxOptions
|
<ComboboxOptions
|
||||||
class="absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-md ring-1 ring-black/5 focus:outline-none sm:text-sm"
|
class="absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-md ring-1 ring-black/5 focus:outline-none sm:text-sm"
|
||||||
>
|
>
|
||||||
<ComboboxOption v-if="filtered.length === 0" as="template" disabled>
|
<ComboboxOption v-if="loading || deferingSearch" as="template" disabled>
|
||||||
|
<li class="flex flex-row gap-2 text-text relative cursor-default select-none py-2 pl-3 pr-4">
|
||||||
|
<Spinner />
|
||||||
|
<span class="font-normal block truncate">suche</span>
|
||||||
|
</li>
|
||||||
|
</ComboboxOption>
|
||||||
|
<ComboboxOption v-else-if="filtered.length === 0 && query == ''" as="template" disabled>
|
||||||
<li class="text-text relative cursor-default select-none py-2 pl-3 pr-4">
|
<li class="text-text relative cursor-default select-none py-2 pl-3 pr-4">
|
||||||
<span class="font-normal block truncate">Keine Auswahl</span>
|
<span class="font-normal block truncate">tippe, um zu suchen...</span>
|
||||||
|
</li>
|
||||||
|
</ComboboxOption>
|
||||||
|
<ComboboxOption v-else-if="filtered.length === 0" as="template" disabled>
|
||||||
|
<li class="text-text relative cursor-default select-none py-2 pl-3 pr-4">
|
||||||
|
<span class="font-normal block truncate">Keine Auswahl gefunden.</span>
|
||||||
</li>
|
</li>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
|
|
||||||
<ComboboxOption
|
<ComboboxOption
|
||||||
|
v-if="!(loading || deferingSearch)"
|
||||||
v-for="member in filtered"
|
v-for="member in filtered"
|
||||||
as="template"
|
as="template"
|
||||||
:key="member.id"
|
:key="member.id"
|
||||||
|
@ -74,6 +86,7 @@ import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||||
import { useMemberStore } from "@/stores/admin/club/member/member";
|
import { useMemberStore } from "@/stores/admin/club/member/member";
|
||||||
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
||||||
import difference from "lodash.difference";
|
import difference from "lodash.difference";
|
||||||
|
import Spinner from "../Spinner.vue";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -142,6 +155,7 @@ export default defineComponent({
|
||||||
...mapActions(useMemberStore, ["searchMembers", "getMembersByIds"]),
|
...mapActions(useMemberStore, ["searchMembers", "getMembersByIds"]),
|
||||||
search() {
|
search() {
|
||||||
this.filtered = [];
|
this.filtered = [];
|
||||||
|
if (this.query == "") return;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.searchMembers(this.query)
|
this.searchMembers(this.query)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
|
@ -40,6 +40,11 @@ export const useMemberStore = defineStore("member", {
|
||||||
this.loading = "failed";
|
this.loading = "failed";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async getAllMembers(): Promise<AxiosResponse<any, any>> {
|
||||||
|
return await http.get(`/admin/member?noLimit=true`).then((res) => {
|
||||||
|
return { ...res, data: res.data.members };
|
||||||
|
});
|
||||||
|
},
|
||||||
async getMembersByIds(ids: Array<number>): Promise<AxiosResponse<any, any>> {
|
async getMembersByIds(ids: Array<number>): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.get(`/admin/member?ids=${ids.join(",")}&noLimit=true`).then((res) => {
|
return await http.get(`/admin/member?ids=${ids.join(",")}&noLimit=true`).then((res) => {
|
||||||
return { ...res, data: res.data.members };
|
return { ...res, data: res.data.members };
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
title="weitere Empfänger suchen"
|
title="weitere Empfänger suchen"
|
||||||
v-model="recipients"
|
v-model="recipients"
|
||||||
:disabled="!can('create', 'club', 'newsletter')"
|
:disabled="!can('create', 'club', 'newsletter')"
|
||||||
@add:member="(s) => members.push(s)"
|
|
||||||
@add:member-by-array="(s) => members.push(...s)"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<p>Ausgewählte Empfänger</p>
|
<p>Ausgewählte Empfänger</p>
|
||||||
|
@ -149,9 +147,10 @@ export default defineComponent({
|
||||||
// this.fetchNewsletterRecipients();
|
// this.fetchNewsletterRecipients();
|
||||||
this.fetchQueries();
|
this.fetchQueries();
|
||||||
this.loadQuery();
|
this.loadQuery();
|
||||||
|
this.loadMembers();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useMemberStore, ["fetchMembers"]),
|
...mapActions(useMemberStore, ["getAllMembers"]),
|
||||||
...mapActions(useNewsletterRecipientsStore, ["fetchNewsletterRecipients"]),
|
...mapActions(useNewsletterRecipientsStore, ["fetchNewsletterRecipients"]),
|
||||||
...mapActions(useQueryStoreStore, ["fetchQueries"]),
|
...mapActions(useQueryStoreStore, ["fetchQueries"]),
|
||||||
...mapActions(useQueryBuilderStore, ["sendQuery"]),
|
...mapActions(useQueryBuilderStore, ["sendQuery"]),
|
||||||
|
@ -161,6 +160,13 @@ export default defineComponent({
|
||||||
this.recipients.splice(index, 1);
|
this.recipients.splice(index, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
loadMembers() {
|
||||||
|
this.getAllMembers()
|
||||||
|
.then((res) => {
|
||||||
|
this.members = res.data;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
loadQuery() {
|
loadQuery() {
|
||||||
if (this.recipientsByQuery) {
|
if (this.recipientsByQuery) {
|
||||||
this.sendQuery(0, 1000, this.recipientsByQuery.query);
|
this.sendQuery(0, 1000, this.recipientsByQuery.query);
|
||||||
|
|
Loading…
Reference in a new issue