From 3b619682ee91426a1f091d2043a3aa876446bacc Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 18 Mar 2024 09:56:28 +0800 Subject: [PATCH] fix(field-interface): nested filterable --- .../interfaces/createdBy.ts | 48 ++++++++++--------- .../interfaces/updatedBy.ts | 48 ++++++++++--------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/packages/core/client/src/collection-manager/interfaces/createdBy.ts b/packages/core/client/src/collection-manager/interfaces/createdBy.ts index dd14ae2de..0f564ef67 100644 --- a/packages/core/client/src/collection-manager/interfaces/createdBy.ts +++ b/packages/core/client/src/collection-manager/interfaces/createdBy.ts @@ -1,7 +1,7 @@ import { ISchema } from '@formily/react'; import { cloneDeep } from 'lodash'; -import { defaultProps, operators, recordPickerViewer } from './properties'; import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface'; +import { defaultProps, recordPickerViewer } from './properties'; export class CreatedByFieldInterface extends CollectionFieldInterface { name = 'createdBy'; @@ -32,28 +32,30 @@ export class CreatedByFieldInterface extends CollectionFieldInterface { ...defaultProps, }; filterable = { - children: [ - { - name: 'id', - title: '{{t("ID")}}', - operators: operators.id, - schema: { - title: '{{t("ID")}}', - type: 'number', - 'x-component': 'InputNumber', - }, - }, - { - name: 'nickname', - title: '{{t("Nickname")}}', - operators: operators.string, - schema: { - title: '{{t("Nickname")}}', - type: 'string', - 'x-component': 'Input', - }, - }, - ], + nested: true, + children: [], + // children: [ + // { + // name: 'id', + // title: '{{t("ID")}}', + // operators: operators.id, + // schema: { + // title: '{{t("ID")}}', + // type: 'number', + // 'x-component': 'InputNumber', + // }, + // }, + // { + // name: 'nickname', + // title: '{{t("Nickname")}}', + // operators: operators.string, + // schema: { + // title: '{{t("Nickname")}}', + // type: 'string', + // 'x-component': 'Input', + // }, + // }, + // ], }; schemaInitialize(schema: ISchema, { block }: { block: string }): void { diff --git a/packages/core/client/src/collection-manager/interfaces/updatedBy.ts b/packages/core/client/src/collection-manager/interfaces/updatedBy.ts index 2b9072478..d19546192 100644 --- a/packages/core/client/src/collection-manager/interfaces/updatedBy.ts +++ b/packages/core/client/src/collection-manager/interfaces/updatedBy.ts @@ -1,7 +1,7 @@ import { ISchema } from '@formily/react'; import { cloneDeep } from 'lodash'; -import { defaultProps, operators, recordPickerViewer } from './properties'; import { CollectionFieldInterface } from '../../data-source/collection-field-interface/CollectionFieldInterface'; +import { defaultProps, recordPickerViewer } from './properties'; export class UpdatedByFieldInterface extends CollectionFieldInterface { name = 'updatedBy'; @@ -32,28 +32,30 @@ export class UpdatedByFieldInterface extends CollectionFieldInterface { ...defaultProps, }; filterable = { - children: [ - { - name: 'id', - title: '{{t("ID")}}', - operators: operators.id, - schema: { - title: '{{t("ID")}}', - type: 'number', - 'x-component': 'InputNumber', - }, - }, - { - name: 'nickname', - title: '{{t("Nickname")}}', - operators: operators.string, - schema: { - title: '{{t("Nickname")}}', - type: 'string', - 'x-component': 'Input', - }, - }, - ], + nested: true, + children: [], + // children: [ + // { + // name: 'id', + // title: '{{t("ID")}}', + // operators: operators.id, + // schema: { + // title: '{{t("ID")}}', + // type: 'number', + // 'x-component': 'InputNumber', + // }, + // }, + // { + // name: 'nickname', + // title: '{{t("Nickname")}}', + // operators: operators.string, + // schema: { + // title: '{{t("Nickname")}}', + // type: 'string', + // 'x-component': 'Input', + // }, + // }, + // ], }; schemaInitialize(schema: ISchema, { block }) { schema['properties'] = {