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..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 @@ -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: ( @@ -186,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 }, @@ -198,7 +205,7 @@ export const AddNodesEdges: React.FC = ({ title: '操作', dataIndex: 'operate', key: 'operate', - render: (_, record: any) => ( + render: (_, record: any) => (record.id === 'primary-key' ? 主键 : { @@ -269,31 +276,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 +347,7 @@ export const AddNodesEdges: React.FC = ({ draft.startList = [...list]; }); }; + return (