salix/modules/zone/front/index/index.js

28 lines
674 B
JavaScript
Raw Normal View History

2018-12-04 12:18:27 +00:00
import ngModule from '../module';
2020-03-16 17:54:22 +00:00
import Section from 'salix/components/section';
2018-09-19 13:05:07 +00:00
2020-03-16 17:54:22 +00:00
export default class Controller extends Section {
2020-03-07 12:52:02 +00:00
preview(event, zone) {
2019-03-14 14:07:24 +00:00
this.stopEvent(event);
this.selectedZone = zone;
2020-03-07 12:52:02 +00:00
this.$.summary.show();
2019-03-14 14:07:24 +00:00
}
2020-03-07 12:52:02 +00:00
clone(event, zone) {
2019-03-14 14:07:24 +00:00
this.stopEvent(event);
2020-03-16 17:54:22 +00:00
this.$.clone.show(zone);
2020-03-07 12:52:02 +00:00
}
2020-03-16 17:54:22 +00:00
onCloneAccept(zone) {
return this.$http.post(`Zones/${zone.id}/clone`)
2020-03-07 12:52:02 +00:00
.then(res => {
this.$state.go('zone.card.basicData', {id: res.data.id});
});
2019-03-14 14:07:24 +00:00
}
2018-09-19 13:05:07 +00:00
}
ngModule.component('vnZoneIndex', {
template: require('./index.html'),
controller: Controller
});