mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: pagination count not updating after deleting data in subtable (#5648)
* fix: pagination count not updating after deleting data in subtable * fix: bug * fix: bug
This commit is contained in:
parent
514a63edbf
commit
e4fd3679d5
@ -2,9 +2,7 @@
|
||||
"version": "1.4.0-alpha.11",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"npmClientArgs": [
|
||||
"--ignore-engines"
|
||||
],
|
||||
"npmClientArgs": ["--ignore-engines"],
|
||||
"command": {
|
||||
"version": {
|
||||
"forcePublish": true,
|
||||
|
@ -181,7 +181,7 @@ export const SubTable: any = observer(
|
||||
return {
|
||||
current: currentPage > page ? page : currentPage,
|
||||
pageSize: pageSize || 10,
|
||||
total: field?.value?.length,
|
||||
total: field?.value,
|
||||
onChange: (page, pageSize) => {
|
||||
setCurrentPage(page);
|
||||
setPageSize(pageSize);
|
||||
|
@ -200,23 +200,23 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
|
||||
render: (v, record, index) => {
|
||||
if (props.showDel(record)) {
|
||||
return (
|
||||
<CloseOutlined
|
||||
style={{ cursor: 'pointer', color: 'gray' }}
|
||||
<div
|
||||
onClick={() => {
|
||||
return action(() => {
|
||||
const fieldIndex = (current - 1) * pageSize + index;
|
||||
const deleteCount = field.value[fieldIndex] ? 1 : 2;
|
||||
spliceArrayState(field, {
|
||||
startIndex: fieldIndex,
|
||||
deleteCount: 1,
|
||||
});
|
||||
field.value.splice(fieldIndex, 1);
|
||||
setTimeout(() => {
|
||||
field.value[field.value.length] = null;
|
||||
deleteCount: deleteCount,
|
||||
});
|
||||
field.value.splice(fieldIndex, deleteCount);
|
||||
field.setInitialValue(field.value);
|
||||
return field.onInput(field.value);
|
||||
});
|
||||
}}
|
||||
/>
|
||||
>
|
||||
<CloseOutlined style={{ cursor: 'pointer', color: 'gray' }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user