fix: refresh selection after deleting by batch

This commit is contained in:
jialin
2025-05-16 16:07:55 +08:00
parent febdc5b8e2
commit 6340f1fb54
4 changed files with 41 additions and 13 deletions
+10 -3
View File
@@ -343,11 +343,18 @@ const Models: React.FC<ModelsProps> = ({
operation: 'common.delete.confirm',
selection: true,
async onOk() {
await handleBatchRequest(rowSelection.selectedRowKeys, deleteModel);
rowSelection.clearSelections();
removeExpandedRowKey(rowSelection.selectedRowKeys);
const successIds: any[] = [];
const res = await handleBatchRequest(
rowSelection.selectedRowKeys,
async (id: any) => {
await deleteModel(id);
successIds.push(id);
}
);
rowSelection.removeSelectedKeys(successIds);
handleDeleteSuccess();
handleSearch();
return res;
}
});
};