mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-06 19:59:13 +02:00
feat:#24 skeleton dataTable
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, inject, ref, Ref} from "vue";
|
import { defineAsyncComponent, inject, ref, Ref } from "vue";
|
||||||
import { Module } from "../model/module.ts";
|
import { Module } from "../model/module.ts";
|
||||||
import { fetchAllModules } from "../api/fetchCourse.ts";
|
import { fetchAllModules } from "../api/fetchCourse.ts";
|
||||||
import moduleStore from "../store/moduleStore.ts";
|
import moduleStore from "../store/moduleStore.ts";
|
||||||
import { FilterMatchMode } from "primevue/api";
|
import { FilterMatchMode } from "primevue/api";
|
||||||
import { DataTableRowSelectEvent, DataTableRowUnselectEvent } from "primevue/datatable";
|
import {
|
||||||
|
DataTableRowSelectEvent,
|
||||||
|
DataTableRowUnselectEvent,
|
||||||
|
} from "primevue/datatable";
|
||||||
import { useDialog } from "primevue/usedialog";
|
import { useDialog } from "primevue/usedialog";
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
import { fetchModule } from "../api/fetchModule.ts";
|
import { fetchModule } from "../api/fetchModule.ts";
|
||||||
@@ -23,7 +26,7 @@ if (store.isEmpty()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mobilePage = inject("mobilePage") as Ref<boolean>;
|
const mobilePage = inject("mobilePage") as Ref<boolean>;
|
||||||
const modules: Ref<Module[]> = ref([]);
|
const modules: Ref<Module[]> = ref(new Array(10));
|
||||||
const filters = ref({
|
const filters = ref({
|
||||||
course: {
|
course: {
|
||||||
value: null,
|
value: null,
|
||||||
@@ -83,7 +86,6 @@ function selectModule(event: DataTableRowSelectEvent) {
|
|||||||
function unselectModule(event: DataTableRowUnselectEvent) {
|
function unselectModule(event: DataTableRowUnselectEvent) {
|
||||||
store.removeModule(event.data);
|
store.removeModule(event.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -118,6 +120,9 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
@row-unselect="unselectModule"
|
@row-unselect="unselectModule"
|
||||||
>
|
>
|
||||||
<Column selection-mode="multiple">
|
<Column selection-mode="multiple">
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
||||||
<Column
|
<Column
|
||||||
@@ -134,6 +139,9 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
@input="filterCallback()"
|
@input="filterCallback()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column
|
<Column
|
||||||
field="name"
|
field="name"
|
||||||
@@ -149,6 +157,9 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
@input="filterCallback()"
|
@input="filterCallback()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column
|
<Column
|
||||||
field="eventType"
|
field="eventType"
|
||||||
@@ -164,6 +175,9 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
@input="filterCallback()"
|
@input="filterCallback()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column
|
<Column
|
||||||
field="prof"
|
field="prof"
|
||||||
@@ -171,10 +185,11 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
:show-clear-button="false"
|
:show-clear-button="false"
|
||||||
:show-filter-menu="false"
|
:show-filter-menu="false"
|
||||||
>
|
>
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column
|
<Column :header="$t('additionalModules.info')">
|
||||||
:header="$t('additionalModules.info')"
|
|
||||||
>
|
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<Button
|
<Button
|
||||||
icon="pi pi-info"
|
icon="pi pi-info"
|
||||||
@@ -186,11 +201,16 @@ function unselectModule(event: DataTableRowUnselectEvent) {
|
|||||||
@click.stop="showInfo(slotProps.data)"
|
@click.stop="showInfo(slotProps.data)"
|
||||||
></Button>
|
></Button>
|
||||||
</template>
|
</template>
|
||||||
|
<template #loading>
|
||||||
|
<Skeleton></Skeleton>
|
||||||
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="py-2 px-3">
|
<div class="py-2 px-3">
|
||||||
{{
|
{{
|
||||||
t('additionalModules.footerModulesSelected', { count: store?.countModules() ?? 0 })
|
t("additionalModules.footerModulesSelected", {
|
||||||
|
count: store?.countModules() ?? 0,
|
||||||
|
})
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -32,6 +32,7 @@ import DynamicDialog from "primevue/dynamicdialog";
|
|||||||
import DialogService from "primevue/dialogservice";
|
import DialogService from "primevue/dialogservice";
|
||||||
import ProgressSpinner from "primevue/progressspinner";
|
import ProgressSpinner from "primevue/progressspinner";
|
||||||
import Checkbox from "primevue/checkbox";
|
import Checkbox from "primevue/checkbox";
|
||||||
|
import Skeleton from "primevue/skeleton";
|
||||||
import i18n from "./i18n";
|
import i18n from "./i18n";
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
@@ -68,5 +69,6 @@ app.component("Column", Column);
|
|||||||
app.component("DynamicDialog", DynamicDialog);
|
app.component("DynamicDialog", DynamicDialog);
|
||||||
app.component("ProgressSpinner", ProgressSpinner);
|
app.component("ProgressSpinner", ProgressSpinner);
|
||||||
app.component("Checkbox", Checkbox);
|
app.component("Checkbox", Checkbox);
|
||||||
|
app.component("Skeleton", Skeleton);
|
||||||
|
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
|
Reference in New Issue
Block a user