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

37 lines
810 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 = {
include: {
relation: 'role',
scope: {
fields: ['id', 'name']
}
}
};
this.$http.get(`Accounts/${value.id}`, {filter})
.then(res => this.$.summary = res.data);
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
get user() {
return this._user;
}
}
ngModule.component('vnUserSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
user: '<'
}
});