From b270594f0fd790c04d02525aa7a454b95006f506 Mon Sep 17 00:00:00 2001 From: wb-whq906489 Date: Wed, 27 Sep 2023 09:33:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit-nodes-edges/index.tsx | 99 ++++++++++--------- .../domain-core/graph-construct/index.tsx | 7 +- .../tugraph/domain-core/graph-query/index.tsx | 96 +++++++++--------- 3 files changed, 108 insertions(+), 94 deletions(-) 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 = ({