2022-10-03 13:11:29 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import Section from 'salix/components/section';
|
|
|
|
|
2023-05-11 13:25:37 +00:00
|
|
|
export default class Controller extends Section {
|
|
|
|
set user(value) {
|
|
|
|
this._user = value;
|
|
|
|
this.$.summary = null;
|
|
|
|
if (!value) return;
|
|
|
|
|
|
|
|
const filter = {
|
|
|
|
where: {id: value.id},
|
|
|
|
include: {
|
|
|
|
relation: 'role',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
this.$http.get(`VnUsers/preview`, {filter})
|
|
|
|
.then(res => {
|
|
|
|
const [summary] = res.data;
|
|
|
|
this.$.summary = summary;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
get isHr() {
|
|
|
|
return this.aclService.hasAny(['hr']);
|
|
|
|
}
|
|
|
|
|
|
|
|
get user() {
|
|
|
|
return this._user;
|
|
|
|
}
|
|
|
|
}
|
2022-10-03 13:11:29 +00:00
|
|
|
|
|
|
|
ngModule.component('vnUserPrivileges', {
|
|
|
|
template: require('./index.html'),
|
2023-05-11 13:25:37 +00:00
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
user: '<'
|
|
|
|
}
|
2022-10-03 13:11:29 +00:00
|
|
|
});
|