2018-02-20 11:33:17 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 13:43:46 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-07-24 10:53:26 +00:00
|
|
|
import './style.scss';
|
2018-02-20 11:33:17 +00:00
|
|
|
|
2020-03-17 13:43:46 +00:00
|
|
|
class Controller extends Section {
|
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
|
|
|
|
2018-02-20 11:33:17 +00:00
|
|
|
ngModule.component('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
|
|
|
});
|