2019-11-10 10:08:44 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import ModuleMain from 'salix/components/module-main';
|
|
|
|
|
2020-03-13 19:33:12 +00:00
|
|
|
export default class Ticket extends ModuleMain {
|
2020-08-20 06:45:03 +00:00
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
2021-09-21 13:49:59 +00:00
|
|
|
this.filterParams = this.fetchParams({
|
2020-08-20 06:45:03 +00:00
|
|
|
scopeDays: 1
|
2021-09-21 13:49:59 +00:00
|
|
|
});
|
2020-08-20 06:45:03 +00:00
|
|
|
}
|
2020-03-13 19:33:12 +00:00
|
|
|
|
2020-08-20 06:45:03 +00:00
|
|
|
fetchParams($params) {
|
2020-08-20 07:50:22 +00:00
|
|
|
if (!Object.entries($params).length)
|
|
|
|
$params.scopeDays = 1;
|
|
|
|
|
2020-03-13 19:33:12 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
|
|
|
|
ngModule.vnComponent('vnTicket', {
|
|
|
|
controller: Ticket,
|
|
|
|
template: require('./index.html')
|
|
|
|
});
|