25 lines
654 B
JavaScript
25 lines
654 B
JavaScript
|
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')
|
||
|
});
|