salix/modules/worker/front/summary/index.js

36 lines
740 B
JavaScript

import ngModule from '../module';
import Summary from 'salix/components/summary';
class Controller extends Summary {
get worker() {
return this._worker;
}
set worker(value) {
this._worker = value;
this.$.worker = null;
if (!value) return;
const filter = {
where: {
id: value.id
}
};
this.$http.get(`Workers/summary`, {filter}).then(res => {
this.$.worker = res.data[0];
});
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
}
ngModule.vnComponent('vnWorkerSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
worker: '<'
}
});