fix(field-interface): nested filterable

This commit is contained in:
chenos 2024-03-18 09:56:28 +08:00
parent 84f080846c
commit 3b619682ee
2 changed files with 50 additions and 46 deletions

View File

@ -1,7 +1,7 @@
import { ISchema } from '@formily/react'; import { ISchema } from '@formily/react';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { defaultProps, operators, recordPickerViewer } from './properties';
import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface'; import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface';
import { defaultProps, recordPickerViewer } from './properties';
export class CreatedByFieldInterface extends CollectionFieldInterface { export class CreatedByFieldInterface extends CollectionFieldInterface {
name = 'createdBy'; name = 'createdBy';
@ -32,28 +32,30 @@ export class CreatedByFieldInterface extends CollectionFieldInterface {
...defaultProps, ...defaultProps,
}; };
filterable = { filterable = {
children: [ nested: true,
{ children: [],
name: 'id', // children: [
title: '{{t("ID")}}', // {
operators: operators.id, // name: 'id',
schema: { // title: '{{t("ID")}}',
title: '{{t("ID")}}', // operators: operators.id,
type: 'number', // schema: {
'x-component': 'InputNumber', // title: '{{t("ID")}}',
}, // type: 'number',
}, // 'x-component': 'InputNumber',
{ // },
name: 'nickname', // },
title: '{{t("Nickname")}}', // {
operators: operators.string, // name: 'nickname',
schema: { // title: '{{t("Nickname")}}',
title: '{{t("Nickname")}}', // operators: operators.string,
type: 'string', // schema: {
'x-component': 'Input', // title: '{{t("Nickname")}}',
}, // type: 'string',
}, // 'x-component': 'Input',
], // },
// },
// ],
}; };
schemaInitialize(schema: ISchema, { block }: { block: string }): void { schemaInitialize(schema: ISchema, { block }: { block: string }): void {

View File

@ -1,7 +1,7 @@
import { ISchema } from '@formily/react'; import { ISchema } from '@formily/react';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import { defaultProps, operators, recordPickerViewer } from './properties';
import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface'; import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface';
import { defaultProps, recordPickerViewer } from './properties';
export class UpdatedByFieldInterface extends CollectionFieldInterface { export class UpdatedByFieldInterface extends CollectionFieldInterface {
name = 'updatedBy'; name = 'updatedBy';
@ -32,28 +32,30 @@ export class UpdatedByFieldInterface extends CollectionFieldInterface {
...defaultProps, ...defaultProps,
}; };
filterable = { filterable = {
children: [ nested: true,
{ children: [],
name: 'id', // children: [
title: '{{t("ID")}}', // {
operators: operators.id, // name: 'id',
schema: { // title: '{{t("ID")}}',
title: '{{t("ID")}}', // operators: operators.id,
type: 'number', // schema: {
'x-component': 'InputNumber', // title: '{{t("ID")}}',
}, // type: 'number',
}, // 'x-component': 'InputNumber',
{ // },
name: 'nickname', // },
title: '{{t("Nickname")}}', // {
operators: operators.string, // name: 'nickname',
schema: { // title: '{{t("Nickname")}}',
title: '{{t("Nickname")}}', // operators: operators.string,
type: 'string', // schema: {
'x-component': 'Input', // title: '{{t("Nickname")}}',
}, // type: 'string',
}, // 'x-component': 'Input',
], // },
// },
// ],
}; };
schemaInitialize(schema: ISchema, { block }) { schemaInitialize(schema: ISchema, { block }) {
schema['properties'] = { schema['properties'] = {