2018-02-20 11:33:17 +00:00
|
|
|
import ngModule from '../module';
|
2020-11-23 12:41:51 +00:00
|
|
|
import Summary from 'salix/components/summary';
|
2018-07-24 10:53:26 +00:00
|
|
|
import './style.scss';
|
2018-02-20 11:33:17 +00:00
|
|
|
|
2020-11-23 12:41:51 +00:00
|
|
|
class Controller extends Summary {
|
2018-07-23 07:58:07 +00:00
|
|
|
getSummary() {
|
2019-10-24 22:53:53 +00:00
|
|
|
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
|
2018-07-23 07:58:07 +00:00
|
|
|
this.summary = response.data;
|
2018-02-20 11:33:17 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$onChanges() {
|
2019-01-31 13:14:39 +00:00
|
|
|
if (this.item && this.item.id)
|
2018-07-23 07:58:07 +00:00
|
|
|
this.getSummary();
|
2018-02-20 11:33:17 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-25 08:03:45 +00:00
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnItemSummary', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
2018-02-20 11:33:17 +00:00
|
|
|
bindings: {
|
2018-10-25 11:45:29 +00:00
|
|
|
item: '<',
|
|
|
|
},
|
2018-02-20 11:33:17 +00:00
|
|
|
});
|