From afe131d803d92daa1eb7c8d295ffc4b40abbe722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=9A=E5=88=99?= Date: Wed, 8 Nov 2023 14:08:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graph-construct/add-nodes-edges/index.tsx | 63 ++++++++++--------- .../components/studio/tugraph/package.json | 6 +- .../src/client/GI_EXPORT_FILES.ts | 4 +- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx index 44bbe664..f2b752fd 100644 --- a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx +++ b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx @@ -46,7 +46,12 @@ export const AddNodesEdges: React.FC = ({ configList: Array; }>({ startList: [], - attrList: [], + attrList: [{ + id: 'primary-key', + name: '', + type: '', + optional: false + }], configList: [], }); const { startList, attrList, configList } = state; @@ -59,7 +64,7 @@ export const AddNodesEdges: React.FC = ({ const propertyList = () => { const attrPropertyNames = map( - filter(attrList, attr => !attr.optional), + filter(attrList, attr => !attr.optional && attr.id !== 'primary-key'), item => item.name, ); const indexPropertyNames = map(configList, item => item.propertyName); @@ -141,6 +146,7 @@ export const AddNodesEdges: React.FC = ({ ), }, ]; + const defaultColumns: EditColumnsType = [ { title: ( @@ -198,7 +204,7 @@ export const AddNodesEdges: React.FC = ({ title: '操作', dataIndex: 'operate', key: 'operate', - render: (_, record: any) => ( + render: (_, record: any) => (record.id === 'primary-key' ? 主键 : { @@ -269,31 +275,31 @@ export const AddNodesEdges: React.FC = ({ }; }, }, - { - title: ( - <> - 主键 - - - - - ), - dataIndex: 'primaryField', - width: '17.5%', - key: 'primaryField', - editable: true, - editorConfig: (record: IndexData) => { - return { - inputType: EditType.SELECT, - prop: { - options: [ - { label: '否', value: false }, - { label: '是', value: true }, - ], - }, - }; - }, - }, + // { + // title: ( + // <> + // 主键 + // + // + // + // + // ), + // dataIndex: 'primaryField', + // width: '17.5%', + // key: 'primaryField', + // editable: true, + // editorConfig: (record: IndexData) => { + // return { + // inputType: EditType.SELECT, + // prop: { + // options: [ + // { label: '否', value: false }, + // { label: '是', value: true }, + // ], + // }, + // }; + // }, + // }, { title: '操作', dataIndex: 'operate', @@ -340,6 +346,7 @@ export const AddNodesEdges: React.FC = ({ draft.startList = [...list]; }); }; + return ( Date: Wed, 8 Nov 2023 14:24:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E9=BB=98=E8=AE=A4=E4=B8=BB=E9=94=AE?= =?UTF-8?q?=E4=B8=BA=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain-core/graph-construct/add-nodes-edges/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx index f2b752fd..e26de73b 100644 --- a/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx +++ b/client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx @@ -192,6 +192,7 @@ export const AddNodesEdges: React.FC = ({ inputType: EditType.SELECT, prop: { defaultValue: false, + disabled: record.id === 'primary-key', options: [ { label: '否', value: false }, { label: '是', value: true },