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

41 lines
916 B
JavaScript
Raw Normal View History

import ngModule from '../module';
2020-11-23 12:41:51 +00:00
import Summary from 'salix/components/summary';
2020-11-23 12:41:51 +00:00
class Controller extends Summary {
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},
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;
});
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
get user() {
return this._user;
}
}
ngModule.component('vnUserSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
user: '<'
}
});