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

34 lines
703 B
JavaScript
Raw Normal View History

2020-02-04 08:34:31 +00:00
import ngModule from '../module';
import './style.scss';
2020-11-23 12:41:51 +00:00
import Summary from 'salix/components/summary';
2020-02-04 08:34:31 +00:00
2020-11-23 12:41:51 +00:00
class Controller extends Summary {
2020-02-04 08:34:31 +00:00
get entry() {
2022-05-09 12:44:30 +00:00
if (!this._entry)
return this.$params;
2020-02-04 08:34:31 +00:00
return this._entry;
}
set entry(value) {
this._entry = value;
if (value && value.id)
2020-02-25 09:39:21 +00:00
this.getEntryData();
2020-02-04 08:34:31 +00:00
}
2020-02-25 09:39:21 +00:00
getEntryData() {
2020-09-09 09:39:18 +00:00
return this.$http.get(`Entries/${this.entry.id}/getEntry`).then(response => {
2020-02-21 11:48:34 +00:00
this.entryData = response.data;
});
}
2020-02-04 08:34:31 +00:00
}
ngModule.vnComponent('vnEntrySummary', {
2020-02-04 08:34:31 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
entry: '<'
}
});