33 lines
770 B
JavaScript
33 lines
770 B
JavaScript
|
import ngModule from '../../module';
|
||
|
|
||
|
export default class Controller {
|
||
|
constructor($scope) {
|
||
|
this.$scope = $scope;
|
||
|
this.filter = {
|
||
|
include: [
|
||
|
{relation: 'agencyMode', fields: ['name']},
|
||
|
{relation: 'warehouse', fields: ['name']}
|
||
|
]
|
||
|
};
|
||
|
}
|
||
|
|
||
|
exprBuilder(param, value) {
|
||
|
switch (param) {
|
||
|
case 'search':
|
||
|
return /^\d+$/.test(value)
|
||
|
? {id: value}
|
||
|
: {name: {regexp: value}};
|
||
|
case 'warehouseFk':
|
||
|
case 'agencyModeFk':
|
||
|
return {[param]: value};
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Controller.$inject = ['$scope'];
|
||
|
|
||
|
ngModule.component('vnZoneIndex', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller
|
||
|
});
|