feat: o2m delete not refresh (#646)

* feat: o2m delete not refresh

* feat: add TableField judgment
This commit is contained in:
金昶 2022-07-25 10:41:28 +08:00 committed by GitHub
parent c86b6f9a06
commit 5b61587a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,13 +388,18 @@ export const useUpdateActionProps = () => {
export const useDestroyActionProps = () => {
const filterByTk = useFilterByTk();
const { resource, service } = useBlockRequestContext();
const { resource, service, block, __parent } = useBlockRequestContext();
const { setVisible } = useActionContext();
return {
async onClick() {
await resource.destroy({
filterByTk,
});
service?.refresh?.();
if (block !== 'TableField') {
__parent?.service?.refresh?.();
setVisible?.(false);
}
},
};
};