44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
import ngModule from '../module';
|
|
import ModuleCard from 'salix/components/module-card';
|
|
|
|
class Controller extends ModuleCard {
|
|
reload() {
|
|
let filter = {
|
|
include: [
|
|
{
|
|
relation: 'user',
|
|
scope: {
|
|
fields: ['name'],
|
|
include: {
|
|
relation: 'emailUser',
|
|
scope: {
|
|
fields: ['email']
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
relation: 'sip',
|
|
scope: {
|
|
fields: ['extension', 'secret']
|
|
}
|
|
}, {
|
|
relation: 'department',
|
|
scope: {
|
|
include: {
|
|
relation: 'department'
|
|
}
|
|
}
|
|
}
|
|
]
|
|
};
|
|
|
|
this.$http.get(`Workers/${this.$params.id}`, {filter})
|
|
.then(res => this.worker = res.data);
|
|
}
|
|
}
|
|
|
|
ngModule.vnComponent('vnWorkerCard', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|