feat: support unused number

This commit is contained in:
sealday 2024-03-20 18:57:38 +08:00
parent 23e387caf2
commit 70d8b2cfef
2 changed files with 5 additions and 2 deletions

View File

@ -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 <div>使</div>;
const { data } = useRequest<any>({ resource: 'records', action: 'unused' });
return <div>{data?.data?.map((number) => <Tag key={number}>{number}</Tag>)}</div>;
};
UnusedRecordsBlock.displayName = 'UnusedRecordsBlock';

View File

@ -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<CollectionRepository>('collections');
const record = await repo.findOne({ filter: { name: 'records' }, appends: ['fields'] });