From 2d2eaafcd45b75ebc053b710db32f2a1f3b23acc Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 25 Jun 2025 00:04:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E4=BC=98=E5=8C=96=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/src/pages/ai/flow/FlowEditor.tsx | 33 ++++- .../src/pages/ai/flow/node/AmisNode.tsx | 117 +++++++++--------- 2 files changed, 85 insertions(+), 65 deletions(-) diff --git a/service-web/client/src/pages/ai/flow/FlowEditor.tsx b/service-web/client/src/pages/ai/flow/FlowEditor.tsx index afeab5c..cf9624e 100644 --- a/service-web/client/src/pages/ai/flow/FlowEditor.tsx +++ b/service-web/client/src/pages/ai/flow/FlowEditor.tsx @@ -26,16 +26,37 @@ import {useDataStore} from './store/DataStore.ts' import {useFlowStore} from './store/FlowStore.ts' const FlowableDiv = styled.div` - height: 92vh; + height: 100%; + + .react-flow__node.selectable { + &:focus { + box-shadow: 0 0 20px 1px #e8e8e8; + border-radius: 8px; + } + } + + .react-flow__handle.connectionindicator { + width: 10px; + height: 10px; + background-color: #ffffff; + border: 1px solid #000000; + + &:hover { + background-color: #e8e8e8; + border: 1px solid #c6c6c6; + } + } .toolbar { + position: absolute; + right: 20px; + top: 20px; } .node-card { - cursor: grab; + cursor: default; .card-container { - cursor: default; } } ` @@ -112,7 +133,7 @@ function FlowEditor() { { type: 'wrapper', size: 'none', - className: 'space-x-1 float-right', + className: 'space-x-2 text-right', body: [ { type: 'action', @@ -258,10 +279,10 @@ function FlowEditor() { "data": { "BMFP3Eov94": { "inputs": { - "文件名": { + "name": { "type": "text" }, - "文件描述": { + "description": { "type": "text", "description": "文件描述" } diff --git a/service-web/client/src/pages/ai/flow/node/AmisNode.tsx b/service-web/client/src/pages/ai/flow/node/AmisNode.tsx index 76257e9..6fff834 100644 --- a/service-web/client/src/pages/ai/flow/node/AmisNode.tsx +++ b/service-web/client/src/pages/ai/flow/node/AmisNode.tsx @@ -69,71 +69,70 @@ const AmisNode = ( const nodeName = isEmpty(nodeData?.node?.name) ? defaultNodeName : nodeData.node.name const nodeDescription = isEmpty(nodeData?.node?.description) ? defaultNodeDescription : nodeData.node?.description return ( -
- - , - }, - { - key: 'remove', - label: '删除', - icon: , - }, - ], - onClick: menu => { - switch (menu.key) { - case 'edit': - // @ts-ignore - editNode( - id, - defaultNodeName, - defaultNodeDescription, - [ - { - type: 'input-text', - name: 'node.name', - label: '节点名称', - placeholder: nodeName, - }, - { - type: 'textarea', - name: 'node.description', - label: '节点描述', - placeholder: nodeDescription, - }, - { - type: 'divider', - }, - ...(columnSchema ?? []), - ], - ) - break - case 'remove': - // @ts-ignore - removeNode(id) - break - } +
+ , }, - }} + { + key: 'remove', + label: '删除', + icon: , + }, + ], + onClick: menu => { + switch (menu.key) { + case 'edit': + // @ts-ignore + editNode( + id, + defaultNodeName, + defaultNodeDescription, + [ + { + type: 'input-text', + name: 'node.name', + label: '节点名称', + placeholder: nodeName, + }, + { + type: 'textarea', + name: 'node.description', + label: '节点描述', + placeholder: nodeDescription, + }, + { + type: 'divider', + }, + ...(columnSchema ?? []), + ], + ) + break + case 'remove': + // @ts-ignore + removeNode(id) + break + } + }, + }} + > +
{nodeDescription} {extraNodeDescription?.(nodeData)}
-
- + + {isEqual(type, 'start') || isEqual(type, 'normal') ? : undefined} {isEqual(type, 'end') || isEqual(type, 'normal')