fix(client): close the pop-up after request

This commit is contained in:
chenos 2022-06-22 14:10:30 +08:00
parent a8ce758cab
commit 529380fb69

View File

@ -228,6 +228,7 @@ export const useCustomizeRequestActionProps = () => {
const currentUserContext = useCurrentUserContext(); const currentUserContext = useCurrentUserContext();
const currentUser = currentUserContext?.data?.data; const currentUser = currentUserContext?.data?.data;
const actionField = useField(); const actionField = useField();
const { visible, setVisible } = useActionContext();
return { return {
async onClick() { async onClick() {
@ -236,7 +237,7 @@ export const useCustomizeRequestActionProps = () => {
if (!requestSettings['url']) { if (!requestSettings['url']) {
return; return;
} }
if (skipValidator === false && xAction === 'customize:form:request') { if (skipValidator !== true && xAction === 'customize:form:request') {
await form.submit(); await form.submit();
} }
@ -263,12 +264,13 @@ export const useCustomizeRequestActionProps = () => {
...requestBody, ...requestBody,
}); });
actionField.data.loading = false; actionField.data.loading = false;
service?.refresh?.();
if (!(resource instanceof TableFieldResource)) { if (!(resource instanceof TableFieldResource)) {
__parent?.service?.refresh?.(); __parent?.service?.refresh?.();
} }
service?.refresh?.();
if (xAction === 'customize:form:request') {
setVisible?.(false);
}
if (!onSuccess?.successMessage) { if (!onSuccess?.successMessage) {
return; return;
} }