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

54 lines
1.4 KiB
JavaScript
Raw Normal View History

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