diff --git a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/edit-nodes-edges/index.tsx b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/edit-nodes-edges/index.tsx index e6910b1a..9bbd8c2a 100644 --- a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/edit-nodes-edges/index.tsx +++ b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/edit-nodes-edges/index.tsx @@ -20,6 +20,7 @@ type Prop = { currentGraphName: string; onRefreshSchema?: () => void; onSwitch?: (onShow: () => void, onClose: () => void) => void; + onVisible?: (visible: boolean) => void; }; type EditColumnsType = ColumnsType & { inputType?: string; @@ -36,6 +37,7 @@ export const EditNodesEdges: React.FC = ({ currentGraphName, onRefreshSchema, onSwitch, + onVisible, }) => { const [form] = Form.useForm(); const { @@ -62,18 +64,23 @@ export const EditNodesEdges: React.FC = ({ useEffect(() => { onSwitch?.(onShow, onClose); }, []); + + useEffect(() => { + onVisible?.(visible); + }, [visible]); + const propertyList = () => { const attrPropertyNames = map( - filter(attrList, (attr) => !attr.optional), - (item) => item.name + filter(attrList, attr => !attr.optional), + item => item.name, ); - const indexPropertyNames = map(configList, (item) => item.propertyName); + const indexPropertyNames = map(configList, item => item.propertyName); return map( filter( xor(attrPropertyNames, indexPropertyNames), - (item) => item !== undefined + item => item !== undefined, ), - (item) => ({ label: item, value: item }) + item => ({ label: item, value: item }), ); }; const operateEdit = (record: AttrData) => { @@ -82,8 +89,8 @@ export const EditNodesEdges: React.FC = ({