salix/modules/item/front/waste/index/index.js

36 lines
914 B
JavaScript
Raw Normal View History

2021-03-30 08:28:44 +00:00
import ngModule from '../../module';
2020-03-17 13:43:46 +00:00
import Section from 'salix/components/section';
2020-01-15 12:07:33 +00:00
import './style.scss';
export default class Controller extends Section {
constructor($element, $) {
super($element, $);
this.getWasteConfig();
}
getWasteConfig() {
return this.wasteConfig = JSON.parse(localStorage.getItem('wasteConfig')) || {};
}
setWasteConfig() {
localStorage.setItem('wasteConfig', JSON.stringify(this.wasteConfig));
}
toggleHidePanel(detail) {
if (!this.wasteConfig[detail.buyer]) {
this.wasteConfig[detail.buyer] = {
hidden: true
};
} else
this.wasteConfig[detail.buyer].hidden = !this.wasteConfig[detail.buyer].hidden;
this.setWasteConfig();
}
}
2021-03-30 08:28:44 +00:00
ngModule.vnComponent('vnItemWasteIndex', {
2020-01-15 12:07:33 +00:00
template: require('./index.html'),
controller: Controller
2020-01-15 12:07:33 +00:00
});