salix/modules/account/front/role/main/index.js

25 lines
654 B
JavaScript
Raw Normal View History

import ngModule from '../../module';
import ModuleMain from 'salix/components/module-main';
export default class Role extends ModuleMain {
exprBuilder(param, value) {
switch (param) {
case 'search':
return /^\d+$/.test(value)
? {id: value}
: {or: [
{name: {like: `%${value}%`}},
{nickname: {like: `%${value}%`}}
]};
case 'name':
case 'description':
return {[param]: {like: `%${value}%`}};
}
}
}
ngModule.vnComponent('vnRole', {
controller: Role,
template: require('./index.html')
});