Skip to content

Commit 28e6d3c

Browse files
author
Moyee
authored
fix: 修复图构建模块的体验问题 (#37)
* fix: 修复bug * fix: 默认主键为必填
1 parent bf81854 commit 28e6d3c

File tree

3 files changed

+41
-33
lines changed
  • client/packages

3 files changed

+41
-33
lines changed

client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/domain-core/graph-construct/add-nodes-edges/index.tsx

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ export const AddNodesEdges: React.FC<Prop> = ({
4646
configList: Array<IndexData>;
4747
}>({
4848
startList: [],
49-
attrList: [],
49+
attrList: [{
50+
id: 'primary-key',
51+
name: '',
52+
type: '',
53+
optional: false
54+
}],
5055
configList: [],
5156
});
5257
const { startList, attrList, configList } = state;
@@ -59,7 +64,7 @@ export const AddNodesEdges: React.FC<Prop> = ({
5964

6065
const propertyList = () => {
6166
const attrPropertyNames = map(
62-
filter(attrList, attr => !attr.optional),
67+
filter(attrList, attr => !attr.optional && attr.id !== 'primary-key'),
6368
item => item.name,
6469
);
6570
const indexPropertyNames = map(configList, item => item.propertyName);
@@ -141,6 +146,7 @@ export const AddNodesEdges: React.FC<Prop> = ({
141146
),
142147
},
143148
];
149+
144150
const defaultColumns: EditColumnsType<AttrData> = [
145151
{
146152
title: (
@@ -186,6 +192,7 @@ export const AddNodesEdges: React.FC<Prop> = ({
186192
inputType: EditType.SELECT,
187193
prop: {
188194
defaultValue: false,
195+
disabled: record.id === 'primary-key',
189196
options: [
190197
{ label: '否', value: false },
191198
{ label: '是', value: true },
@@ -198,7 +205,7 @@ export const AddNodesEdges: React.FC<Prop> = ({
198205
title: '操作',
199206
dataIndex: 'operate',
200207
key: 'operate',
201-
render: (_, record: any) => (
208+
render: (_, record: any) => (record.id === 'primary-key' ? <a style={{ color: 'rgba(54,55,64,1)' }}>主键</a> :
202209
<Popconfirm
203210
title="确定要删除吗?"
204211
onConfirm={() => {
@@ -269,31 +276,31 @@ export const AddNodesEdges: React.FC<Prop> = ({
269276
};
270277
},
271278
},
272-
{
273-
title: (
274-
<>
275-
主键
276-
<Tooltip title="主键必须是唯一索引">
277-
<QuestionCircleOutlined />
278-
</Tooltip>
279-
</>
280-
),
281-
dataIndex: 'primaryField',
282-
width: '17.5%',
283-
key: 'primaryField',
284-
editable: true,
285-
editorConfig: (record: IndexData) => {
286-
return {
287-
inputType: EditType.SELECT,
288-
prop: {
289-
options: [
290-
{ label: '否', value: false },
291-
{ label: '是', value: true },
292-
],
293-
},
294-
};
295-
},
296-
},
279+
// {
280+
// title: (
281+
// <>
282+
// 主键
283+
// <Tooltip title="主键必须是唯一索引">
284+
// <QuestionCircleOutlined />
285+
// </Tooltip>
286+
// </>
287+
// ),
288+
// dataIndex: 'primaryField',
289+
// width: '17.5%',
290+
// key: 'primaryField',
291+
// editable: true,
292+
// editorConfig: (record: IndexData) => {
293+
// return {
294+
// inputType: EditType.SELECT,
295+
// prop: {
296+
// options: [
297+
// { label: '否', value: false },
298+
// { label: '是', value: true },
299+
// ],
300+
// },
301+
// };
302+
// },
303+
// },
297304
{
298305
title: '操作',
299306
dataIndex: 'operate',
@@ -340,6 +347,7 @@ export const AddNodesEdges: React.FC<Prop> = ({
340347
draft.startList = [...list];
341348
});
342349
};
350+
343351
return (
344352
<SwitchDrawer
345353
visible={visible}

client/packages/app/client/src/components/@@plugins/src/components/studio/tugraph/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"@codemirror/lang-java": "^6.0.1",
1616
"@codemirror/lang-json": "^6.0.1",
1717
"@codemirror/lang-python": "^6.1.2",
18+
"@difizen/cofine-editor-core": "^0.0.1-alpha.4",
19+
"@difizen/cofine-language-cypher": "^0.0.1-alpha.4",
1820
"@uiw/react-codemirror": "^4.20.2",
1921
"@umijs/plugin-request": "^2.9.0",
2022
"ahooks": "^3.7.2",
@@ -31,9 +33,7 @@
3133
"tsparticles": "2.9.3",
3234
"umi": "^3.5.20",
3335
"umi-request": "^1.4.0",
34-
"use-immer": "^0.8.1",
35-
"@difizen/cofine-editor-core": "^0.0.1-alpha.4",
36-
"@difizen/cofine-language-cypher": "^0.0.1-alpha.4"
36+
"use-immer": "^0.8.1"
3737
},
3838
"devDependencies": {
3939
"@types/react": "^18.0.0",

client/packages/plugins/graph-analysis/src/client/GI_EXPORT_FILES.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,9 +1524,9 @@ export default {
15241524
},
15251525
"GI_ASSETS_TUGRAPH_DB": {
15261526
"name": "@tugraph/gi-assets-tugraph-db",
1527-
"version": "0.6.33",
1527+
"version": "0.6.35",
15281528
"global": "GI_ASSETS_TUGRAPH_DB",
1529-
"url": "https://gw.alipayobjects.com/os/lib/tugraph/gi-assets-tugraph-db/0.6.33/dist/index.min.js"
1529+
"url": "https://gw.alipayobjects.com/os/lib/tugraph/gi-assets-tugraph-db/0.6.35/dist/index.min.js"
15301530
}
15311531
}
15321532
}

0 commit comments

Comments
 (0)