salix/modules/client/front/sample/index/index.js

54 lines
1.4 KiB
JavaScript

import ngModule from '../../module';
class Controller {
constructor($scope, $stateParams) {
this.$ = $scope;
this.$stateParams = $stateParams;
this.filter = {
include: [
{
relation: 'type',
scope: {
fields: ['code', 'description']
}
},
{
relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
},
{
relation: 'company',
scope: {
fields: ['code']
}
}
]
};
}
showWorkerDescriptor(event, workerFk) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopImmediatePropagation();
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
}
Controller.$inject = ['$scope', '$stateParams'];
ngModule.component('vnClientSampleIndex', {
template: require('./index.html'),
controller: Controller
});