mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- more prominent view of Active Custom Filter
- one click filterreset - fhc search bar: resetFilter with submit
This commit is contained in:
@@ -146,7 +146,8 @@ export default {
|
||||
sprachen: [],
|
||||
geschlechter: []
|
||||
},
|
||||
verbandEndpoint: ApiStvVerband
|
||||
verbandEndpoint: ApiStvVerband,
|
||||
filter: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -392,6 +393,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onSearch(e) {
|
||||
this.deleteCustomFilter();
|
||||
const searchsettings = { ...this.$refs.searchbar.searchsettings };
|
||||
if (searchsettings.searchstr.length >= 2) {
|
||||
this.blurSearchbar();
|
||||
@@ -420,6 +422,12 @@ export default {
|
||||
this.$refs.searchbar.$refs.input.blur();
|
||||
this.$refs.searchbar.abort();
|
||||
this.$refs.searchbar.hideresult();
|
||||
},
|
||||
handleCustomFilter(filter){
|
||||
this.filter = filter;
|
||||
},
|
||||
deleteCustomFilter(){
|
||||
this.$refs.stvList.resetFilter();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -625,7 +633,7 @@ export default {
|
||||
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
|
||||
<vertical-split>
|
||||
<template #top>
|
||||
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz"></stv-list>
|
||||
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz" @filterActive="handleCustomFilter"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details ref="details" :students="selected"></stv-details>
|
||||
|
||||
@@ -36,7 +36,8 @@ export default {
|
||||
studiensemesterKurzbz: String
|
||||
},
|
||||
emits: [
|
||||
'update:selected'
|
||||
'update:selected',
|
||||
'filterActive'
|
||||
],
|
||||
data() {
|
||||
function dateFormatter(cell)
|
||||
@@ -238,7 +239,7 @@ export default {
|
||||
let today = new Date().toLocaleDateString('en-GB')
|
||||
.replace(/\//g, '_');
|
||||
return "StudentList_" + today + ".csv";
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'$p.user_language.value'(n, o) {
|
||||
@@ -326,6 +327,8 @@ export default {
|
||||
},
|
||||
rowSelectionChanged(data, rows) {
|
||||
this.selectedcount = data.length;
|
||||
/* if (data.length > 0 )
|
||||
console.log("test manu" + this.selectedcount);*/
|
||||
this.lastSelected = this.selected;
|
||||
this.$emit('update:selected', data);
|
||||
|
||||
@@ -357,13 +360,14 @@ export default {
|
||||
},
|
||||
updateFilter(filter) {
|
||||
this.filter = filter;
|
||||
this.$emit('filterActive', filter);
|
||||
this.updateUrl();
|
||||
},
|
||||
updateUrl(endpoint, first) {
|
||||
this.lastSelected = first ? undefined : this.selected;
|
||||
|
||||
console.log('function param endpoint: ' + JSON.stringify(endpoint));
|
||||
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));
|
||||
/* console.log('function param endpoint: ' + JSON.stringify(endpoint));
|
||||
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));*/
|
||||
|
||||
if( endpoint === undefined && this.currentEndpoint === null)
|
||||
{
|
||||
@@ -394,6 +398,7 @@ export default {
|
||||
this.tabulatorOptions.ajaxURL = endpoint.url;
|
||||
this.tabulatorOptions.ajaxParams = { ...params };
|
||||
this.tabulatorOptions.ajaxConfig = {method};
|
||||
|
||||
if (!this.$refs.table.tableBuilt) {
|
||||
if (this.$refs.table.tabulator) {
|
||||
this.$refs.table.tabulator.on("tableBuilt", () => {
|
||||
@@ -471,6 +476,9 @@ export default {
|
||||
if (el != this.focusObj)
|
||||
this.changeFocus(this.focusObj, el);
|
||||
}
|
||||
},
|
||||
resetFilter(){
|
||||
this.$refs.listfilter.resetFilter();
|
||||
}
|
||||
},
|
||||
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
|
||||
@@ -486,6 +494,7 @@ export default {
|
||||
v-draggable:copyLink.capture="selectedDragObject"
|
||||
@dragend="dragCleanup"
|
||||
>
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:description="countsToHTML"
|
||||
@@ -499,11 +508,30 @@ export default {
|
||||
:new-btn-label="$p.t('stv/action_new')"
|
||||
@click:new="actionNewPrestudent"
|
||||
@table-built="translateTabulator"
|
||||
:useSelectionSpan="false"
|
||||
>
|
||||
|
||||
<template #actions v-if="filter.length">
|
||||
<div class="d-flex align-items-center gap-2 ps-4">
|
||||
<p class="text-danger mb-0">
|
||||
<strong>{{$p.t('filter','filterActive')}}</strong>
|
||||
</p>
|
||||
|
||||
<button
|
||||
class="btn btn-outline-danger sm"
|
||||
:title="$p.t('filter/filterDelete')"
|
||||
@click="resetFilter"
|
||||
>
|
||||
<span class="fa-solid fa-filter-circle-xmark"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<template #filter>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<list-filter @change="updateFilter" />
|
||||
<list-filter ref="listfilter" @change="updateFilter" :filterActive="filter.length" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -7,6 +7,9 @@ export default {
|
||||
components: {
|
||||
FilterItem
|
||||
},
|
||||
props: {
|
||||
filterActive: Boolean,
|
||||
},
|
||||
emits: [
|
||||
'change'
|
||||
],
|
||||
@@ -74,6 +77,9 @@ export default {
|
||||
},
|
||||
remove(index) {
|
||||
this.filters.splice(index, 1);
|
||||
},
|
||||
resetFilter(){
|
||||
this.filters = [];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -2240,6 +2240,46 @@ $phrases = array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'filter',
|
||||
'phrase' => 'filterDelete',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Filter zurücksetzen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'delete filter',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'filter',
|
||||
'phrase' => 'filterActive',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Filter aktiv',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'filter active',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
//**************************** CORE/person
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user