Merge branch 'bug-71363/FHC4_Stvw_Refactor_TabulatorOptions_As_Computed' into studvw_2026-02_rc4

This commit is contained in:
Harald Bamberger
2026-02-03 10:58:24 +01:00
8 changed files with 383 additions and 337 deletions
+44 -37
View File
@@ -33,7 +33,40 @@ export default {
},
data(){
return {
tabulatorOptions: {
isFilterSet: true,
listOrgHeads: [],
listOrgUnits: [], //Old
listAllOrgUnits: [],
listOrgUnits_GST: [],
listOrgUnits_GMBH: [],
formData: {
head: 'gst',
oe_kurzbz: '',
funktion_kurzbz: null,
label:'',
//funktion_label: '',
funktion: null,
},
statusNew: true,
listAllFunctions: [],
abortController: {
oes: null,
functions: null
},
filteredOes: [],
filteredFunctions: [],
newBtnStyle: '',
selectedFunction: null,
selectedOe: null,
layout: 'fitDataFill',
layoutColumnsOnNewData: false,
height: '300',
persistenceID: 'core-functions',
}
},
computed: {
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
ApiCoreFunktion.getAllUserFunctions(this.personUID)
@@ -142,12 +175,11 @@ export default {
frozen: true
}
],
layout: 'fitDataFill',
layoutColumnsOnNewData: false,
height: '300',
persistenceID: 'core-functions',
},
tabulatorEvents: [
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async () => {
@@ -193,36 +225,11 @@ export default {
title: this.$p.t('ui', 'bezeichnung'),
width: 140
});
}
}
],
isFilterSet: true,
listOrgHeads: [],
listOrgUnits: [], //Old
listAllOrgUnits: [],
listOrgUnits_GST: [],
listOrgUnits_GMBH: [],
formData: {
head: 'gst',
oe_kurzbz: '',
funktion_kurzbz: null,
label:'',
//funktion_label: '',
funktion: null,
},
statusNew: true,
listAllFunctions: [],
abortController: {
oes: null,
functions: null
},
filteredOes: [],
filteredFunctions: [],
newBtnStyle: '',
selectedFunction: null,
selectedOe: null
}
];
return events;
},
},
watch: {
selectedFunction(newVal) {
@@ -340,6 +347,8 @@ export default {
this.formData.head = 'gst';
this.formData.oe_kurzbz = '';
this.formData.funktion_kurzbz = '';
this.selectedFunction = null;
this.selectedOe= null;
},
filterFunctions(event) {
const query = event.query.toLowerCase();
@@ -460,14 +469,12 @@ export default {
</template>
<form-form class="row pt-3" ref="functionData">
<form-input
container-class="mb-3 col-8"
type="select"
name="companies"
:label="$p.t('core/unternehmen')"
v-model="formData.head"
@change="getOrgetsForCompanyOld"
>
<option
v-for="org in listOrgHeads"
@@ -25,7 +25,103 @@ export default {
},
data(){
return {
tabulatorOptions: {
previewBody: "",
open: false,
personId: null,
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: '400',
persistenceID: 'core-message-2025112401',
selectable: 1,
selectableRangeMode: 'click',
index: 'message_id',
}
},
methods: {
actionDeleteMessage(message_id){
this.$fhcAlert
.confirmDelete()
.then(result => result
? message_id
: Promise.reject({handled: true}))
.then(this.deleteMessage)
.catch(this.$fhcAlert.handleSystemError);
},
deleteMessage(message_id){
return this.$api
.call(ApiMessages.deleteMessage(message_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.reload();
});
},
actionNewMessage(){
this.$emit('newMessage', this.id, this.typeId);
},
actionReplyToMessage(message_id){
this.$emit('replyToMessage', this.id, this.typeId, message_id);
},
reload() {
this.$refs.table.reloadTable();
},
buildTreemap(messages) {
if (!messages || !messages.data || messages.data.length === 0)
{
return {data: [], last_page: 0};
}
const last_page = messages.meta.count;
messages = messages.data;
const messageMap = new Map();
const messageNested = [];
const remainingMessages = new Set(messages);
//save all Data in Map
messages.forEach(msg => messageMap.set(msg.message_id, msg));
let iteration = 0;
let changes = true;
// do until each relationmessage_id finds message_id (not sensitive to order)
while (changes) {
changes = false;
iteration++;
remainingMessages.forEach(msg => {
if (msg.relationmessage_id === null) {
messageNested.push(messageMap.get(msg.message_id));
remainingMessages.delete(msg);
changes = true;
} else if (messageMap.has(msg.relationmessage_id)) {
const parent = messageMap.get(msg.relationmessage_id);
if (!parent.children) {
parent.children = [];
}
parent.children.push(messageMap.get(msg.message_id));
remainingMessages.delete(msg);
changes = true;
}
});
// to avoid endless loop
if (iteration > messages.length) break;
}
return {data: messageNested, last_page: last_page};
},
loadAjaxCall(url, config, params){
return this.$api.call(
ApiMessages.getMessages(params)
);
}
},
computed: {
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: this.loadAjaxCall,
ajaxParams: () => {
@@ -154,13 +250,7 @@ export default {
},
frozen: true
}
],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: '400',
selectable: 1,
selectableRangeMode: 'click',
index: 'message_id',
],
pagination: true,
paginationMode: "remote",
paginationSize: 15,
@@ -171,7 +261,6 @@ export default {
dataTreeCollapseElement:"<i class='fas fa-minus-square'></i>",
dataTreeChildIndent: 15,
dataTreeStartExpanded: false,
persistenceID: 'core-message-2025112401',
locale: 'de',
"langs": {
"de":{ //German language definition
@@ -192,8 +281,11 @@ export default {
},
},
}
},
tabulatorEvents: [
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async() => {
@@ -238,118 +330,19 @@ export default {
]
});
this.$refs.table.tabulator.rowManager.getDisplayRows();
/*
cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});
*/
}
},
{
event: 'rowClick',
handler: (e, row) => {
const selectedMessage = row.getData().message_id;
const body = row.getData().body;
this.previewBody = body;
const selectedMessage = row.getData().message_id;
const body = row.getData().body;
this.previewBody = body;
}
},
/*
{
event: 'pageLoaded',
handler: (pageno) => {
this.pageNo = pageno+1;
}
}
*/
],
previewBody: "",
open: false,
personId: null,
}
},
methods: {
actionDeleteMessage(message_id){
this.$fhcAlert
.confirmDelete()
.then(result => result
? message_id
: Promise.reject({handled: true}))
.then(this.deleteMessage)
.catch(this.$fhcAlert.handleSystemError);
];
return events;
},
deleteMessage(message_id){
return this.$api
.call(ApiMessages.deleteMessage(message_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.reload();
});
},
actionNewMessage(){
this.$emit('newMessage', this.id, this.typeId);
},
actionReplyToMessage(message_id){
this.$emit('replyToMessage', this.id, this.typeId, message_id);
},
reload() {
this.$refs.table.reloadTable();
},
buildTreemap(messages) {
if (!messages || !messages.data || messages.data.length === 0)
{
return {data: [], last_page: 0};
}
const last_page = messages.meta.count;
messages = messages.data;
const messageMap = new Map();
const messageNested = [];
const remainingMessages = new Set(messages);
//save all Data in Map
messages.forEach(msg => messageMap.set(msg.message_id, msg));
let iteration = 0;
let changes = true;
// do until each relationmessage_id finds message_id (not sensitive to order)
while (changes) {
changes = false;
iteration++;
remainingMessages.forEach(msg => {
if (msg.relationmessage_id === null) {
messageNested.push(messageMap.get(msg.message_id));
remainingMessages.delete(msg);
changes = true;
} else if (messageMap.has(msg.relationmessage_id)) {
const parent = messageMap.get(msg.relationmessage_id);
if (!parent.children) {
parent.children = [];
}
parent.children.push(messageMap.get(msg.message_id));
remainingMessages.delete(msg);
changes = true;
}
});
// to avoid endless loop
if (iteration > messages.length) break;
}
return {data: messageNested, last_page: last_page};
},
loadAjaxCall(url, config, params){
return this.$api.call(
ApiMessages.getMessages(params)
);
}
},
computed: {
statusText(){
return {
0: this.$p.t('messsages', 'unread'),
@@ -361,13 +354,13 @@ export default {
},
mounted() {
// change to target="_blank"
/* this.$nextTick(() => {
const links = document.querySelectorAll('.preview a');
links.forEach(link => {
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer'); // Sicherheitsmaßnahme
});
});*/
/* this.$nextTick(() => {
const links = document.querySelectorAll('.preview a');
links.forEach(link => {
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'noopener noreferrer'); // Sicherheitsmaßnahme
});
});*/
},
created(){
if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) {
@@ -382,6 +375,7 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
}
},
template: `
<div class="messages-detail-table">
@@ -17,7 +17,18 @@ export default {
},
data(){
return {
tabulatorOptions: {
listDocuments: [],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 300,
selectable: true,
selectableRangeMode: 'click',
persistenceID: 'core-details-documents-accepted-2025072101',
}
},
computed: {
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
ApiStvDocuments.getDocumentsAccepted({
@@ -146,15 +157,11 @@ export default {
frozen: true
},
],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 300,
selectable: true,
selectableRangeMode: 'click',
persistenceID: 'core-details-documents-accepted-2025072101',
listDocuments: [],
},
tabulatorEvents: [
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async () => {
@@ -210,14 +217,15 @@ export default {
}
}
}
]
}
];
return events;
},
},
methods: {
actionDownloadFile(akte_id){
return FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ encodeURIComponent(akte_id);
},
actionUploadFile(dokument_kurzbz){
@@ -17,7 +17,19 @@ export default {
},
data(){
return {
tabulatorOptions: {
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 300,
selectable: true,
selectableRangeMode: 'click',
persistenceID: 'core-details-documents-unaccepted',
listDocuments: [],
prestudentDocumentData: [],
}
},
computed: {
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
ApiStvDocuments.getDocumentsUnaccepted({
@@ -42,7 +54,7 @@ export default {
hour12: false
});
}
},
},
{title: "nachgereicht", field: "nachgereicht", visible: false,
formatter:"tickCross",
hozAlign:"center",
@@ -76,7 +88,7 @@ export default {
return `${tickCrossIcon} ${pill}`;
},
hozAlign: "center"
},
},
{title: "Infotext", field: "infotext"},
{title: "akte_id", field: "akte_id"},
{title: "titel_intern", field: "titel_intern"},
@@ -162,16 +174,11 @@ export default {
frozen: true
},
],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 300,
selectable: true,
selectableRangeMode: 'click',
persistenceID: 'core-details-documents-unaccepted',
listDocuments: [],
prestudentDocumentData: [],
},
tabulatorEvents: [
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async () => {
@@ -221,14 +228,15 @@ export default {
}
}
}
]
}
];
return events;
},
},
methods: {
actionDownloadFile(akte_id){
return FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ encodeURIComponent(akte_id);
},
actionUploadFile(dokument_kurzbz){
@@ -277,9 +285,9 @@ export default {
dokument_kurzbz: e.dokument_kurzbz
}))
.then(() => ({
success: true,
dokument_bz: e.bezeichnung
}))
success: true,
dokument_bz: e.bezeichnung
}))
.catch(() => ({
success: false,
dokument_bz: e.bezeichnung
@@ -287,23 +295,23 @@ export default {
)
)
.then(results => {
const failed = results.filter(res => !res.value.success);
const suceeded = results.filter(res => res.value.success);
if (failed.length > 0) {
failed.forEach(res => {
this.$fhcAlert.alertError(this.$p.t('dokumente', 'errorAccepted',
{'dokument_kurzbz': res.value.dokument_bz}
));
});
let countSuceeded = suceeded.length;
if(countSuceeded > 0)
this.$fhcAlert.alertSuccess(this.$p.t('dokumente', 'successCountAccepted',
{'count': countSuceeded}));
const failed = results.filter(res => !res.value.success);
const suceeded = results.filter(res => res.value.success);
if (failed.length > 0) {
failed.forEach(res => {
this.$fhcAlert.alertError(this.$p.t('dokumente', 'errorAccepted',
{'dokument_kurzbz': res.value.dokument_bz}
));
});
let countSuceeded = suceeded.length;
if(countSuceeded > 0)
this.$fhcAlert.alertSuccess(this.$p.t('dokumente', 'successCountAccepted',
{'count': countSuceeded}));
} else {
this.$fhcAlert.alertSuccess(this.$p.t('dokumente', 'successAccepted'));
}
this.reloadAll();
} else {
this.$fhcAlert.alertSuccess(this.$p.t('dokumente', 'successAccepted'));
}
this.reloadAll();
});
},
deleteFile(akte_id){
@@ -23,7 +23,35 @@ export default{
},
data() {
return {
tabulatorOptions: {
addressData: {
zustelladresse: true,
heimatadresse: true,
rechnungsadresse: false,
typ: 'h',
nation: 'A',
address: {plz: null},
plz: null,
},
statusNew: true,
places: [],
suggestions: {},
nations: [],
adressentypen: [],
firmen: [],
listFirmen: [],
filteredFirmen: [],
selectedFirma: null,
abortController: {
suggestions: null,
places: null
},
index: 'adresse_id',
persistenceID: 'stv-details-kontakt-address'
}
},
computed:{
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(ApiStvAddress.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
@@ -122,11 +150,12 @@ export default{
frozen: true
},
],
height: 'auto',
index: 'adresse_id',
persistenceID: 'stv-details-kontakt-address'
},
tabulatorEvents: [
height: 'auto'
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async () => {
@@ -184,37 +213,11 @@ export default{
cm.getColumnByField('person_id').component.updateDefinition({
title: this.$p.t('person', 'person_id')
});
/* cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});*/
}
}
],
addressData: {
zustelladresse: true,
heimatadresse: true,
rechnungsadresse: false,
typ: 'h',
nation: 'A',
address: {plz: null},
plz: null,
},
statusNew: true,
places: [],
suggestions: {},
nations: [],
adressentypen: [],
firmen: [],
listFirmen: [],
filteredFirmen: [],
selectedFirma: null,
abortController: {
suggestions: null,
places: null
},
}
},
computed:{
];
return events;
},
orte() {
return this.places.filter(ort => ort.name == this.addressData.gemeinde);
},
@@ -17,8 +17,20 @@ export default{
uid: Number
},
data() {
return{
tabulatorOptions: {
return {
lastSelected: null,
bankverbindungData: {
verrechnung: true,
typ: 'p'
},
statusNew: true,
index: 'bankverbindung_id',
persistenceID: 'stv-details-kontakt-bankaccount'
}
},
computed: {
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(ApiStvBankaccount.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
@@ -86,11 +98,12 @@ export default{
frozen: true
},
],
height: 'auto',
index: 'bankverbindung_id',
persistenceID: 'stv-details-kontakt-bankaccount'
},
tabulatorEvents: [
height: 'auto'
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async() => {
@@ -123,19 +136,11 @@ export default{
cm.getColumnByField('bankverbindung_id').component.updateDefinition({
title: this.$p.t('ui', 'bankverbindung_id')
});
/* cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});*/
}
}
],
lastSelected: null,
bankverbindungData: {
verrechnung: true,
typ: 'p'
},
statusNew: true
}
];
return events;
},
},
watch: {
uid() {
@@ -7,7 +7,7 @@ import FormInput from '../../../../Form/Input.js';
import ApiStvContact from '../../../../../api/factory/stv/kontakt/contact.js';
import ApiStvCompany from '../../../../../api/factory/stv/kontakt/company.js';
export default{
export default {
name: 'ContactComponent',
components: {
CoreFilterCmpt,
@@ -20,8 +20,42 @@ export default{
uid: Number
},
data() {
return{
tabulatorOptions: {
return {
lastSelected: null,
contactData: {
zustellung: true,
kontakttyp: 'email',
firma_id: null
},
statusNew: true,
kontakttypen: [],
firmen: [],
filteredFirmen: [],
filteredOrte: null,
abortController: {
firmen: null,
standorte: null
},
lastSelected: null,
contactData: {
zustellung: true,
kontakttyp: 'email',
firma_id: null
},
statusNew: true,
kontakttypen: [],
firmen: [],
filteredFirmen: [],
filteredOrte: null,
abortController: {
firmen: null,
standorte: null
},
}
},
computed: {
tabulatorOptions(){
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(ApiStvContact.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
@@ -94,11 +128,12 @@ export default{
frozen: true
},
],
height: 'auto',
index: 'kontakt_id',
persistenceID: 'stv-details-kontakt-contact'
},
tabulatorEvents: [
height: 'auto'
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'tableBuilt',
handler: async() => {
@@ -139,27 +174,11 @@ export default{
cm.getColumnByField('standort_id').component.updateDefinition({
title: this.$p.t('ui', 'standort_id')
});
/* cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});*/
}}
],
lastSelected: null,
contactData: {
zustellung: true,
kontakttyp: 'email',
firma_id: null
},
statusNew: true,
kontakttypen: [],
firmen: [],
filteredFirmen: [],
filteredOrte: null,
abortController: {
firmen: null,
standorte: null
},
}
}
}
];
return events;
},
},
watch: {
uid() {
@@ -37,7 +37,44 @@ export default {
},
data() {
return {
tabulatorOptions: {
formData: {
von: new Date(),
bis: new Date(),
mobilitaetsprogramm_code: 7,
nation_code: 'A',
herkunftsland_code: 'A',
bisio_id: null,
localPurposes: [],
localSupports: [],
lehrveranstaltung_id: null,
lehreinheit_id: null
},
statusNew: true,
programsMobility: [],
listLvs: [],
listLes: [],
listLvsAndLes: [],
listPurposes: [],
listSupports: [],
tabulatorData: [],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'bisio_id',
persistenceID: 'stv-details-table_mobiliy-2025112401'
}
},
watch: {
student(){
if (this.$refs.table) {
this.$refs.table.reloadTable();
}
},
},
computed:{
tabulatorOptions() {
const options = {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
ApiStvMobility.getMobilitaeten(this.student.uid)
@@ -63,8 +100,8 @@ export default {
},
{
title: "Bis",
field: "bis",
formatter: function (cell) {
field: "bis",
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
@@ -109,18 +146,15 @@ export default {
frozen: true
},
],
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'bisio_id',
persistenceID: 'stv-details-table_mobiliy-2025112401'
},
tabulatorEvents: [
};
return options;
},
tabulatorEvents() {
const events = [
{
event: 'dataLoaded',
handler: data => this.tabulatorData = data.map(item => {
// item.actionDiv = document.createElement('div');
// item.actionDiv = document.createElement('div');
return item;
}),
},
@@ -147,43 +181,11 @@ export default {
cm.getColumnByField('bisio_id').component.updateDefinition({
title: this.$p.t('mobility', 'bisio_id')
});
/* cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});*/
}
}
],
formData: {
von: new Date(),
bis: new Date(),
mobilitaetsprogramm_code: 7,
nation_code: 'A',
herkunftsland_code: 'A',
bisio_id: null,
localPurposes: [],
localSupports: [],
lehrveranstaltung_id: null,
lehreinheit_id: null
},
statusNew: true,
programsMobility: [],
listLvs: [],
listLes: [],
listLvsAndLes: [],
listPurposes: [],
listSupports: [],
tabulatorData: []
}
},
watch: {
student(){
if (this.$refs.table) {
this.$refs.table.reloadTable();
}
];
return events;
},
},
computed:{
lv_teile(){
return this.listLvsAndLes.filter(lv => lv.lehreinheit_id == this.formData.lehreinheit_id);
},