diff --git a/packages/plugins/@hera/plugin-rental/src/client/schema-initializer/blocks/UnusedRecordsBlockInitializer.tsx b/packages/plugins/@hera/plugin-rental/src/client/schema-initializer/blocks/UnusedRecordsBlockInitializer.tsx index c33a8e502..17609a950 100644 --- a/packages/plugins/@hera/plugin-rental/src/client/schema-initializer/blocks/UnusedRecordsBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-rental/src/client/schema-initializer/blocks/UnusedRecordsBlockInitializer.tsx @@ -4,11 +4,13 @@ import { SchemaInitializerItem, SchemaSettings, SchemaToolbar, + useRequest, useSchemaInitializer, useSchemaInitializerItem, } from '@nocobase/client'; import { useFieldSchema } from '@formily/react'; import { ToolOutlined } from '@ant-design/icons'; +import { Tag } from 'antd'; export class UnusedRecordsBlockHelper { constructor(private app: Application) {} @@ -28,7 +30,8 @@ export class UnusedRecordsBlockHelper { } export const UnusedRecordsBlock: React.FC = () => { - return
没使用的单号
; + const { data } = useRequest({ resource: 'records', action: 'unused' }); + return
{data?.data?.map((number) => {number})}
; }; UnusedRecordsBlock.displayName = 'UnusedRecordsBlock'; diff --git a/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts b/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts index 68f936039..3410850b4 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/actions/records-controller.ts @@ -197,7 +197,7 @@ export class RecordPreviewController { ctx.body = await this.recordPdfService.transformPdfV2(record, leaseData, feeData, { isDouble: double, printSetup }); } - @Action('unused_records') + @Action('unused') async unusedRecords(ctx: Context) { const repo = ctx.db.getRepository('collections'); const record = await repo.findOne({ filter: { name: 'records' }, appends: ['fields'] });