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

33 lines
809 B
JavaScript
Raw Normal View History

2019-09-25 18:06:42 +00:00
import ngModule from '../module';
2019-11-10 10:08:44 +00:00
import ModuleMain from 'salix/components/module-main';
2019-09-25 18:06:42 +00:00
2020-03-07 12:52:02 +00:00
export default class Zone extends ModuleMain {
constructor($element, $) {
super($element, $);
this.filter = {
include: {
relation: 'agencyMode',
scope: {fields: ['name']}
}
};
}
exprBuilder(param, value) {
switch (param) {
case 'search':
return /^\d+$/.test(value)
? {id: value}
: {name: {like: `%${value}%`}};
case 'name':
return {[param]: {like: `%${value}%`}};
case 'agencyModeFk':
return {[param]: value};
}
}
}
2019-11-10 10:08:44 +00:00
ngModule.vnComponent('vnZone', {
controller: Zone,
2019-09-25 18:06:42 +00:00
template: require('./index.html')
});