|
@@ -22,7 +22,10 @@
|
|
|
<v-row>
|
|
<v-row>
|
|
|
<!-- Map Column (hidden in 'list-view' mode)-->
|
|
<!-- Map Column (hidden in 'list-view' mode)-->
|
|
|
<v-col v-show="mapview" cols="6">
|
|
<v-col v-show="mapview" cols="6">
|
|
|
- <UiMapStructures :structures="structures" />
|
|
|
|
|
|
|
+ <UiMapStructures
|
|
|
|
|
+ :structures="filteredStructures"
|
|
|
|
|
+ @boundsUpdated="mapBoundsFilterChanged"
|
|
|
|
|
+ />
|
|
|
</v-col>
|
|
</v-col>
|
|
|
|
|
|
|
|
<!-- Results column -->
|
|
<!-- Results column -->
|
|
@@ -112,25 +115,23 @@
|
|
|
|
|
|
|
|
<!-- Results -->
|
|
<!-- Results -->
|
|
|
<v-data-iterator
|
|
<v-data-iterator
|
|
|
- :items="structures"
|
|
|
|
|
|
|
+ :items="filteredStructures"
|
|
|
:page.sync="page"
|
|
:page.sync="page"
|
|
|
:items-per-page="itemsPerPage"
|
|
:items-per-page="itemsPerPage"
|
|
|
sort-by="name"
|
|
sort-by="name"
|
|
|
hide-default-footer
|
|
hide-default-footer
|
|
|
- class="pt-4"
|
|
|
|
|
|
|
+ :no-data-text="$t('no_results')"
|
|
|
|
|
+ class="pt-4 mt-6"
|
|
|
>
|
|
>
|
|
|
- <!-- <span class="no-result" style="display: none">{{ $t("no_result") }}</span>-->
|
|
|
|
|
- <!-- <span class="error-message" style="display: none">{{ $t("an_error_occured") }}</span>-->
|
|
|
|
|
- <!-- <span class="results-count-message" style="display: none">-->
|
|
|
|
|
- <!-- <i class="count" /> <i>{{ $t("results") }}</i>-->
|
|
|
|
|
- <!-- </span>-->
|
|
|
|
|
|
|
+ <template #header>
|
|
|
|
|
+ <i class="results-count">{{ totalRecords }} {{ $t('results') }}</i>
|
|
|
|
|
+ </template>
|
|
|
|
|
|
|
|
<template #default="props">
|
|
<template #default="props">
|
|
|
- <v-row justify="space-between" class="my-3">
|
|
|
|
|
|
|
+ <v-row justify="space-between" class="mt-1 mb-3">
|
|
|
<v-col
|
|
<v-col
|
|
|
v-for="structure in props.items"
|
|
v-for="structure in props.items"
|
|
|
:key="structure.name"
|
|
:key="structure.name"
|
|
|
- v-if="matchFilters(structure)"
|
|
|
|
|
cols="12"
|
|
cols="12"
|
|
|
sm="12"
|
|
sm="12"
|
|
|
:md="mapview ? 6 : 12"
|
|
:md="mapview ? 6 : 12"
|
|
@@ -1804,12 +1805,16 @@ export default {
|
|
|
typeFilter: null,
|
|
typeFilter: null,
|
|
|
departmentFilter: null,
|
|
departmentFilter: null,
|
|
|
federationFilter: null,
|
|
federationFilter: null,
|
|
|
- distanceFilter: null
|
|
|
|
|
|
|
+ distanceFilter: null,
|
|
|
|
|
+ mapBoundsFilter: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ filteredStructures () {
|
|
|
|
|
+ return this.structures.filter((s) => { return this.matchFilters(s) })
|
|
|
|
|
+ },
|
|
|
totalRecords () {
|
|
totalRecords () {
|
|
|
- return this.structures.length
|
|
|
|
|
|
|
+ return this.filteredStructures.length
|
|
|
},
|
|
},
|
|
|
pageCount () {
|
|
pageCount () {
|
|
|
return Math.floor(this.totalRecords / this.itemsPerPage) + 1
|
|
return Math.floor(this.totalRecords / this.itemsPerPage) + 1
|
|
@@ -1840,6 +1845,9 @@ export default {
|
|
|
distanceFilterChanged (newVal) {
|
|
distanceFilterChanged (newVal) {
|
|
|
this.distanceFilter = newVal
|
|
this.distanceFilter = newVal
|
|
|
},
|
|
},
|
|
|
|
|
+ mapBoundsFilterChanged (newBounds) {
|
|
|
|
|
+ this.mapBoundsFilter = newBounds
|
|
|
|
|
+ },
|
|
|
reinitializeFilters () {
|
|
reinitializeFilters () {
|
|
|
this.textFilter = null
|
|
this.textFilter = null
|
|
|
this.locationFilter = null
|
|
this.locationFilter = null
|
|
@@ -1847,6 +1855,7 @@ export default {
|
|
|
this.departmentFilter = null
|
|
this.departmentFilter = null
|
|
|
this.federationFilter = null
|
|
this.federationFilter = null
|
|
|
this.distanceFilter = null
|
|
this.distanceFilter = null
|
|
|
|
|
+ this.mapBoundsFilter = null
|
|
|
},
|
|
},
|
|
|
matchFilters (structure) {
|
|
matchFilters (structure) {
|
|
|
// Filter by name
|
|
// Filter by name
|
|
@@ -1886,19 +1895,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// filter by map bounds
|
|
// filter by map bounds
|
|
|
- // if (area !== null) {
|
|
|
|
|
- // if (structure.longitude < area[0] ||
|
|
|
|
|
- // structure.latitude < area[1] ||
|
|
|
|
|
- // structure.longitude > area[2] ||
|
|
|
|
|
- // structure.latitude > area[3]
|
|
|
|
|
- // ) {
|
|
|
|
|
- // if (structure.id == 498) {
|
|
|
|
|
- // console.log(structure.longitude, structure.latitude, area);
|
|
|
|
|
- // console.log(structure.longitude < area[0], structure.latitude < area[1], structure.longitude > area[2], structure.latitude > area[3])
|
|
|
|
|
- // }
|
|
|
|
|
- // return false;
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (this.mapBoundsFilter !== null) {
|
|
|
|
|
+ if (structure.longitude < this.mapBoundsFilter.getSouthWest().lng ||
|
|
|
|
|
+ structure.latitude < this.mapBoundsFilter.getSouthWest().lat ||
|
|
|
|
|
+ structure.longitude > this.mapBoundsFilter.getNorthEast().lng ||
|
|
|
|
|
+ structure.latitude > this.mapBoundsFilter.getNorthEast().lat
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1931,4 +1936,9 @@ export default {
|
|
|
.icon {
|
|
.icon {
|
|
|
color: $theme;
|
|
color: $theme;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .results-count {
|
|
|
|
|
+ font-size: .8em;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|