Merge branch 'pep_deploy_2025_03_06'

This commit is contained in:
Andreas Österreicher
2025-03-06 10:36:26 +01:00
17 changed files with 593 additions and 202 deletions
+31 -12
View File
@@ -82,10 +82,10 @@ export default {
this.tagData.style = item.style;
this.tagData.zuordnung_typ = this.zuordnung_typ;
this.tagData.done = item.done;
this.tagData.insertamum = item.insertamum;
this.tagData.updateamum = item.updateamum;
this.tagData.updatevon = item.updatevon;
this.tagData.insertvon = item.insertvon;
this.tagData.insertamum = this.formatDateTime(item.insertamum)
this.tagData.updateamum = this.formatDateTime(item.updateamum)
this.tagData.bearbeiter = item.bearbeiter;
this.tagData.verfasser = item.verfasser;
if (item && item.notiz_id)
{
@@ -146,8 +146,6 @@ export default {
this.$refs.tagModal.hide();
});
}
},
async doneTag()
{
@@ -181,22 +179,35 @@ export default {
id: "",
done: false,
insertamum: "",
insertvon: "",
verfasser: "",
updateamum: "",
updatevon: "",
bearbeiter: "",
response: ""
};
this.selectedTagId = null;
this.mode = "create";
},
formatDateTime: (dateString) => {
if (!dateString) return null;
return new Date(dateString).toLocaleString('de-AT', {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
});
}
},
template: `
<div class="plus_button_container" @mouseleave="hideList">
<span :title="values.length === 0 ? 'Bitte Zeilen markieren' : ''">
<button @mouseover="showList = true"
:disabled="!values || values.length === 0"
class="btn btn-sm">
<i class="fa-solid fa-tag fa-xl"></i>
</button>
</span>
<ul v-if="showList" class="dropdown_list">
<li v-for="(item, index) in tags" :key="index" @click="openModal(item)" :title="item.bezeichnung">
{{ item.bezeichnung }}
@@ -221,7 +232,15 @@ export default {
field="notiz"
placeholder="Notiz..."
></form-input>
<div class="modificationdate">angelegt von {{ tagData.insertvon }} am {{ tagData.insertamum }}</div>
<div class="modificationdate">
<span v-if="tagData.verfasser">
{{ $p.t('notiz', 'tag_verfasser', { 0: tagData.verfasser, 1: tagData.insertamum }) }}
</span>
<br />
<span v-if="tagData.bearbeiter && tagData.insertamum !== tagData.updateamum">
{{ $p.t('notiz', 'tag_bearbeiter', { 0: tagData.bearbeiter, 1: tagData.updateamum }) }}
</span>
</div>
</div>
</template>
<template #footer>
@@ -232,12 +251,12 @@ export default {
class="btn btn-success me-2"
@click="doneTag"
>
{{ tagData.done ? 'Rückgängig' : 'Erledigt' }}
{{ tagData.done ? $p.t('notiz', 'tag_rueckgaengig') : $p.t('notiz', 'tag_erledigt') }}
</button>
<button v-if="mode === 'edit'" class="btn btn-danger" @click="deleteTag">Löschen</button>
<button v-if="mode === 'edit'" class="btn btn-danger" @click="deleteTag">{{ $p.t('global', 'loeschen' )}}</button>
</div>
<button type="button" class="btn btn-primary" @click="saveTag">
{{ mode === "edit" ? $p.t('ui', 'bearbeiten') : $p.t('studierendenantrag', 'btn_create') }}
{{ mode === "edit" ? $p.t('global', 'speichern') : $p.t('global', 'create') }}
</button>
</div>
</template>
+46 -10
View File
@@ -20,7 +20,6 @@ import FilterConfig from './Filter/Config.js';
import FilterColumns from './Filter/Columns.js';
import TableDownload from './Table/Download.js';
import collapseAutoClose from '../../directives/collapseAutoClose.js';
import { defaultHeaderFilter } from '../../tabulator/filters/defaultHeaderFilter.js';
import moduleLayoutFitDataStretchFrozen from '../../tabulator/layouts/fitDataStretchFrozen.js';
@@ -84,6 +83,7 @@ export const CoreFilterCmpt = {
uuid: 0,
// FilterCmpt properties
filterName: null,
filterActive: false,
fields: null,
dataset: null,
datasetMetadata: null,
@@ -103,7 +103,15 @@ export const CoreFilterCmpt = {
tabulator: null,
tableBuilt: false,
tabulatorHasSelector: false,
selectedData: []
selectedData: [],
persistence: {
sort: true,
columns: true,
filter: false,
headerFilter: false,
group: false,
page: false,
}
};
},
computed: {
@@ -210,12 +218,11 @@ export const CoreFilterCmpt = {
layout: "fitDataStretchFrozen",
movableColumns: true,
columnDefaults:{
tooltip: true,
headerFilterFunc: defaultHeaderFilter,
tooltip: true
},
placeholder,
reactiveData: true,
persistence: true
persistence: this.persistence,
}, ...(this.tabulatorOptions || {})};
if (!this.tableOnly) {
@@ -281,11 +288,15 @@ export const CoreFilterCmpt = {
const cols = this.tabulator.getColumns();
this.fields = cols.map(col => col.getField());
this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField());
if (this.tabulator.options.persistence.headerFilter)
this._setHeaderFilter();
});
}
this.tabulator.on("dataFiltered", filters => {
this.filterActive = filters.length > 0;
});
},
updateTabulator() {
if (this.tabulator) {
@@ -299,6 +310,23 @@ export const CoreFilterCmpt = {
this.tabulatorHasSelector = this.tabulatorOptions.selectable || this.filteredColumns.filter(el => el.formatter == 'rowSelection').length;
this.tabulator.setColumns(this.filteredColumns);
this.tabulator.setData(this.filteredData);
this._setHeaderFilter()
},
clearFilters()
{
let existingFilters = this.tabulator.getHeaderFilters();
existingFilters.forEach(filter => {
this.tabulator.setHeaderFilterValue(filter.field, "");
});
this.tabulator.clearFilter();
this.filterActive = false;
},
_setHeaderFilter()
{
const existingFilters = this.tabulator.getHeaderFilters();
existingFilters.forEach(filter => {
this.tabulator.setHeaderFilterValue(filter.field, filter.value);
});
},
/**
*
@@ -581,16 +609,21 @@ export const CoreFilterCmpt = {
alert('"nwNewEntry" listener is mandatory when sideMenu is true');
this.uuid = _uuid++;
this.$emit('uuidDefined', this.uuid)
if (!this.tableOnly)
this.getFilter(); // get the filter data
},
mounted() {
this.initTabulator();
this.initTabulator().then(() => {
if (!this.tableOnly) {
this.selectedFilter = window.location.hash ? window.location.hash.slice(1) : null;
this.getFilter(); // get the filter data
}
});
},
template: `
<!-- Load filter data -->
<core-fetch-cmpt
v-if="!tableOnly"
v-if="!tableOnly && fetchCmptApiFunction"
v-bind:api-function="fetchCmptApiFunction"
v-bind:api-function-parameters="fetchCmptApiFunctionParams"
v-bind:refresh="fetchCmptRefresh"
@@ -629,6 +662,9 @@ export const CoreFilterCmpt = {
<a v-if="!tableOnly || $slots.filter" href="#" class="btn btn-link px-0 text-dark" data-bs-toggle="collapse" :data-bs-target="'#collapseFilters' + idExtra">
<span class="fa-solid fa-xl fa-filter"></span>
</a>
<a v-if="filterActive" class="btn btn-link px-0 text-dark" :title="$p.t('ui','filterdelete')" @click="clearFilters">
<span class="fa-solid fa-xl fa-filter-circle-xmark"></span>
</a>
<a href="#" class="btn btn-link px-0 text-dark" data-bs-toggle="collapse" :data-bs-target="'#collapseColumns' + idExtra">
<span class="fa-solid fa-xl fa-table-columns"></span>
</a>