33 lines
751 B
JavaScript
33 lines
751 B
JavaScript
import ngModule from '../module';
|
|
import ModuleMain from 'salix/components/module-main';
|
|
|
|
export default class Ticket extends ModuleMain {
|
|
constructor() {
|
|
super();
|
|
|
|
this.defaultFilter = {
|
|
scopeDays: 1
|
|
};
|
|
}
|
|
|
|
fetchParams($params) {
|
|
if (typeof $params.scopeDays === 'number') {
|
|
const from = new Date();
|
|
from.setHours(0, 0, 0, 0);
|
|
|
|
const to = new Date(from.getTime());
|
|
to.setDate(to.getDate() + $params.scopeDays);
|
|
to.setHours(23, 59, 59, 999);
|
|
|
|
Object.assign($params, {from, to});
|
|
}
|
|
|
|
return $params;
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnTicket', {
|
|
controller: Ticket,
|
|
template: require('./index.html')
|
|
});
|