mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:40:50 +00:00
fix: deletion of operation linkage rules does not take effect in real time (#4058)
* fix: deletion of operation linkage rules does not take effect in real time * fix: bug
This commit is contained in:
parent
92b28fa411
commit
f808d99656
@ -34,7 +34,7 @@ import { ActionContextProvider } from './context';
|
|||||||
import { useA } from './hooks';
|
import { useA } from './hooks';
|
||||||
import { useGetAriaLabelOfAction } from './hooks/useGetAriaLabelOfAction';
|
import { useGetAriaLabelOfAction } from './hooks/useGetAriaLabelOfAction';
|
||||||
import { ComposedAction } from './types';
|
import { ComposedAction } from './types';
|
||||||
import { linkageAction } from './utils';
|
import { linkageAction, setInitialActionState } from './utils';
|
||||||
|
|
||||||
export const Action: ComposedAction = withDynamicSchemaProps(
|
export const Action: ComposedAction = withDynamicSchemaProps(
|
||||||
observer((props: any) => {
|
observer((props: any) => {
|
||||||
@ -93,6 +93,9 @@ export const Action: ComposedAction = withDynamicSchemaProps(
|
|||||||
}, [title, fieldSchema.title, t]);
|
}, [title, fieldSchema.title, t]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (field.stateOfLinkageRules) {
|
||||||
|
setInitialActionState(field);
|
||||||
|
}
|
||||||
field.stateOfLinkageRules = {};
|
field.stateOfLinkageRules = {};
|
||||||
linkageRules
|
linkageRules
|
||||||
.filter((k) => !k.disabled)
|
.filter((k) => !k.disabled)
|
||||||
|
@ -135,3 +135,11 @@ export const linkageAction = async ({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const setInitialActionState = (field) => {
|
||||||
|
field.data = field.data || {};
|
||||||
|
field.display = 'visible';
|
||||||
|
field.disabled = false;
|
||||||
|
field.data.hidden = false;
|
||||||
|
field.componentProps['disabled'] = false;
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user