From 88a118c2cef0e38748c371e722905fef6e621ff7 Mon Sep 17 00:00:00 2001 From: noneAuth Date: Mon, 11 Dec 2023 14:20:41 +0800 Subject: [PATCH 1/3] feat: styles update --- .../graph-construct/add-nodes-edges/index.tsx | 92 ++++---- .../edit-nodes-edges/index.tsx | 104 ++++----- .../components/node-query/index.module.less | 6 +- .../components/path-query/index.module.less | 4 - .../domain-core/graph-query/index.module.less | 16 +- .../components/project-card/index.tsx | 23 +- client/src/layouts/global.less | 202 ++++++++++++------ client/src/layouts/index.less | 16 +- client/src/layouts/index.tsx | 6 +- client/src/pages/construct.tsx | 7 +- client/src/pages/query.tsx | 7 +- 11 files changed, 295 insertions(+), 188 deletions(-) diff --git a/client/src/components/studio/domain-core/graph-construct/add-nodes-edges/index.tsx b/client/src/components/studio/domain-core/graph-construct/add-nodes-edges/index.tsx index 17a43ecd..81fae62a 100644 --- a/client/src/components/studio/domain-core/graph-construct/add-nodes-edges/index.tsx +++ b/client/src/components/studio/domain-core/graph-construct/add-nodes-edges/index.tsx @@ -67,16 +67,16 @@ export const AddNodesEdges: React.FC = ({ const propertyList = () => { const attrPropertyNames = map( - filter(attrList, (attr) => !attr.optional && !attr.primaryField), - (item) => item.name + filter(attrList, attr => !attr.optional && !attr.primaryField), + 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 addButton = (handleAdd?: () => void, text: string = '添加属性') => { @@ -102,7 +102,7 @@ export const AddNodesEdges: React.FC = ({ return { inputType: EditType.SELECT, prop: { - options: map(data.nodes, (item) => ({ + options: map(data.nodes, item => ({ label: item.labelName, value: item.labelName, })), @@ -119,7 +119,7 @@ export const AddNodesEdges: React.FC = ({ return { inputType: EditType.SELECT, prop: { - options: map(data.nodes, (item) => ({ + options: map(data.nodes, item => ({ label: item.labelName, value: item.labelName, })), @@ -135,9 +135,9 @@ export const AddNodesEdges: React.FC = ({ { - updateState((draft) => { + updateState(draft => { draft.startList = [ - ...startList.filter((item) => item.id !== record?.id), + ...startList.filter(item => item.id !== record?.id), ]; }); }} @@ -197,7 +197,10 @@ export const AddNodesEdges: React.FC = ({ defaultValue: false, disabled: record.primaryField, options: [ - { label: '否', value: false }, + { + label: record.primaryField ? '否(主键)' : '否', + value: false, + }, { label: '是', value: true }, ], }, @@ -208,22 +211,25 @@ export const AddNodesEdges: React.FC = ({ title: '操作', dataIndex: 'operate', key: 'operate', - render: (_, record: any) => (record.primaryField ? 主键 : - { - updateState((draft) => { - draft.attrList = [ - ...attrList.filter((item) => item.id !== record?.id), - ]; - }); - }} - okText="确定" - cancelText="取消" - > - 删除 - - ), + render: (_, record: any) => + record.primaryField ? ( + 主键 + ) : ( + { + updateState(draft => { + draft.attrList = [ + ...attrList.filter(item => item.id !== record?.id), + ]; + }); + }} + okText="确定" + cancelText="取消" + > + 删除 + + ), }, ]; const nodeConfigColumns: EditColumnsType = [ @@ -312,9 +318,9 @@ export const AddNodesEdges: React.FC = ({ { - updateState((draft) => { + updateState(draft => { draft.configList = [ - ...configList.filter((item) => item.id !== record?.id), + ...configList.filter(item => item.id !== record?.id), ]; }); }} @@ -327,14 +333,14 @@ export const AddNodesEdges: React.FC = ({ }, ]; const addNodeAttr = () => { - updateState((draft) => { + updateState(draft => { const list = [...attrList]; list.push({ id: attrList.length + 1 }); draft.attrList = [...list]; }); }; const addNodeConfig = () => { - updateState((draft) => { + updateState(draft => { const list = [...configList]; list.push({ id: configList.length + 1, @@ -344,7 +350,7 @@ export const AddNodesEdges: React.FC = ({ }); }; const addEdge = () => { - updateState((draft) => { + updateState(draft => { const list = [...startList]; list.push({ id: `${startList.length + 1}` }); draft.startList = [...list]; @@ -365,7 +371,7 @@ export const AddNodesEdges: React.FC = ({ onClick={() => { onClose(); form.resetFields(); - updateState((draft) => { + updateState(draft => { draft.startList = []; draft.configList = []; draft.attrList = []; @@ -377,7 +383,7 @@ export const AddNodesEdges: React.FC = ({ + return ; } return ( <>