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 = () => { export const useDestroyActionProps = () => {
const filterByTk = useFilterByTk(); const filterByTk = useFilterByTk();
const { resource, service } = useBlockRequestContext(); const { resource, service, block, __parent } = useBlockRequestContext();
const { setVisible } = useActionContext();
return { return {
async onClick() { async onClick() {
await resource.destroy({ await resource.destroy({
filterByTk, filterByTk,
}); });
service?.refresh?.(); service?.refresh?.();
if (block !== 'TableField') {
__parent?.service?.refresh?.();
setVisible?.(false);
}
}, },
}; };
}; };