feat: support unused number
This commit is contained in:
parent
23e387caf2
commit
70d8b2cfef
@ -4,11 +4,13 @@ import {
|
|||||||
SchemaInitializerItem,
|
SchemaInitializerItem,
|
||||||
SchemaSettings,
|
SchemaSettings,
|
||||||
SchemaToolbar,
|
SchemaToolbar,
|
||||||
|
useRequest,
|
||||||
useSchemaInitializer,
|
useSchemaInitializer,
|
||||||
useSchemaInitializerItem,
|
useSchemaInitializerItem,
|
||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
import { useFieldSchema } from '@formily/react';
|
import { useFieldSchema } from '@formily/react';
|
||||||
import { ToolOutlined } from '@ant-design/icons';
|
import { ToolOutlined } from '@ant-design/icons';
|
||||||
|
import { Tag } from 'antd';
|
||||||
|
|
||||||
export class UnusedRecordsBlockHelper {
|
export class UnusedRecordsBlockHelper {
|
||||||
constructor(private app: Application) {}
|
constructor(private app: Application) {}
|
||||||
@ -28,7 +30,8 @@ export class UnusedRecordsBlockHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const UnusedRecordsBlock: React.FC = () => {
|
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';
|
UnusedRecordsBlock.displayName = 'UnusedRecordsBlock';
|
||||||
|
@ -197,7 +197,7 @@ export class RecordPreviewController {
|
|||||||
ctx.body = await this.recordPdfService.transformPdfV2(record, leaseData, feeData, { isDouble: double, printSetup });
|
ctx.body = await this.recordPdfService.transformPdfV2(record, leaseData, feeData, { isDouble: double, printSetup });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Action('unused_records')
|
@Action('unused')
|
||||||
async unusedRecords(ctx: Context) {
|
async unusedRecords(ctx: Context) {
|
||||||
const repo = ctx.db.getRepository<CollectionRepository>('collections');
|
const repo = ctx.db.getRepository<CollectionRepository>('collections');
|
||||||
const record = await repo.findOne({ filter: { name: 'records' }, appends: ['fields'] });
|
const record = await repo.findOne({ filter: { name: 'records' }, appends: ['fields'] });
|
||||||
|
Loading…
Reference in New Issue
Block a user