Merge branch 'master' into epic-56039/LV-Evaluierung

This commit is contained in:
Cristina
2025-12-09 17:06:06 +01:00
59 changed files with 2320 additions and 394 deletions
+2 -1
View File
@@ -407,6 +407,7 @@ html {
background-color: var(--fhc-background);
border-color: var(--fhc-border);
padding: var(--fhc-cis-main-py) var(--fhc-cis-main-px);
min-width: 0; /* fix flex-grow with tabulator exceeding width */
}
#cis-main .fa-arrow-up-right-from-square {
@@ -854,4 +855,4 @@ html {
#cis-main .modal-footer {
background-color: var(--fhc-secondary);
}
}
+25 -1
View File
@@ -11,6 +11,24 @@
html {
font-size: .875em;
}
html.fs_xx-small {
font-size: .5em;
}
html.fs_x-small {
font-size: .625em;
}
html.fs_small {
font-size: .75em;
}
html.fs_normal {
font-size: .875em;
}
html.fs_big {
font-size: 1em;
}
html.fs_huge {
font-size: 1.125em;
}
#appMenu {
width: 300px;
@@ -43,6 +61,12 @@ html {
flex: 1 1 auto;
}
#nav-user-btn img {
object-fit: contain;
height: 2.5rem;
width: 2.5rem;
}
.tabulator-row.disabled.tabulator-row-odd .tabulator-cell {
color: var(--gray-400);
}
@@ -160,4 +184,4 @@ html {
.tiny-90 div.tox.tox-tinymce {
height: 90% !important;
}
}
+4
View File
@@ -16,11 +16,15 @@
padding: .5rem 1rem;
text-decoration: none;
}
.fhc-app-menu li a.disabled {
--bs-link-opacity: .5;
}
.fhc-app-menu li a.active,
.fhc-app-menu li a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
background: var(--surface-hover);
}
.fhc-app-menu li a.disabled,
.fhc-app-menu li a.active {
pointer-events: none;
}
+32
View File
@@ -0,0 +1,32 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
get() {
return {
method: 'get',
url: 'api/frontend/v1/stv/config/get'
};
},
set(params) {
return {
method: 'post',
url: 'api/frontend/v1/stv/config/set',
params
};
}
};
+8
View File
@@ -46,6 +46,14 @@ export default {
url: url
};
},
search(params, studiensemester_kurzbz) {
return {
method: 'post',
url: 'api/frontend/v1/stv/students/search/'
+ encodeURIComponent(studiensemester_kurzbz),
params
};
},
verband(relative_path) {
return {
method: 'get',
+38
View File
@@ -148,6 +148,44 @@ const router = VueRouter.createRouter({
next();
}
},
{
name: 'search',
path: `/${ciPath}/studentenverwaltung/:studiensemester_kurzbz/search/:searchstr`,
component: FhcStudentenverwaltung,
props(route) {
return {
url_studiensemester_kurzbz: route.params.studiensemester_kurzbz,
url_mode: 'search',
url_prestudent_id: route.params.searchstr
};
},
beforeEnter(to, from, next) {
const isSemester = /^[WS]S\d{4}$/.test(to.params.studiensemester_kurzbz);
if (!isSemester) {
return next({name: 'index'});
}
next();
}
},
{
name: 'search_w_types',
path: `/${ciPath}/studentenverwaltung/:studiensemester_kurzbz/search/:types/:searchstr`,
component: FhcStudentenverwaltung,
props(route) {
return {
url_studiensemester_kurzbz: route.params.studiensemester_kurzbz,
url_mode: 'search',
url_prestudent_id: route.params.type + '/' + route.params.searchstr
};
},
beforeEnter(to, from, next) {
const isSemester = /^[WS]S\d{4}$/.test(to.params.studiensemester_kurzbz);
if (!isSemester) {
return next({name: 'index'});
}
next();
}
},
{
path: '/:pathMatch(.*)*',
redirect: {
+135
View File
@@ -0,0 +1,135 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import BsModal from "./Bootstrap/Modal.js";
import FhcForm from "./Form/Form.js";
import FormInput from "./Form/Input.js";
export default {
name: 'AppConfig',
components: {
BsModal,
FhcForm,
FormInput
},
emits: [
'update:modelValue'
],
props: {
modelValue: {
type: Object,
required: true
},
endpoints: {
type: Object,
required: true
}
},
data() {
return {
setup: {},
tempValues: {}
};
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined && Object.keys(this.setup).length) {
this.$api
.call(this.endpoints.get())
.then(res => {
this.setup = {};
Object.keys(res.data).forEach(key => {
const binding = { ...res.data[key] };
delete binding.value;
delete binding.options;
const options = res.data[key].options;
this.setup[key] = {
binding,
options
};
});
})
.catch(this.$fhcAlert.handleSystemErrors);
}
}
},
methods: {
update() {
this.$refs.form
.call(this.endpoints.set(this.tempValues))
.then(() => {
this.$emit('update:modelValue', { ...this.tempValues });
this.$refs.modal.hide();
this.$fhcAlert.alertSuccess(this.$p.t('ui/settings_saved'));
})
.catch(this.$fhcAlert.handleSystemErrors);
}
},
created() {
this.$api
.call(this.endpoints.get())
.then(res => {
Object.keys(res.data).forEach(key => {
const binding = { ...res.data[key] };
delete binding.value;
delete binding.options;
const options = res.data[key].options;
this.tempValues[key] = res.data[key].value;
this.setup[key] = {
binding,
options
};
});
this.$emit('update:modelValue', { ...this.tempValues });
})
.catch(this.$fhcAlert.handleSystemErrors);
},
template: /* html */`
<fhc-form class="stv-config" ref="form" @submit.prevent="update">
<bs-modal
ref="modal"
class="fade"
id="configModal"
dialog-class="modal-lg"
@hidden-bs-modal="tempValues = { ...modelValue }"
>
<template #title>{{ $p.t('ui/settings') }}</template>
<template #default>
<div class="d-flex flex-column gap-5">
<form-input
v-for="(value, key) in setup"
v-model="tempValues[key]"
v-bind="value.binding"
>
<option
v-for="(label, val) in value.options"
:key="val"
:value="val"
>{{ label }}</option>
</form-input>
</div>
</template>
<template #footer>
<button class="btn btn-primary" type="submit">
{{ $p.t('ui/speichern') }}
</button>
</template>
</bs-modal>
</fhc-form>`
};
+1
View File
@@ -64,5 +64,6 @@ export default {
{{ menu.description }}
</a>
</li>
<slot />
</ul>`
};
+1 -1
View File
@@ -316,7 +316,7 @@ export default {
template: /* html */`
<div
class="fhc-calendar-base-grid"
style="display:grid;width:100%;height:100%"
style="display:grid;width:100%;height:100%;overflow:auto"
:style="'grid-template-' + axisRow + 's:auto' + (allDayEvents ? ' auto ' : ' ') + '1fr;grid-template-' + axisCol + 's:auto ' + styleGridCols"
>
<div
@@ -124,6 +124,10 @@ export default {
? `${this.stg}/${this.semester}`
: this.stg;
}
else
{
this.selectedStudiengang = '';
}
this.filter = filter;
},
handleRowClicked(data)
@@ -163,6 +167,7 @@ export default {
const routeName = this.filter.emp ? 'byEmp' : 'byStg';
const params = { stg };
params.semester = '';
if (semester !== null)
params.semester = semester;
if (studiensemester_kurzbz)
@@ -132,9 +132,10 @@ export default {
frozen: true
}
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: '400',
selectable: 1,
selectableRangeMode: 'click',
index: 'message_id',
pagination: true,
@@ -147,7 +148,7 @@ export default {
dataTreeCollapseElement:"<i class='fas fa-minus-square'></i>",
dataTreeChildIndent: 15,
dataTreeStartExpanded: false,
persistenceID: 'core-message',
persistenceID: 'core-message-2025112401',
locale: 'de',
"langs": {
"de":{ //German language definition
+231 -12
View File
@@ -16,8 +16,10 @@
*/
import CoreSearchbar from "../searchbar/searchbar.js";
import NavLanguage from "../navigation/Language.js";
import VerticalSplit from "../verticalsplit/verticalsplit.js";
import AppMenu from "../AppMenu.js";
import AppConfig from "../AppConfig.js";
import StvVerband from "./Studentenverwaltung/Verband.js";
import StvList from "./Studentenverwaltung/List.js";
import StvDetails from "./Studentenverwaltung/Details.js";
@@ -26,14 +28,17 @@ import StvStudiensemester from "./Studentenverwaltung/Studiensemester.js";
import ApiSearchbar from "../../api/factory/searchbar.js";
import ApiStv from "../../api/factory/stv.js";
import ApiStvVerband from '../../api/factory/stv/verband.js';
import ApiStvConfig from '../../api/factory/stv/config.js';
export default {
name: 'Studentenverwaltung',
components: {
CoreSearchbar,
NavLanguage,
VerticalSplit,
AppMenu,
AppConfig,
StvVerband,
StvList,
StvDetails,
@@ -45,6 +50,8 @@ export default {
permissions: Object,
stvRoot: String,
cisRoot: String,
avatarUrl: String,
logoutUrl: String,
activeAddons: String, // semicolon separated list of active addons
url_studiensemester_kurzbz: String,
url_mode: String,
@@ -76,15 +83,19 @@ export default {
},
configShowAufnahmegruppen: this.config.showAufnahmegruppen,
configAllowUebernahmePunkte: this.config.allowUebernahmePunkte,
configUseReihungstestPunkte: this.config.useReihungstestPunkte
configUseReihungstestPunkte: this.config.useReihungstestPunkte,
appConfig: Vue.computed(() => this.appconfig)
}
},
data() {
return {
appconfig: {},
configEndpoints: ApiStvConfig,
selected: [],
searchbaroptions: {
origin: 'stv',
calcheightonly: true,
nolivesearch: true,
types: {
student: Vue.computed(() => this.$p.t('search/type_student')),
prestudent: Vue.computed(() => this.$p.t('search/type_prestudent'))
@@ -123,6 +134,8 @@ export default {
studiengangKz: undefined,
studiengangKuerzel: '',
studiensemesterKurzbz: this.defaultSemester,
selected_semester: undefined,
selected_orgform: undefined,
lists: {
nations: [],
sprachen: [],
@@ -131,12 +144,60 @@ export default {
verbandEndpoint: ApiStvVerband
}
},
computed: {
appMenuExtraItems() {
const extraItems = [];
if (this.studiengangKz !== undefined && this.selected_semester !== undefined) {
const studiengang_kz = String(this.studiengangKz);
const semester = String(this.selected_semester);
const orgform = this.selected_orgform || '';
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel.php?typ=xls'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_xls'
});
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel_erweitert.php?typ=xls'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_xls_extended'
});
extraItems.push({
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'content/statistik/notenspiegel.php?typ=html'
+ '&studiengang_kz=' + studiengang_kz
+ '&semester=' + semester
+ '&studiensemester=' + this.studiensemesterKurzbz
+ '&orgform=' + orgform,
description: 'stv/grade_report_html'
});
}
return extraItems;
}
},
watch: {
'url_studiensemester_kurzbz': function (newVal, oldVal) {
if (newVal !== oldVal) {
this.studiensemesterKurzbz = newVal;
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
if(this.$route.name === 'search')
{
this.handleSearchUrl();
}
else
{
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
}
}
},
'url_studiengang': function (newVal, oldVal) {
@@ -146,6 +207,25 @@ export default {
},
'url_mode': function () {
this.handlePersonUrl();
},
url_prestudent_id() {
this.handlePersonUrl();
},
'appconfig.font_size'() {
// add to html class
const classList = Object.keys(this.$refs.config.setup.font_size.options);
classList.forEach(cn => document.documentElement.classList.remove(cn));
document.documentElement.classList.add(this.appconfig.font_size);
// recalc Tabulator heights
if (this.$el) {
const tabulatorEls = this.$el.querySelectorAll('.tabulator');
for (const el of tabulatorEls) {
const tabulators = Tabulator.findTable(el);
if (tabulators) {
tabulators[0].searchRows().forEach(row => row.normalizeHeight());
}
}
}
}
},
methods: {
@@ -159,7 +239,7 @@ export default {
}
},
buildPrestudentSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/prestudent/'
@@ -167,7 +247,7 @@ export default {
);
},
buildStudentSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/student/'
@@ -175,14 +255,14 @@ export default {
);
},
buildPersonSearchResultLink(data) {
return this.$fhcApi.getUri(
return this.$api.getUri(
'/studentenverwaltung'
+ '/' + this.studiensemesterKurzbz
+ '/person/'
+ data.person_id
);
},
onSelectVerband( {link, studiengang_kz}) {
onSelectVerband({ link, studiengang_kz, semester, orgform_kurzbz }) {
let urlpath = String(link);
if (!urlpath.match(/\/prestudent/))
{
@@ -191,6 +271,8 @@ export default {
this.$refs.stvList.updateUrl(ApiStv.students.verband(urlpath));
this.studiengangKz = studiengang_kz;
this.selected_semester = semester;
this.selected_orgform = orgform_kurzbz;
const stg = this.lists.stgs.find((element) => {
return (element.studiengang_kz === this.studiengangKz);
});
@@ -223,9 +305,6 @@ export default {
studiensemester_kurzbz: v
}
});
this.$refs.stvList.updateUrl();
this.$refs.details.reload();
},
reloadList() {
this.$refs.stvList.reload();
@@ -249,6 +328,37 @@ export default {
ApiStv.students.person(this.$route.params.person_id, 'CURRENT_SEMESTER'),
true
);
} else if (this.$route.params.searchstr) {
this.handleSearchUrl();
}
else
{
this.clearTabulator();
}
},
handleSearchUrl() {
const searchsettings = {
searchstr: this.$route.params.searchstr,
types: this.$route.params.types?.split('+') || []
};
// init into student list
this.$refs.stvList.updateUrl(
ApiStv.students.search(searchsettings, this.studiensemesterKurzbz)
);
// init into searchbar
this.$refs.searchbar.searchsettings.searchstr = searchsettings.searchstr;
this.$refs.searchbar.searchsettings.types = searchsettings.types;
this.$nextTick(this.blurSearchbar);
},
clearTabulator() {
if(['index', 'studiensemester'].includes(this.$route.name))
{
if(this.$refs?.stvList?.$refs?.table?.tabulator)
{
this.$refs.stvList.$refs.table.tabulator.setData([]);
}
}
},
checkUrlStudiengang() {
@@ -269,6 +379,42 @@ export default {
});
}
}
else
{
this.studiengangKz = undefined;
this.studiengangKuerzel = '';
this.clearTabulator();
}
},
onSearch(e) {
const searchsettings = { ...this.$refs.searchbar.searchsettings };
if (searchsettings.searchstr.length >= 2) {
this.blurSearchbar();
if (!searchsettings.types.length || searchsettings.types.length == this.$refs.searchbar.types.length) {
this.$router.push({
name: 'search',
params: {
studiensemester_kurzbz: this.studiensemesterKurzbz,
searchstr: searchsettings.searchstr
}
});
} else {
this.$router.push({
name: 'search_w_types',
params: {
studiensemester_kurzbz: this.studiensemesterKurzbz,
searchstr: searchsettings.searchstr,
types: searchsettings.types.join('+')
}
});
}
}
},
blurSearchbar() {
this.$refs.searchbar.$refs.input.blur();
this.$refs.searchbar.abort();
this.$refs.searchbar.hideresult();
}
},
created() {
@@ -376,10 +522,58 @@ export default {
<span class="fa-solid fa-table-list"></span>
</button>
<core-searchbar
ref="searchbar"
:searchoptions="searchbaroptions"
:searchfunction="searchfunction"
class="searchbar position-relative w-100"
show-btn-submit
@submit.prevent="onSearch"
></core-searchbar>
<div id="nav-user" class="dropdown">
<button
id="nav-user-btn"
class="btn btn-link rounded-0 py-0"
type="button"
data-bs-toggle="dropdown"
data-bs-target="#nav-user-menu"
aria-expanded="false"
aria-controls="nav-user-menu"
>
<img
:src="avatarUrl"
:alt="$p.t('profilUpdate/profilBild')"
class="bg-light avatar rounded-circle border border-light"
/>
</button>
<ul
ref="navUserDropdown"
class="dropdown-menu dropdown-menu-dark dropdown-menu-end rounded-0 text-center m-0"
aria-labelledby="nav-user-btn"
>
<li>
<button
type="button"
class="dropdown-item"
data-bs-toggle="modal"
data-bs-target="#configModal"
>
{{ $p.t('ui/settings') }}
</button>
</li>
<li><hr class="dropdown-divider m-0"/></li>
<li>
<nav-language
item-class="dropdown-item border-left-dark"
/>
</li>
<li><hr class="dropdown-divider m-0"/></li>
<li>
<a class="dropdown-item" :href="logoutUrl">
{{ $p.t('ui/logout') }}
</a>
</li>
</ul>
</div>
</header>
<div class="container-fluid overflow-hidden">
<div class="row h-100">
@@ -389,14 +583,38 @@ export default {
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
</div>
<div class="offcanvas-body">
<app-menu app-identifier="stv" />
<app-menu app-identifier="stv">
<li class="dropend">
<a
class="dropdown-toggle"
href="#"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false"
:class="{ disabled: !appMenuExtraItems.length }"
data-bs-popper-config='{"strategy":"fixed"}'
>
{{ $p.t('stv/grade_report') }}
</a>
<ul class="dropdown-menu p-0">
<li
v-for="(item, key) in appMenuExtraItems"
:key="key"
>
<a class="dropdown-item" :href="item.link" target="_blank">
{{ $p.t(item.description) }}
</a>
</li>
</ul>
</li>
</app-menu>
</div>
</aside>
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
<div class="offcanvas-header justify-content-end px-1 d-md-none">
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
</div>
<stv-verband :preselectedKey="'' + studiengangKz" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
<stv-verband :preselectedKey="studiengangKz ? '' + studiengangKz : null" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
<stv-studiensemester v-model:studiensemester-kurzbz="studiensemesterKurzbz" @update:studiensemester-kurzbz="studiensemesterChanged"></stv-studiensemester>
</nav>
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
@@ -411,5 +629,6 @@ export default {
</main>
</div>
</div>
<app-config ref="config" v-model="appconfig" :endpoints="configEndpoints"></app-config>
</div>`
};
@@ -41,25 +41,34 @@ export default {
return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid && !value.showOnlyWithUid));
}
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined)
this.loadConfig();
}
},
methods: {
loadConfig() {
this.$api
.call(ApiStvApp.configStudent())
.then(result => {
this.configStudent = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvApp.configStudents())
.then(result => {
this.configStudents = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
reload() {
if (this.$refs.tabs?.$refs?.current?.reload)
this.$refs.tabs.$refs.current.reload();
}
},
created() {
this.$api
.call(ApiStvApp.configStudent())
.then(result => {
this.configStudent = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvApp.configStudents())
.then(result => {
this.configStudents = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.loadConfig();
},
template: `
<div class="stv-details h-100 d-flex flex-column">
@@ -163,12 +163,12 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: '200',
index: 'abschlusspruefung_id',
persistenceID: 'stv-details-finalexam'
persistenceID: 'stv-details-finalexam-2025112401'
},
tabulatorEvents: [
{
@@ -107,10 +107,10 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
height: '500',
index: 'anrechnung_id',
persistenceID: 'stv-details-anrechnungen'
persistenceID: 'stv-details-anrechnungen-2025112401'
},
tabulatorEvents: [
{
@@ -120,12 +120,12 @@ export default {
frozen: true
}
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'aufnahmetermin_id',
persistenceID: 'stv-details-table_admission-dates'
persistenceID: 'stv-details-table_admission-dates-2025112401'
},
tabulatorEvents: [
{
@@ -0,0 +1,83 @@
export default {
name: "TabCombinePeople",
inject: {
cisRoot: {
from: 'cisRoot'
},
},
props: {
modelValue: Object,
},
data(){
return {
iframeUrl: null,
viewLoaded: false
}
},
computed: {
personIds() {
return Array.isArray(this.modelValue)
? this.modelValue.map(e => e.person_id)
: [this.modelValue.person_id];
},
detailStringPerson1(){
let person1 = this.modelValue[0];
return person1.vorname + " " + person1.nachname + "(" + person1.person_id + ")";
},
detailStringPerson2(){
let person2 = this.modelValue[1];
return person2.vorname + " " + person2.nachname + "(" + person2.person_id+ ")";
},
},
methods: {
combinePeople(){
this.viewLoaded = true;
let person1_id = this.personIds[0];
let person2_id = this.personIds[1];
if(person1_id == person2_id) {
return this.$fhcAlert.alertError(this.$p.t('stv', 'error_combinePeople_samePerson'));
}
let linkCombinePeople = this.cisRoot + 'vilesci/stammdaten/personen_wartung.php?person_id_1=' + person1_id + '&person_id_2='+ person2_id;
this.openLink(linkCombinePeople);
},
openLink(url) {
this.iframeUrl = url;
},
goBack(){
this.viewLoaded = false;
this.iframeUrl = null;
}
},
template: /*html*/ `
<div class="stv-details-combine-people h-100 pb-3">
<div v-if="!this.viewLoaded">
<h4>Personen zusammenlegen</h4>
<div v-if="this.modelValue.length">
<div v-if="this.modelValue.length == 2">
<p>{{$p.t('stv', 'question_combine_people', { person1: detailStringPerson1, person2: detailStringPerson2 })}}</p>
<button class="btn btn-primary" @click="combinePeople">{{$p.t('ui', 'ok')}}</button>
</div>
<div v-else>
ungültige Anzahl: {{this.modelValue.length}} <!-- should not be seen anymore-->
</div>
</div>
</div>
<div v-else>
<button class="btn btn-secondary" @click="goBack">{{$p.t('ui', 'cancel')}}</button>
</div>
<!-- Iframe-Section -->
<iframe
v-if="iframeUrl"
:src="iframeUrl"
class="w-100 mt-4 border-0"
style="height: 600px;"
></iframe>
</div>
`
};
@@ -71,10 +71,10 @@ export default {
frozen: true
},
],
layout: 'fitColumns',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 200,
persistenceID: 'core-mobility-purpose'
persistenceID: 'core-mobility-purpose-2025112401'
},
tabulatorEvents: [
{
@@ -69,10 +69,10 @@ export default {
frozen: true
},
],
layout: 'fitColumns',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 200,
persistenceID: 'core-mobility-support'
persistenceID: 'core-mobility-support-2025112401'
},
tabulatorEvents: [
{
@@ -109,12 +109,12 @@ export default {
frozen: true
},
],
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: 200,
index: 'bisio_id',
persistenceID: 'stv-details-table_mobiliy'
persistenceID: 'stv-details-table_mobiliy-2025112401'
},
tabulatorEvents: [
{
@@ -217,9 +217,13 @@ export default {
},
columns,
height: '100%',
layout: 'fitDataStretchFrozen',
selectable: 1,
selectableRangeMode: 'click',
persistenceID: 'stv-details-noten-zeugnis'
persistenceID: 'stv-details-noten-zeugnis-2025112401',
persistence:{
columns: ["width", "visible", "frozen"]
}
};
}
},
@@ -287,4 +291,4 @@ export default {
<zeugnis-documents :data="grade" :list="config.documentslist"></zeugnis-documents>
</Teleport>
</div>`
};
};
@@ -227,15 +227,15 @@ export default{
const rowData = row.getData();
if (this.dataMeldestichtag && this.dataMeldestichtag > rowData.datum)
{
row.getElement().classList.add('disabled');
row.getElement().classList.add('text-black','text-opacity-50','fst-italic');
}
},
layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
selectable: false,
index: 'statusId',
persistenceID: 'stv-multistatus'
persistenceID: 'stv-multistatus-2025112401'
},
tabulatorEvents: [
{
@@ -40,6 +40,9 @@ export default {
}
return lehreinheiten;
},
firmenverwaltungLink(){
return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'vilesci/stammdaten/firma_frameset.html';
}
},
props: {
@@ -255,18 +258,25 @@ export default {
<div class="row mb-3">
<form-input
container-class="stv-details-projektarbeit-firma"
:label="$p.t('projektarbeit', 'firma')"
type="autocomplete"
optionLabel="name"
v-model="formData.firma"
name="firma"
:suggestions="filteredFirmen"
@complete="searchFirma"
:min-length="3"
>
</form-input>
<div class="col-10">
<form-input
container-class="stv-details-projektarbeit-firma"
:label="$p.t('projektarbeit', 'firma')"
type="autocomplete"
optionLabel="name"
v-model="formData.firma"
name="firma"
:suggestions="filteredFirmen"
@complete="searchFirma"
:min-length="3"
>
</form-input>
</div>
<div class="col-2 align-content-center">
<a :href="firmenverwaltungLink" target="_blank">
{{ $p.t('projektarbeit', 'zurFirmenverwaltung') }}
</a>
</div>
</div>
<div class="row mb-3">
@@ -240,7 +240,7 @@ export default {
frozen: true
},
],
//layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
height: 'auto',
minHeight: '200',
selectable: 1,
@@ -248,7 +248,7 @@ export default {
persistence:{
columns: true, //persist column layout
},
persistenceID: 'stv-details-projektarbeit'
persistenceID: 'stv-details-projektarbeit-2025112401'
}
return options;
}
@@ -396,8 +396,8 @@ export default {
<template #footer>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
<button v-if="statusNew" class="btn btn-primary" @click="addNewProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="!statusNew && activeTab == 'details'" class="btn btn-primary" @click="updateProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="statusNew" class="btn btn-primary" @click="addNewProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
<button v-if="!statusNew && activeTab == 'details'" class="btn btn-primary" @click="updateProjektarbeit()"> {{$p.t('ui', 'speichern')}}</button>
</template>
</bs-modal>
@@ -115,7 +115,7 @@ export default {
frozen: true
},
],
//layout: 'fitDataFill',
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
height: 'auto',
minHeight: '100',
@@ -125,7 +125,7 @@ export default {
persistence:{
columns: true, //persist column layout
},
persistenceID: 'stv-details-projektbetreuer'
persistenceID: 'stv-details-projektbetreuer-2025112401'
},
tabulatorEvents: [
{
@@ -46,8 +46,6 @@ export default{
{title: "Punkte", field: "punkte", visible: false},
{
title: 'Aktionen', field: 'actions',
minWidth: 150,
maxWidth: 150,
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
@@ -93,7 +91,7 @@ export default{
layoutColumnsOnNewData: false,
height: 'auto',
index: 'pruefung_id',
persistenceID: 'stv-details-pruefung-list'
persistenceID: 'stv-details-pruefung-list-2025112402'
},
tabulatorEvents: [
{
@@ -148,7 +146,6 @@ export default{
listMas: [],
listMarks: [],
zeugnisData: [],
checkData:[],
filter: false,
statusNew: true,
isStartDropDown: false,
@@ -181,7 +178,7 @@ export default{
this.pruefungData.student_uid = this.uid;
this.pruefungData.note = 9;
this.pruefungData.datum = new Date();
this.pruefungData.datum = luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
this.pruefungData.pruefungstyp_kurzbz = null;
if(lv_id){
this.pruefungData.lehrveranstaltung_id = lv_id;
@@ -193,7 +190,7 @@ export default{
this.isStartDropDown = false;
this.loadPruefung(pruefung_id).then(() => {
this.pruefungData.note = 9;
this.pruefungData.datum = new Date();
this.pruefungData.datum = luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
this.pruefungData.pruefungstyp_kurzbz = null;
this.pruefungData.anmerkung = null;
this.prepareDropdowns();
@@ -229,9 +226,8 @@ export default{
return this.$refs.examData
.call(ApiStvExam.addPruefung(this.pruefungData))
.then(response => {
this.checkData = response.data;
if (this.checkData === 2 || this.checkData === 5)
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
if (response.data)
this.$fhcAlert.alertDefault('info', 'Info', response.data, true);
else
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
@@ -243,12 +239,13 @@ export default{
});
},
updatePruefung(pruefung_id){
this.checkChangeAfterExamDate();
return this.$refs.examData
.call(ApiStvExam.updatePruefung(pruefung_id, this.pruefungData))
.then(response => {
this.checkData = response.data;
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
if (response.data)
this.$fhcAlert.alertDefault('info', 'Info', response.data, true);
else
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
@@ -266,27 +263,6 @@ export default{
else
this.showHint = false;
},
checkChangeAfterExamDate() {
const data = {
student_uid: this.pruefungData.student_uid,
studiensemester_kurzbz: this.pruefungData.studiensemester_kurzbz,
lehrveranstaltung_id: this.pruefungData.lehrveranstaltung_id
};
return this.$api
.call(ApiStvExam.checkZeugnisnoteLv(data))
.then(result => {
this.zeugnisData = result.data;
let checkDate = this.zeugnisData[0].uebernahmedatum === '' ||
this.zeugnisData[0].benotungsdatum > this.zeugnisData[0].uebernahmedatum
? this.zeugnisData[0].benotungsdatum
: this.zeugnisData[0].uebernahmedatum;
if (checkDate >= this.pruefungData.datum
&& this.pruefungData.note !== this.zeugnisData[0].note) {
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
}
})
.catch(this.$fhcAlert.handleSystemError);
},
deletePruefung(pruefung_id) {
return this.$api
.call(ApiStvExam.deletePruefung(pruefung_id))
@@ -534,6 +510,7 @@ export default{
container-class="mb-3"
type="DatePicker"
v-model="pruefungData.datum"
model-type="yyyy-MM-dd"
name="datum"
:label="$p.t('global/datum')"
auto-apply
@@ -2,6 +2,8 @@ import {CoreFilterCmpt} from "../../filter/Filter.js";
import ListNew from './List/New.js';
import ListFilter from './List/Filter.js';
import { capitalize } from '../../../helpers/StringHelpers.js';
import draggable from '../../../directives/draggable.js';
export default {
@@ -133,7 +135,17 @@ export default {
{
return Promise.resolve({ data: []});
}
return this.$api.call({method: 'post', url, params});
/**
* NOTE(chris): Because of a bug in Tabulator
* we need to get the params from elsewhere.
* @see https://github.com/olifolkerd/tabulator/issues/4318
*/
const apiconfig = {
...this.tabulatorOptions.ajaxConfig,
url: this.tabulatorOptions.ajaxURL,
params: this.tabulatorOptions.ajaxParams
};
return this.$api.call(apiconfig);
},
ajaxResponse: (url, params, response) => {
return response?.data;
@@ -175,7 +187,7 @@ export default {
count: 0,
filteredcount: 0,
selectedcount: 0,
currentEndpointRawUrl: ''
currentEndpoint: null
}
},
computed: {
@@ -228,7 +240,84 @@ export default {
return "StudentList_" + today + ".csv";
}
},
watch: {
'$p.user_language.value'(n, o) {
if (n !== o && o !== undefined && this.$refs.table.tableBuilt) {
this.translateTabulator();
}
}
},
methods: {
translateTabulator() {
this.$p
.loadCategory(['global', 'person', 'lehre', 'ui', 'profilUpdate', 'admission', 'stv'])
.then(() => {
const translations = {
uid: capitalize(this.$p.t('person/uid')),
titelpre: capitalize(this.$p.t('person/titelpre')),
nachname: capitalize(this.$p.t('person/nachname')),
vorname: capitalize(this.$p.t('person/vorname')),
wahlname: capitalize(this.$p.t('person/wahlname')),
vornamen: capitalize(this.$p.t('person/vornamen')),
titelpost: capitalize(this.$p.t('person/titelpost')),
ersatzkennzeichen: capitalize(this.$p.t('person/ersatzkennzeichen')),
gebdatum: capitalize(this.$p.t('person/geburtsdatum')),
geschlecht: capitalize(this.$p.t('person/geschlecht')),
semester: capitalize(this.$p.t('lehre/sem')),
verband: capitalize(this.$p.t('lehre/verb')),
gruppe: capitalize(this.$p.t('lehre/grp')),
studiengang: capitalize(this.$p.t('lehre/studiengang')),
studiengang_kz: capitalize(this.$p.t('lehre/studiengang_kz')),
matrikelnr: capitalize(this.$p.t('person/personenkennzeichen')),
person_id: capitalize(this.$p.t('person/person_id')),
status: capitalize(this.$p.t('global/status')),
status_datum: capitalize(this.$p.t('profilUpdate/statusDate')),
status_bestaetigung: capitalize(this.$p.t('global/status_bestaetigung')),
mail_privat: capitalize(this.$p.t('person/email_private')),
mail_intern: capitalize(this.$p.t('person/email_intern')),
anmerkungen: capitalize(this.$p.t('stv/notes_person')),
anmerkung: capitalize(this.$p.t('stv/notes_prestudent')),
orgform_kurzbz: capitalize(this.$p.t('lehre/orgform')),
aufmerksamdurch_kurzbz: capitalize(this.$p.t('person/aufmerksamDurch')),
punkte: capitalize(this.$p.t('admission/gesamtpunkte')),
aufnahmegruppe_kurzbz: capitalize(this.$p.t('stv/aufnahmegruppe_kurzbz')),
dual: capitalize(this.$p.t('lehre/dual_short')),
matr_nr: capitalize(this.$p.t('person/matrikelnummer')),
studienplan_bezeichnung: capitalize(this.$p.t('lehre/studienplan')),
prestudent_id: capitalize(this.$p.t('ui/prestudent_id')),
priorisierung_relativ: capitalize(this.$p.t('lehre/prioritaet')),
mentor: capitalize(this.$p.t('stv/mentor')),
bnaktiv: capitalize(this.$p.t('person/aktiv'))
};
/** NOTE(chris):
* use this approach because updateDefinition
* on the Tabulator columns is way slower and
* freezes up the GUI.
*/
// Overwrite definition for column show/hide
this.$refs.table.tabulator.getColumns().forEach(col => {
const trans = translations[col.getField()];
if (!trans)
return;
col.getDefinition().title = trans;
});
// Overwrite node in dom
this.$refs.table.tabulator.element
.querySelectorAll('.tabulator-col[tabulator-field]')
.forEach(el => {
const field = el.getAttribute('tabulator-field');
if (!translations[field])
return;
const title = el.querySelector('.tabulator-col-title');
if (!title)
return;
title.innerText = translations[field];
});
});
},
reload() {
this.$refs.table.reloadTable();
},
@@ -273,16 +362,20 @@ export default {
updateUrl(endpoint, first) {
this.lastSelected = first ? undefined : this.selected;
if( endpoint === undefined )
console.log('function param endpoint: ' + JSON.stringify(endpoint));
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));
if( endpoint === undefined && this.currentEndpoint === null)
{
endpoint = {url: this.currentEndpointRawUrl};
}
else if( endpoint.url === undefined )
endpoint = { url: '' };
}
else if( endpoint === undefined )
{
endpoint.url = this.currentEndpointRawUrl;
} else
endpoint = JSON.parse(JSON.stringify(this.currentEndpoint));
}
else
{
this.currentEndpointRawUrl = endpoint.url;
this.currentEndpoint = JSON.parse(JSON.stringify(endpoint));
}
endpoint.url = endpoint.url.replace(
@@ -290,20 +383,25 @@ export default {
encodeURIComponent(this.currentSemester)
);
const params = {};
if (this.filter.length)
const params = (endpoint?.params !== undefined) ? endpoint.params : {};
let method = (endpoint?.method !== undefined) ? endpoint.method : 'get';
if (this.filter.length && !endpoint.url.match(/\/search\//))
{
params.filter = this.filter;
method = 'post';
}
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = { ...params };
this.tabulatorOptions.ajaxConfig = {method};
if (!this.$refs.table.tableBuilt) {
if (!this.$refs.table.tabulator) {
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = params;
} else
if (this.$refs.table.tabulator) {
this.$refs.table.tabulator.on("tableBuilt", () => {
this.$refs.table.tabulator.setData(endpoint.url, params);
this.$refs.table.tabulator.setData(endpoint.url, params, method);
});
}
} else
this.$refs.table.tabulator.setData(endpoint.url, params);
this.$refs.table.tabulator.setData(endpoint.url, params, method);
},
dragCleanup(evt) {
if (evt.dataTransfer.dropEffect == 'none')
@@ -402,6 +500,7 @@ export default {
*/`
:new-btn-label="$p.t('stv/action_new')"
@click:new="actionNewPrestudent"
@table-built="translateTabulator"
>
<template #filter>
<div class="card">
@@ -16,11 +16,17 @@ export default {
inject: {
$reloadList: {
from: '$reloadList',
required: true
default: () => {}
},
currentSemester: {
from: 'currentSemester',
required: true
},
appConfig: {
from: 'appConfig',
default: {
number_displayed_past_studiensemester: 5
}
}
},
emits: [
@@ -52,6 +58,9 @@ export default {
return this.nodes.filter(node => this.favorites.list.includes(node.key));
return this.nodes;
},
noSemReloadNodes() {
return this.nodes.reduce(this.mapNodesToNoSemReloadNodes, []);
}
},
watch: {
@@ -59,6 +68,14 @@ export default {
if (newVal !== oldVal) {
this.setPreselection();
}
},
'appConfig.number_displayed_past_studiensemester'(newVal, oldVal) {
if (oldVal !== undefined) {
this.noSemReloadNodes.forEach(node => {
delete node.children;
this.onExpandTreeNode(node);
});
}
}
},
methods: {
@@ -114,7 +131,14 @@ export default {
},
onSelectTreeNode(node) {
if (node.data.link)
this.$emit('selectVerband', {link: node.data.link, studiengang_kz: node.data.stg_kz});
this.$emit('selectVerband', {link: node.data.link, studiengang_kz: node.data.stg_kz, semester: node.data.semester, orgform_kurzbz: node.data.orgform_kurzbz});
},
mapNodesToNoSemReloadNodes(result, node) {
if (node.data.no_sem_reload)
result.push(node);
if (node.children)
result = node.children.reduce(this.mapNodesToNoSemReloadNodes, result);
return result;
},
mapResultToTreeData(el) {
const cp = {
@@ -187,22 +211,25 @@ export default {
if (!currentNode)
return;
const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
if (currentSelectedKey) {
if (currentSelectedKey == currentKey)
return;
/**
* Do not select a new entry if the current is a child of the new one.
* This happens if a child entry of a new stg is selected and the router
* tries to select the stg root entry (because subtrees do not have
* routes yet)
*/
const isChild = this.findNodeByKey(
currentSelectedKey,
currentNode.children
);
if (isChild)
return;
if(this.selectedKey)
{
const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
if (currentSelectedKey) {
if (currentSelectedKey == currentKey)
return;
/**
* Do not select a new entry if the current is a child of the new one.
* This happens if a child entry of a new stg is selected and the router
* tries to select the stg root entry (because subtrees do not have
* routes yet)
*/
const isChild = this.findNodeByKey(
currentSelectedKey,
currentNode.children || []
);
if (isChild)
return;
}
}
for (let i = 1; i < parts.length; i++)
+59 -3
View File
@@ -33,7 +33,8 @@ export default {
data() {
return {
current: null,
tabs: {}
tabs: {},
count: null
}
},
computed: {
@@ -113,10 +114,12 @@ export default {
};
}
if (Array.isArray(config))
if (Array.isArray(config)) {
config.forEach((item, key) => _addToTabs(key, item));
else
}
else {
Object.entries(config).forEach(([key, item]) => _addToTabs(key, item));
}
if (this.current === null || !tabs[this.current]) {
if (tabs[this.default])
@@ -129,6 +132,57 @@ export default {
updateSuffix() {
this.getTabSuffix(this.currentTab);
},
removeInvalidCountTabs(){
if(this.modelValue.length)
{
let countIst = this.modelValue.length;
const tabsToDelete = [];
Object.entries(this.config).forEach(([key, item]) => {
const target = item?.config ? item : item?.value || item;
// check config for validCountMulti
if (target.config?.validCountMulti !== undefined) {
let tab;
let countSoll;
tab = key;
countSoll = target.config.validCountMulti;
//check if tab is existing
if (countSoll !== undefined && countSoll == countIst) {
//add tab if it was removed before
if (tab in this.tabs == false) {
const value = Vue.reactive({
suffix: '',
showSuffix: item.showSuffix || false
});
this.tabs[tab] = {
component: Vue.markRaw(Vue.defineAsyncComponent(() => import(item.component))),
title: Vue.computed(() => item.title || tab),
config: item.config,
tab,
value,
suffixhelper: item.suffixhelper ?? null
};
}
}
//add to toDeleteArray if count is not allowed
if (countSoll !== undefined && countSoll !== countIst) {
tabsToDelete.push(tab);
}
}
});
// Delete all tabs with count not allowed
tabsToDelete.forEach(k => {
delete this.tabs[k];
});
}
},
async getTabSuffix(tab) {
if (!tab.value.showSuffix) {
return;
@@ -151,9 +205,11 @@ export default {
},
mounted() {
this.getTabSuffixes();
this.removeInvalidCountTabs();
},
updated() {
this.getTabSuffixes();
this.removeInvalidCountTabs();
},
template: `
<template v-if="useprimevue">
@@ -0,0 +1,62 @@
/**
* Copyright (C) 2025 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
emits: [
'changed'
],
props: {
activeClass: {
type: String,
default: 'active'
},
itemClass: {
type: [String, Array, Object],
default: ''
}
},
data() {
return {
languages: FHC_JS_DATA_STORAGE_OBJECT.server_languages
};
},
methods:{
onChange(lang) {
if (this.languages.some(l => l.sprache === lang)) {
this.$p
.setLanguage(lang)
.then(() => {
if (document.querySelector('[cis4Reload]'))
window.location.reload();
else
this.$emit('changed', lang);
});
}
}
},
template: /*html*/`
<div class="navigation-language d-flex justify-content-center align-items-center flex-nowrap overflow-hidden">
<button
v-for="lang in languages"
:class="[itemClass, {[activeClass]: $p.user_language.value == lang.sprache}]"
:selected="$p.user_language.value == lang.sprache"
@click.prevent="onChange(lang.sprache)"
>
{{ lang.bezeichnung }}
</button>
</div>`
};
+43 -14
View File
@@ -23,7 +23,17 @@ export default {
mergedStudent,
mergedPerson
},
props: [ "searchoptions", "searchfunction" ],
props: {
searchoptions: {
type: Object,
required: true
},
searchfunction: {
type: Function,
required: true
},
showBtnSubmit: Boolean
},
provide() {
return {
query: Vue.computed(() => this.lastQuery)
@@ -102,11 +112,22 @@ export default {
>
<button
v-if="searchsettings.searchstr"
type="button"
class="searchbar_input_clear btn btn-outline-secondary"
@click="clearInput"
@focusin.stop
>
<i class="fas fa-close"></i>
</button>
<button
v-if="showBtnSubmit"
type="submit"
class="btn btn-primary"
:title="$p.t('search/submit')"
:aria-label="$p.t('search/submit')"
>
<i class="fas fa-search"></i>
</button>
<button
data-bs-toggle="collapse"
data-bs-target="#searchSettings"
@@ -219,12 +240,12 @@ export default {
});
}
},
methods: {
clearInput() {
this.searchsettings.searchstr = "";
this.hideresult();
this.$refs.input.focus()
},
methods: {
clearInput() {
this.searchsettings.searchstr = "";
this.hideresult();
this.$refs.input.focus();
},
getInitiallySelectedTypes() {
let result = false;
if (this.searchoptions.origin) {
@@ -283,13 +304,9 @@ export default {
this.calcSearchResultHeight();
},
search: function() {
if( this.searchtimer !== null ) {
clearTimeout(this.searchtimer);
}
if (this.abortController) {
this.abortController.abort();
this.abortController = null;
}
if(this.searchoptions?.nolivesearch === true) return;
this.abort();
if( this.searchsettings.searchstr.length >= 2 ) {
this.calcSearchResultExtent();
this.searchtimer = setTimeout(
@@ -300,6 +317,16 @@ export default {
this.showresult = false;
}
},
abort() {
if (this.searchtimer !== null) {
clearTimeout(this.searchtimer);
}
if (this.abortController) {
this.abortController.abort();
this.abortController = null;
}
this.searchresult = [];
},
callsearchapi: function() {
this.error = null;
this.searchresult.splice(0, this.searchresult.length);
@@ -392,6 +419,8 @@ export default {
window.removeEventListener('resize', this.calcSearchResultExtent);
},
showsearchresult: function() {
if(this.searchoptions?.nolivesearch === true) return;
if( this.searchsettings.searchstr.length >= 2 ) {
this.showresult = true;
window.addEventListener('resize', this.calcSearchResultExtent);