38 lines
808 B
JavaScript
38 lines
808 B
JavaScript
import ngModule from '../module';
|
|
|
|
export default class Controller {
|
|
constructor($, $state) {
|
|
this.$state = $state;
|
|
Object.assign(this, {
|
|
$,
|
|
selectedWorker: null,
|
|
});
|
|
}
|
|
|
|
onSearch(params) {
|
|
if (params)
|
|
this.$.model.applyFilter(null, params);
|
|
else
|
|
this.$.model.clear();
|
|
}
|
|
|
|
preview(event, worker) {
|
|
if (event.defaultPrevented) return;
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
|
|
this.selectedWorker = worker;
|
|
this.$.preview.show();
|
|
}
|
|
|
|
onMoreChange(callback) {
|
|
callback.call(this);
|
|
}
|
|
}
|
|
Controller.$inject = ['$scope', '$state'];
|
|
|
|
ngModule.component('vnWorkerIndex', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|