feat: services quick search.

This commit is contained in:
a.bouhuolia
2021-08-07 20:37:11 +02:00
parent fad9052da8
commit 1b90610cec
39 changed files with 380 additions and 204 deletions

View File

@@ -5,10 +5,12 @@ import ItemSettings from './Item.Settings';
import ModelSetting from './ModelSetting';
import CustomViewBaseModel from './CustomViewBaseModel';
import { DEFAULT_VIEWS } from 'services/Items/constants';
import ModelSearchable from './ModelSearchable';
export default class Item extends mixin(TenantModel, [
ModelSetting,
CustomViewBaseModel,
ModelSearchable,
]) {
/**
* Table name
@@ -128,4 +130,14 @@ export default class Item extends mixin(TenantModel, [
static get defaultViews() {
return DEFAULT_VIEWS;
}
/**
* Model search roles.
*/
static get searchRoles() {
return [
{ fieldKey: 'name', comparator: 'contains' },
{ condition: 'or', fieldKey: 'code', comparator: 'like' },
];
}
}