salix/modules/worker/front/card/index.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-01-28 15:24:45 +00:00
import ngModule from '../module';
2019-11-10 10:08:44 +00:00
import ModuleCard from 'salix/components/module-card';
2019-01-28 15:24:45 +00:00
2019-11-10 10:08:44 +00:00
class Controller extends ModuleCard {
2019-01-28 15:24:45 +00:00
reload() {
2019-01-29 20:00:27 +00:00
let filter = {
include: [
{
relation: 'user',
2019-03-15 11:58:26 +00:00
scope: {
fields: ['name'],
include: {
relation: 'emailUser',
scope: {
fields: ['email']
}
}
}
2019-11-10 10:08:44 +00:00
}, {
2019-01-29 20:00:27 +00:00
relation: 'sip',
2019-03-08 08:41:53 +00:00
scope: {
fields: ['extension', 'secret']
}
2019-02-18 11:54:33 +00:00
}, {
relation: 'department',
scope: {
include: {
relation: 'department'
}
}
2019-01-29 20:00:27 +00:00
}
]
};
2019-11-10 10:08:44 +00:00
this.$http.get(`Workers/${this.$params.id}`, {filter})
.then(res => this.worker = res.data);
2019-01-28 15:24:45 +00:00
}
}
ngModule.component('vnWorkerCard', {
template: require('./index.html'),
controller: Controller
});