Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hocgin committed Sep 21, 2024
1 parent 3d22193 commit 2b57607
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Promise/components/Schema/TableSchemaConfig/table-schema.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { useContext } from 'react';
import React, { useContext, useRef } from 'react';
import ProProvider from '@ant-design/pro-provider';
import ProTable from '@ant-design/pro-table';
import { SchemeColumns, handleSchemeColumns } from '../scheme';
import { ProTableProps } from '@ant-design/pro-table/lib/typing';
import { ActionType } from '@ant-design/pro-components';

interface TableSchemaProps extends ProTableProps<any, any, any> {}
interface TableSchemaProps extends ProTableProps<any, any, any> {
[key: string]: any;
}

// @formatter: off
const ArchiveSchema: React.FC<TableSchemaProps> = ({
Expand All @@ -13,6 +16,7 @@ const ArchiveSchema: React.FC<TableSchemaProps> = ({
children,
...rest
}) => {
const actionRef = useRef<ActionType>();
// @formatter: on
const values = useContext(ProProvider);
let value = {
Expand All @@ -26,11 +30,16 @@ const ArchiveSchema: React.FC<TableSchemaProps> = ({
return (
<ProProvider.Provider value={value}>
<ProTable
actionRef={actionRef}
rowKey={rowKey || 'id'}
search={search}
tableStyle={{ overflowX: 'auto' }}
columns={handleSchemeColumns(columns)}
{...rest}
tableAlertOptionRender={(...args) =>
// @ts-ignore
rest?.tableAlertOptionRender?.(...args, actionRef)
}
>
{children}
</ProTable>
Expand Down

0 comments on commit 2b57607

Please sign in to comment.