2018-06-07 21:47:19 +00:00
|
|
|
import ngModule from '../module';
|
2018-12-27 11:54:16 +00:00
|
|
|
import SearchPanel from 'core/components/searchbar/search-panel';
|
2021-01-08 13:32:48 +00:00
|
|
|
|
2020-11-12 12:33:33 +00:00
|
|
|
class Controller extends SearchPanel {
|
|
|
|
constructor($, $element) {
|
|
|
|
super($, $element);
|
2021-01-08 13:32:48 +00:00
|
|
|
this.filter = this.$.filter;
|
|
|
|
|
2020-11-12 12:33:33 +00:00
|
|
|
this.getGroupedStates();
|
|
|
|
}
|
|
|
|
|
|
|
|
getGroupedStates() {
|
|
|
|
let groupedStates = [];
|
|
|
|
this.$http.get('AlertLevels').then(res => {
|
|
|
|
for (let state of res.data) {
|
|
|
|
groupedStates.push({
|
2021-10-15 08:49:23 +00:00
|
|
|
id: state.id,
|
2020-11-12 12:33:33 +00:00
|
|
|
code: state.code,
|
|
|
|
name: this.$t(state.code)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
this.groupedStates = groupedStates;
|
|
|
|
});
|
|
|
|
}
|
2021-01-08 13:32:48 +00:00
|
|
|
|
2021-01-11 13:54:24 +00:00
|
|
|
get from() {
|
|
|
|
return this._from;
|
|
|
|
}
|
|
|
|
|
|
|
|
set from(value) {
|
|
|
|
this._from = value;
|
|
|
|
this.filter.scopeDays = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
get to() {
|
|
|
|
return this._to;
|
|
|
|
}
|
|
|
|
|
|
|
|
set to(value) {
|
|
|
|
this._to = value;
|
|
|
|
this.filter.scopeDays = null;
|
|
|
|
}
|
|
|
|
|
2021-01-08 13:32:48 +00:00
|
|
|
get scopeDays() {
|
|
|
|
return this._scopeDays;
|
|
|
|
}
|
|
|
|
|
|
|
|
set scopeDays(value) {
|
|
|
|
this._scopeDays = value;
|
|
|
|
|
|
|
|
this.filter.from = null;
|
|
|
|
this.filter.to = null;
|
|
|
|
}
|
2020-11-12 12:33:33 +00:00
|
|
|
}
|
2018-06-07 21:47:19 +00:00
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnTicketSearchPanel', {
|
2018-06-07 21:47:19 +00:00
|
|
|
template: require('./index.html'),
|
2020-11-12 12:33:33 +00:00
|
|
|
controller: Controller
|
2018-06-07 21:47:19 +00:00
|
|
|
});
|