handleNodeClick(node)}
+ draggable
+ onDragStart={(e) => handleDragStart(e, node)}
+ onDragOver={handleDragOver}
+ onDrop={(e) => handleDrop(e, node)}
style={{
- padding: '10px',
- border: '1px solid #d9d9d9',
- borderRadius: '4px',
- cursor: 'pointer',
- background: '#fff',
+ background: draggedNode?.id === node.id ? '#f0f0f0' : '#fff',
}}
>
{node.data.label}
diff --git a/src/pages/scenario/flowgram/editor.css b/src/pages/scenario/flowgram/editor.css
index 2f83d416..4cc351d9 100644
--- a/src/pages/scenario/flowgram/editor.css
+++ b/src/pages/scenario/flowgram/editor.css
@@ -1,10 +1,56 @@
.flowgram-editor-container {
- display: flex;
- flex-direction: column;
- height: 600px;
border: 1px solid #d9d9d9;
border-radius: 4px;
+ padding: 16px;
+ min-height: 600px;
+ display: flex;
+ flex-direction: column;
+}
+
+.flowgram-editor-toolbar {
+ margin-bottom: 16px;
+ display: flex;
+ gap: 8px;
+ flex-wrap: wrap;
+ flex-shrink: 0;
+}
+
+.flowgram-editor-canvas {
+ flex: 1;
+ min-height: 500px;
+ border: 1px dashed #d9d9d9;
+ border-radius: 4px;
+ padding: 16px;
background: #fafafa;
+ overflow-y: auto;
+ max-height: calc(80vh - 300px);
+}
+
+.flowgram-node-card {
+ padding: 12px;
+ background: white;
+ border: 1px solid #d9d9d9;
+ border-radius: 4px;
+ margin-bottom: 8px;
+ cursor: move;
+ user-select: none;
+ position: relative;
+}
+
+.flowgram-node-card:hover {
+ border-color: #40a9ff;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.flowgram-node-card-dragging {
+ opacity: 0.5;
+ cursor: grabbing;
+}
+
+.flowgram-node-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
}
.flowgram-toolbar {
diff --git a/src/pages/scenario/flowgramWorkflowModal.tsx b/src/pages/scenario/flowgramWorkflowModal.tsx
index e7cbc4f8..38a79c05 100644
--- a/src/pages/scenario/flowgramWorkflowModal.tsx
+++ b/src/pages/scenario/flowgramWorkflowModal.tsx
@@ -80,7 +80,9 @@ const FlowgramWorkflowModal: React.FC
= ({
onOk={handleOk}
onCancel={handleCancel}
confirmLoading={loading}
- width={1000}
+ width={1400}
+ style={{ top: 20 }}
+ bodyStyle={{ height: '80vh', overflow: 'auto' }}
maskClosable={false}
>