mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 05:48:11 +00:00
Wskaźnik aktywnych filtrów dziennika DR
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
@on-options-reset="resetOptions"
|
@on-options-reset="resetOptions"
|
||||||
:sorter-option-ids="['timestampFrom', 'duration']"
|
:sorter-option-ids="['timestampFrom', 'duration']"
|
||||||
:data-status="dataStatus"
|
:data-status="dataStatus"
|
||||||
|
:current-options-active="currentOptionsActive"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="list_wrapper" @scroll="handleScroll">
|
<div class="list_wrapper" @scroll="handleScroll">
|
||||||
@@ -71,7 +72,15 @@ import JournalHeader from '../components/JournalView/JournalHeader.vue';
|
|||||||
const DISPATCHERS_API_URL = `${URLs.stacjownikAPI}/api/getDispatchers`;
|
const DISPATCHERS_API_URL = `${URLs.stacjownikAPI}/api/getDispatchers`;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { SearchBox, ActionButton, JournalOptions, DispatcherStats, Loading, JournalDispatchersList, JournalHeader },
|
components: {
|
||||||
|
SearchBox,
|
||||||
|
ActionButton,
|
||||||
|
JournalOptions,
|
||||||
|
DispatcherStats,
|
||||||
|
Loading,
|
||||||
|
JournalDispatchersList,
|
||||||
|
JournalHeader,
|
||||||
|
},
|
||||||
name: 'JournalDispatchers',
|
name: 'JournalDispatchers',
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -88,11 +97,14 @@ export default defineComponent({
|
|||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
currentQuery: '',
|
currentQuery: '',
|
||||||
|
currentQueryArray: [] as string[],
|
||||||
|
|
||||||
scrollDataLoaded: true,
|
scrollDataLoaded: true,
|
||||||
scrollNoMoreData: false,
|
scrollNoMoreData: false,
|
||||||
|
|
||||||
showReturnButton: false,
|
showReturnButton: false,
|
||||||
statsCardOpen: false,
|
statsCardOpen: false,
|
||||||
|
currentOptionsActive: false,
|
||||||
|
|
||||||
dataStatus: DataStatus.Initialized,
|
dataStatus: DataStatus.Initialized,
|
||||||
DataStatus,
|
DataStatus,
|
||||||
@@ -133,6 +145,13 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
currentQueryArray(q: string[]) {
|
||||||
|
this.currentOptionsActive =
|
||||||
|
q.length > 2 || q.some((qv) => qv.startsWith('sortBy=') && qv.split('=')[1] != 'timestampFrom');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
computedHistoryList() {
|
computedHistoryList() {
|
||||||
return this.historyList.filter(
|
return this.historyList.filter(
|
||||||
@@ -169,6 +188,7 @@ export default defineComponent({
|
|||||||
resetOptions() {
|
resetOptions() {
|
||||||
this.searchersValues['search-station'] = '';
|
this.searchersValues['search-station'] = '';
|
||||||
this.searchersValues['search-dispatcher'] = '';
|
this.searchersValues['search-dispatcher'] = '';
|
||||||
|
this.searchersValues['search-date'] = '';
|
||||||
this.sorterActive.id = 'timestampFrom';
|
this.sorterActive.id = 'timestampFrom';
|
||||||
|
|
||||||
this.searchHistory();
|
this.searchHistory();
|
||||||
@@ -231,6 +251,7 @@ export default defineComponent({
|
|||||||
queries.push('countLimit=30');
|
queries.push('countLimit=30');
|
||||||
|
|
||||||
this.currentQuery = queries.join('&');
|
this.currentQuery = queries.join('&');
|
||||||
|
this.currentQueryArray = queries;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const responseData: DispatcherHistory[] = await (
|
const responseData: DispatcherHistory[] = await (
|
||||||
@@ -265,3 +286,4 @@ export default defineComponent({
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '../styles/JournalSection.scss';
|
@import '../styles/JournalSection.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user