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

33 lines
809 B
JavaScript

import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
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};
}
}
}
ngModule.vnComponent('vnZone', {
controller: Zone,
template: require('./index.html')
});