2020-03-09 08:00:03 +00:00
|
|
|
import ngModule from '../module';
|
2020-11-23 12:41:51 +00:00
|
|
|
import Summary from 'salix/components/summary';
|
2020-03-09 08:00:03 +00:00
|
|
|
|
2020-11-23 12:41:51 +00:00
|
|
|
class Controller extends Summary {
|
2020-03-09 08:00:03 +00:00
|
|
|
set user(value) {
|
|
|
|
this._user = value;
|
|
|
|
this.$.summary = null;
|
|
|
|
if (!value) return;
|
|
|
|
|
|
|
|
const filter = {
|
|
|
|
include: {
|
|
|
|
relation: 'role',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2023-01-23 14:24:00 +00:00
|
|
|
this.$http.get(`VnUsers/${value.id}`, {filter})
|
2020-03-09 08:00:03 +00:00
|
|
|
.then(res => this.$.summary = res.data);
|
|
|
|
}
|
2021-01-12 06:39:12 +00:00
|
|
|
get isHr() {
|
|
|
|
return this.aclService.hasAny(['hr']);
|
|
|
|
}
|
2020-03-09 08:00:03 +00:00
|
|
|
|
|
|
|
get user() {
|
|
|
|
return this._user;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.component('vnUserSummary', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
user: '<'
|
|
|
|
}
|
|
|
|
});
|