|
@@ -1,17 +1,14 @@
|
|
|
-import {Card, Table} from 'antd';
|
|
|
+import {Card} from 'antd';
|
|
|
import {FC} from 'react';
|
|
|
import {useHandle, useList} from './hooks';
|
|
|
-import {usePage} from '@hooks';
|
|
|
-import {pageContext} from '../context';
|
|
|
-import {PAGE_SIZE_LIST} from '@utils';
|
|
|
+import {pageContext, searchContext} from '../context';
|
|
|
import RoleModal from './modal';
|
|
|
import TreeModal from './tree-modal';
|
|
|
-import {TableTools} from '@components';
|
|
|
+import {Table, TableTools} from '@components';
|
|
|
import PdaMenuModal from './pda-modal';
|
|
|
|
|
|
const TableList: FC = function() {
|
|
|
- const [{data, isFetching, count}, refetch] = useList();
|
|
|
- const [{page, pageSize}, {onPageChange}] = usePage(pageContext);
|
|
|
+ const [{data, count}, refetch] = useList();
|
|
|
const [
|
|
|
{columns, visible, editId, roleVisible, roleId, pdaId, pdaVisible},
|
|
|
{onAdd, onClose, onRoleClose, onPdaClose},
|
|
@@ -25,19 +22,13 @@ const TableList: FC = function() {
|
|
|
<Table
|
|
|
data-testid='role_table'
|
|
|
columns={columns}
|
|
|
- dataSource={data}
|
|
|
- rowKey='id'
|
|
|
- pagination={{
|
|
|
- current: page,
|
|
|
- pageSize,
|
|
|
- onChange: onPageChange,
|
|
|
- pageSizeOptions: PAGE_SIZE_LIST,
|
|
|
- total: count,
|
|
|
- showSizeChanger: true,
|
|
|
- }}
|
|
|
- loading={isFetching}
|
|
|
+ data={data}
|
|
|
+ pageContext={pageContext}
|
|
|
+ searchContext={searchContext}
|
|
|
+ count={count}
|
|
|
/>
|
|
|
</Card>
|
|
|
+
|
|
|
<RoleModal visible={visible} onClose={onClose} onFetch={refetch} id={editId} />
|
|
|
<TreeModal visible={roleVisible} onClose={onRoleClose} onFetch={refetch} id={roleId} />
|
|
|
<PdaMenuModal visible={pdaVisible} onClose={onPdaClose} onFetch={refetch} id={pdaId} />
|