salix/modules/ticket/front/search-panel/index.js

43 lines
1.0 KiB
JavaScript
Raw Normal View History

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
import './style.scss';
class Controller extends SearchPanel {
constructor($, $element) {
super($, $element);
2021-01-08 13:32:48 +00:00
this.filter = this.$.filter;
this.getGroupedStates();
}
getGroupedStates() {
let groupedStates = [];
this.$http.get('AlertLevels').then(res => {
for (let state of res.data) {
groupedStates.push({
alertLevel: state.alertLevel,
code: state.code,
name: this.$t(state.code)
});
}
this.groupedStates = groupedStates;
});
}
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;
}
}
ngModule.vnComponent('vnTicketSearchPanel', {
template: require('./index.html'),
controller: Controller
});