Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
155a3d61
Commit
155a3d61
authored
Sep 18, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
* 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
:
🐞
fix(TableLayout 组件): 修改跨页多选的问题
parents
e2ff0fdd
ab54e95f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
index.tsx
src/pages/transaction/components/tableLayout/index.tsx
+13
-13
No files found.
src/pages/transaction/components/tableLayout/index.tsx
View file @
155a3d61
...
@@ -9,6 +9,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
...
@@ -9,6 +9,7 @@ import { createFormActions, FormEffectHooks } from '@formily/antd';
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'@/pages/transaction/effect/index'
;
import
{
searchSelectGetSelectCategoryOptionEffect
}
from
'@/pages/transaction/effect/index'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
const
{
onFormMount$
}
=
FormEffectHooks
const
{
onFormMount$
}
=
FormEffectHooks
interface
Iprops
{
interface
Iprops
{
...
@@ -58,7 +59,15 @@ const Table: React.FC<Iprops> = (props: any) => {
...
@@ -58,7 +59,15 @@ const Table: React.FC<Iprops> = (props: any) => {
getCheckboxProps
getCheckboxProps
}
=
props
;
}
=
props
;
const
tableRef
=
useRef
<
any
>
({});
const
tableRef
=
useRef
<
any
>
({});
const
[
selectRow
,
selectRowFns
]
=
useRowSelectionTable
({
customKey
:
rowKey
||
'id'
,
extendsSelection
:
{
onChange
:
(
_rowKeys
:
any
)
=>
{
fetchRowkeys
(
selectRowFns
.
selectedRowKeys
)
},
getCheckboxProps
:
(
record
)
=>
getCheckboxProps
&&
getCheckboxProps
(
record
)
}
});
/** 列表数据 */
/** 列表数据 */
const
fetchData
=
(
params
?:
any
)
=>
{
const
fetchData
=
(
params
?:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -77,20 +86,11 @@ const Table: React.FC<Iprops> = (props: any) => {
...
@@ -77,20 +86,11 @@ const Table: React.FC<Iprops> = (props: any) => {
})
})
}
}
/**多选 */
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
Array
<
number
>>
([]);
const
rowSelection
:
TableRowSelection
<
any
>
=
{
selectedRowKeys
:
selectedRowKeys
,
onChange
:
(
rowKeys
:
any
)
=>
{
fetchRowkeys
(
rowKeys
)
setSelectedRowKeys
(
rowKeys
);
},
getCheckboxProps
:
(
record
)
=>
getCheckboxProps
&&
getCheckboxProps
(
record
)
}
useImperativeHandle
(
reload
,
()
=>
({
useImperativeHandle
(
reload
,
()
=>
({
reload
:
()
=>
{
reload
:
()
=>
{
tableRef
.
current
.
reload
();
tableRef
.
current
.
reload
();
selectRowFns
.
setSelectRow
([])
selectRowFns
.
setSelectedRowKeys
([])
}
}
}));
}));
...
@@ -129,7 +129,7 @@ const Table: React.FC<Iprops> = (props: any) => {
...
@@ -129,7 +129,7 @@ const Table: React.FC<Iprops> = (props: any) => {
currentRef=
{
tableRef
}
currentRef=
{
tableRef
}
columns=
{
columns
}
columns=
{
columns
}
tableProps=
{
{
rowKey
:
rowKey
?
rowKey
:
'id'
}
}
tableProps=
{
{
rowKey
:
rowKey
?
rowKey
:
'id'
}
}
rowSelection=
{
selectedRow
&&
rowSelection
}
rowSelection=
{
selectedRow
&&
selectRow
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
controlRender=
{
<
NiceForm
<
NiceForm
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment