32 lines
713 B
JavaScript
32 lines
713 B
JavaScript
|
import ngModule from '../module';
|
||
|
import Section from 'salix/components/section';
|
||
|
|
||
|
export default class Controller extends Section {
|
||
|
constructor($element, $) {
|
||
|
super($element, $);
|
||
|
this.showFields = {
|
||
|
id: false,
|
||
|
actions: false
|
||
|
};
|
||
|
}
|
||
|
get checked() {
|
||
|
const buys = this.$.model.data || [];
|
||
|
const checkedBuys = [];
|
||
|
for (let buy of buys) {
|
||
|
if (buy.checked)
|
||
|
checkedBuys.push(buy);
|
||
|
}
|
||
|
|
||
|
return checkedBuys;
|
||
|
}
|
||
|
|
||
|
get totalChecked() {
|
||
|
return this.checked.length;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ngModule.component('vnEntryLatestBuys', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller
|
||
|
});
|