add new table feature for responsible person and assignment close #2
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m23s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m49s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m34s
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m23s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m49s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m34s
This commit is contained in:
@@ -3,11 +3,13 @@ import { ref, computed } from 'vue';
|
||||
import type { Member, Members } from 'src/vueLib/models/member';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { i18n } from 'boot/lang';
|
||||
import { useResponsibleTable } from '../responsible/ResponsibleTable';
|
||||
|
||||
export const databaseName = ref('members.dba');
|
||||
|
||||
export function useMemberTable() {
|
||||
const members = ref<Members>([]);
|
||||
const { responsibles, updateResponsibles } = useResponsibleTable();
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: 'firstName',
|
||||
@@ -177,6 +179,7 @@ export function useMemberTable() {
|
||||
}
|
||||
|
||||
function getRowClass(row: Member) {
|
||||
if (!row.birthday) return '';
|
||||
if (isXDaysBeforeAnnualDate(row.birthday, 1)) {
|
||||
return 'bg-red-2 text-red-10';
|
||||
} else if (isXDaysBeforeAnnualDate(row.birthday, 4)) {
|
||||
@@ -188,9 +191,11 @@ export function useMemberTable() {
|
||||
}
|
||||
|
||||
//updates member list from database
|
||||
function updateMembers() {
|
||||
async function updateMembers() {
|
||||
loading.value = true;
|
||||
|
||||
await updateResponsibles().catch((err) => NotifyResponse(err, 'error'));
|
||||
|
||||
appApi
|
||||
.get('members')
|
||||
.then((resp) => {
|
||||
@@ -204,6 +209,10 @@ export function useMemberTable() {
|
||||
return;
|
||||
}
|
||||
members.value.forEach((member) => {
|
||||
if (!responsibles.value.some((r) => r.id === member.responsiblePerson?.id)) {
|
||||
delete member.responsiblePerson;
|
||||
}
|
||||
|
||||
if (member.birthday !== undefined) {
|
||||
member.age = String(calculateAge(member.birthday));
|
||||
}
|
||||
@@ -227,6 +236,7 @@ export function useMemberTable() {
|
||||
}
|
||||
return {
|
||||
members,
|
||||
responsibles,
|
||||
pagination,
|
||||
columns,
|
||||
loading,
|
||||
|
||||
Reference in New Issue
Block a user