mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:55:50 +00:00
refactor: adjust rich text filter to Input component (#4888)
* refactor: adjust rich text filter with Input component * refactor: adjust rich text filter with Input component
This commit is contained in:
parent
32b8bf6cdf
commit
84bc06d529
@ -183,3 +183,41 @@ export const collection = [
|
||||
{ label: '{{t("is empty")}}', value: '$empty', noValue: true },
|
||||
{ label: '{{t("is not empty")}}', value: '$notEmpty', noValue: true },
|
||||
];
|
||||
|
||||
export const richText = [
|
||||
{
|
||||
label: '{{t("contains")}}',
|
||||
value: '$includes',
|
||||
selected: true,
|
||||
schema: {
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '{{t("does not contain")}}',
|
||||
value: '$notIncludes',
|
||||
schema: {
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '{{t("is")}}',
|
||||
value: '$eq',
|
||||
schema: {
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '{{t("is not")}}',
|
||||
value: '$ne',
|
||||
schema: {
|
||||
type: 'string',
|
||||
'x-component': 'Input',
|
||||
},
|
||||
},
|
||||
{ label: '{{t("is empty")}}', value: '$empty', noValue: true },
|
||||
{ label: '{{t("is not empty")}}', value: '$notEmpty', noValue: true },
|
||||
];
|
||||
|
@ -79,6 +79,6 @@ export class RichTextFieldInterface extends CollectionFieldInterface {
|
||||
};
|
||||
};
|
||||
filterable = {
|
||||
operators: operators.string,
|
||||
operators: operators.richText,
|
||||
};
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import { useDataSourceManager } from '../data-source/data-source/DataSourceManag
|
||||
import { isAssocField } from '../filter-provider/utils';
|
||||
import { useActionContext, useCompile, useDesignable } from '../schema-component';
|
||||
import { useSchemaTemplateManager } from '../schema-templates';
|
||||
|
||||
export const itemsMerge = (items1) => {
|
||||
return items1;
|
||||
};
|
||||
@ -382,7 +383,9 @@ export const useFilterFormItemInitializerFields = (options?: any) => {
|
||||
'x-decorator': 'FormItem',
|
||||
'x-use-decorator-props': 'useFormItemProps',
|
||||
'x-collection-field': `${name}.${field.name}`,
|
||||
'x-component-props': {},
|
||||
'x-component-props': {
|
||||
component: interfaceConfig?.filterable?.operators?.[0]?.schema?.['x-component'],
|
||||
},
|
||||
};
|
||||
if (isAssocField(field)) {
|
||||
schema = {
|
||||
|
Loading…
Reference in New Issue
Block a user