Fixed problems with default search

This commit is contained in:
Jorge Padawan 2021-02-02 10:26:10 +01:00
parent 3f963f2d99
commit 7b7571ae77
2 changed files with 11 additions and 6 deletions

View File

@ -10,7 +10,7 @@
panel="vn-route-search-panel"
info="Search routes by id"
fetch-params="$ctrl.fetchParams($params)"
suggested-filter="$ctrl.filterParams"
filter="$ctrl.filterParams"
model="model">
</vn-searchbar>
</vn-portal>

View File

@ -2,12 +2,17 @@ import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
export default class Route extends ModuleMain {
constructor() {
super();
$postLink() {
const to = new Date();
to.setDate(to.getDate() + 1);
to.setHours(0, 0, 0, 0);
this.filterParams = {
scopeDays: 1
};
const from = new Date();
from.setDate(from.getDate());
from.setHours(0, 0, 0, 0);
this.filterParams = {from, to};
this.$.model.applyFilter(null, this.filterParams);
}
fetchParams($params) {