diff --git a/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx b/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx index 60956492..96ba0a8f 100644 --- a/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx +++ b/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx @@ -124,7 +124,7 @@ const NodeConfigDrawer: React.FC = ({ const { configSchema } = nodeDefinition.graphConfig; console.log('NodeConfigModal - Rendering form items with schema:', configSchema); - + const formItems = []; // 根据 configSchema 生成表单项 @@ -200,7 +200,16 @@ const NodeConfigDrawer: React.FC = ({ layout="vertical" initialValues={{}} > - {renderFormItems()} + + {nodeDefinition?.graphConfig.configSchema && + Object.entries(nodeDefinition.graphConfig.configSchema.properties).map(([key, property]) => { + // 跳过 code 字段的显示 + if (key === 'code') return null; + const required = nodeDefinition.graphConfig.configSchema.required?.includes(key) || false; + return renderFormItem(key, property as SchemaProperty, required); + })} ); diff --git a/frontend/src/pages/Workflow/Definition/Design/utils/nodeUtils.ts b/frontend/src/pages/Workflow/Definition/Design/utils/nodeUtils.ts index 276291d8..9e1ba52c 100644 --- a/frontend/src/pages/Workflow/Definition/Design/utils/nodeUtils.ts +++ b/frontend/src/pages/Workflow/Definition/Design/utils/nodeUtils.ts @@ -16,7 +16,6 @@ export const addNodeToGraph = ( position?: { x: number, y: number } ) => { let nodeDefinition = workflowNodeDefinitionList.find(def => def.type === workflowDefinitionNode.type); - console.log(nodeDefinition.graphConfig.uiSchema, workflowDefinitionNode.graph) let uiGraph = isNew ? nodeDefinition.graphConfig.uiSchema : workflowDefinitionNode.graph; // 根据形状类型设置正确的 shape let shape = 'rect'; // 默认使用矩形 @@ -25,7 +24,6 @@ export const addNodeToGraph = ( } else if (uiGraph.shape === 'diamond') { shape = 'polygon'; } - console.log(nodeDefinition.type, workflowDefinitionNode.type) // 创建节点 return graph.addNode({ inherit: 'rect', @@ -50,7 +48,6 @@ export const addNodeToGraph = ( type: isNew ? nodeDefinition.type : workflowDefinitionNode.type, code: uiGraph.code, ports: convertPortConfig(uiGraph.ports), - nodeDefinition: nodeDefinition, - aaaaaa: "dasdasdsadasdd" + nodeDefinition: nodeDefinition }); }; \ No newline at end of file