2019-03-21 12:46:14 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
export default class Controller {
|
2019-11-10 10:08:44 +00:00
|
|
|
constructor($scope, vnToken) {
|
2019-03-21 12:46:14 +00:00
|
|
|
this.$ = $scope;
|
2019-11-10 10:08:44 +00:00
|
|
|
this.accessToken = vnToken.token;
|
2019-03-21 12:46:14 +00:00
|
|
|
}
|
|
|
|
|
2019-04-25 06:28:08 +00:00
|
|
|
showWorkerDescriptor(event, workerFk) {
|
2019-03-21 12:46:14 +00:00
|
|
|
if (event.defaultPrevented) return;
|
|
|
|
event.preventDefault();
|
2019-11-10 10:08:44 +00:00
|
|
|
event.stopPropagation();
|
2019-03-21 12:46:14 +00:00
|
|
|
|
2019-04-25 06:28:08 +00:00
|
|
|
this.selectedWorker = workerFk;
|
2019-03-21 12:46:14 +00:00
|
|
|
this.$.workerDescriptor.parent = event.target;
|
|
|
|
this.$.workerDescriptor.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
preview(event, route) {
|
2019-11-10 10:08:44 +00:00
|
|
|
if (event.defaultPrevented) return;
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
|
2019-03-21 12:46:14 +00:00
|
|
|
this.routeSelected = route;
|
2019-03-22 10:10:23 +00:00
|
|
|
this.$.summary.show();
|
2019-03-21 12:46:14 +00:00
|
|
|
}
|
2019-04-25 06:28:08 +00:00
|
|
|
|
|
|
|
onSearch(params) {
|
|
|
|
if (params)
|
|
|
|
this.$.model.applyFilter(null, params);
|
|
|
|
else
|
|
|
|
this.$.model.clear();
|
|
|
|
}
|
2019-03-21 12:46:14 +00:00
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
Controller.$inject = ['$scope', 'vnToken'];
|
2019-03-21 12:46:14 +00:00
|
|
|
|
|
|
|
ngModule.component('vnRouteIndex', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|