diff --git a/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx b/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx index 9fb6be2f..c86bebb3 100644 --- a/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx +++ b/frontend/src/pages/Workflow/Definition/Design/components/NodeConfigModal.tsx @@ -1,5 +1,5 @@ import React, {useEffect, ReactNode} from 'react'; -import {Drawer, Form, Input, Select, Button, Space, Divider, Tooltip} from 'antd'; +import {Drawer, Form, Input, Select, Button, Space, Tabs, Tooltip} from 'antd'; import {InfoCircleOutlined} from '@ant-design/icons'; import {Cell} from '@antv/x6'; import {NodeDefinitionResponse} from "@/pages/Workflow/NodeDesign/types"; @@ -22,12 +22,12 @@ interface SchemaProperty { } const NodeConfigDrawer: React.FC = ({ - visible, - node, - nodeDefinition, - onOk, - onCancel, -}) => { + visible, + node, + nodeDefinition, + onOk, + onCancel, + }) => { const [form] = Form.useForm(); useEffect(() => { @@ -54,7 +54,7 @@ const NodeConfigDrawer: React.FC = ({ onCancel(); }; - const renderFormItem = (key: string, property: SchemaProperty, required: boolean) => { + const renderFormItem = (key: string, property: SchemaProperty, required: boolean, isReadOnly: boolean) => { const baseProps = { name: key, label: ( @@ -70,6 +70,14 @@ const NodeConfigDrawer: React.FC = ({ rules: [{required, message: `请输入${property.title}`}], }; + if (isReadOnly) { + return ( + + + + ); + } + switch (property.type) { case 'string': if (property.enum) { @@ -140,41 +148,6 @@ const NodeConfigDrawer: React.FC = ({ return formItems; }; - // 显示节点详细信息 - const renderNodeDetails = () => { - if (!nodeDefinition?.graphConfig.details) return null; - - const {details} = nodeDefinition.graphConfig; - return ( - <> - 节点说明 - {/*
*/} - {/*

{details.description}

*/} - {/* {details.features && details.features.length > 0 && (*/} - {/*
*/} - {/* 功能特点:*/} - {/*
    */} - {/* {details.features.map((feature, index) => (*/} - {/*
  • {feature}
  • */} - {/* ))}*/} - {/*
*/} - {/*
*/} - {/* )}*/} - {/* {details.scenarios && details.scenarios.length > 0 && (*/} - {/*
*/} - {/* 适用场景:*/} - {/*
    */} - {/* {details.scenarios.map((scenario, index) => (*/} - {/*
  • {scenario}
  • */} - {/* ))}*/} - {/*
*/} - {/*
*/} - {/* )}*/} - {/*
*/} - - ); - }; - return ( = ({ } > - {/*{renderNodeDetails()}*/} - 节点配置 -
- - - {nodeDefinition?.panelVariablesSchema && - Object.entries(nodeDefinition.panelVariablesSchema.properties).map(([key, property]) => { - const required = nodeDefinition.panelVariablesSchema?.properties.required?.includes(key) || false; - return renderFormItem(key, property as SchemaProperty, required); - })} -
+ + {nodeDefinition?.panelVariablesSchema && ( + + {Object.entries(nodeDefinition.panelVariablesSchema.properties).map(([key, property]) => { + const required = nodeDefinition.panelVariablesSchema?.properties.required?.includes(key) || false; + return renderFormItem(key, property as SchemaProperty, required, false); + })} + + )} + {nodeDefinition?.localVariablesSchema && ( + + {Object.entries(nodeDefinition.localVariablesSchema.properties).map(([key, property]) => { + const required = nodeDefinition.localVariablesSchema?.properties.required?.includes(key) || false; + return renderFormItem(key, property as SchemaProperty, required, true); + })} + + )} +
); };