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 = {
|
2023-04-27 13:06:05 +00:00
|
|
|
where: {id: value.id},
|
2020-03-09 08:00:03 +00:00
|
|
|
include: {
|
|
|
|
relation: 'role',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2023-04-27 13:06:05 +00:00
|
|
|
this.$http.get(`VnUsers/preview`, {filter})
|
|
|
|
.then(res => {
|
|
|
|
const [summary] = res.data;
|
|
|
|
this.$.summary = summary;
|
|
|
|
});
|
2020-03-09 08:00:03 +00:00
|
|
|
}
|
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: '<'
|
|
|
|
}
|
|
|
|
});
|